POV-Ray : Newsgroups : povray.general : Encyclopedia of Remarkable Mathematical Forms : Re: Encyclopedia of Remarkable Mathematical Forms Server Time
15 Apr 2025 02:03:59 EDT (-0400)
  Re: Encyclopedia of Remarkable Mathematical Forms  
From: William F Pokorny
Date: 3 Apr 2025 00:19:41
Message: <67ee0c5d$1@news.povray.org>
On 4/2/25 21:55, yesbird wrote:
> And Povray is no exception 🙂.
> In attachment is MathView vision of this canonical example:
> 
> // --------------------------------------- parametric surface -------------
> #declare a = 1.0;                       // conical spiral

Thanks for posting code. Below is a variation which runs quite a bit 
faster with POV-Ray for those with tiny machines like mine.

The key is the change to max_gradient. Tutorials, examples and our 
documentation have always treated / considered the parametric{} 
max_gradient in the same way as that used for the isosurface{}. However, 
they are different implementations.

The max_gradient for the parametric should often be <1.0 and it can 
sometimes be <<1.0. I "think" I suggested a default max_gradient of 0.1 
for our source code would be better, but I've not made the change as yet 
  in my yuqk fork. (A few example parametric{}s do need 1.0 or a little 
more).

Somewhere there is a forum thread and I have data and notes, but not 
finding any of it in a quick search. Anyhow, my changes for the the 
attached image:

// ------------------------------ parametric surface -------------
#declare a = 1.0;   // conical spiral
#declare b = 12;    // 8
#declare c = 0.4;   // 0.2
#declare n = 5;
#declare Para00 = parametric{
   function { a*(1-0.5*v/pi)*sin(n*v+0.5*pi)*(1-cos(u))
              + c*sin(n*v+0.5*pi) }
   function { b*0.5*v/pi + a*(1-0.5*v/pi)*sin(u) }
   function { a*(1-0.5*v/pi)*cos(n*v+0.5*pi)*(1-cos(u))
              + c*cos(n*v+0.5*pi) }
    <0,0>,<2*pi,2*pi>  // start, end of (u,v)
// contained_by {box {<-1,-1,-1>*2*pi,<1,b/3,1>*2*pi}}
    contained_by {box {<-1,-0.2,-1>*tau,<1,b/3,1>*tau}}
// max_gradient 8
    max_gradient 0.1
// accuracy 0.01
    accuracy 0.0005
    precompute 18 x,y,z
} // end of parametric

...

     union {
         object { Para00 }
         object { Para00 rotate y*+90 translate +<1,0,1>*tau}
         object { Para00 rotate y*-90 translate -<1,0,1>*tau }
         texture{
             pigment{ color rgb<1,1,1>}
             finish { emission <0.1,0,0> phong 0.5}
         }
         scale 1/b
     }

Bill P.


Post a reply to this message


Attachments:
Download 'ybspiral.png' (68 KB)

Preview of image 'ybspiral.png'
ybspiral.png


 

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