POV-Ray : Newsgroups : povray.binaries.images : n-foil : Re: n-foil Server Time
20 May 2024 00:07:46 EDT (-0400)
  Re: n-foil  
From: Bald Eagle
Date: 5 Aug 2023 18:55:00
Message: <web.64ced2d5357dd0011f9dae3025979125@news.povray.org>
"Samuel B." <stb### [at] hotmailcom> wrote:
> "Samuel B." <stb### [at] hotmailcom> wrote:
> > Pattern function for an n-foil
>
> Ideally, the center would be empty, but I don't know how to approach that
> problem atm :P

#declare Radius = 0.2;
#declare Circle = function {sqrt (x*x + y*y)}

/ function before repetition
 #local F =
 function {
  pattern {
   function{
    //PF(0, sqrt(x*x+pow(max(y, 0), 2)), 0)
    PF(0, max (sqrt(x*x+pow(max(y, 0), 2)), Circle (x, y, z) - Radius), 0)
   }
   rotate -z*180/N
   translate y*Scale
  }
 }


Gives me an N-sided hole in the center.
Not sure how to get it to be an actual circle....

- BW


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.