POV-Ray : Newsgroups : povray.text.tutorials : spiral : Re: spiral Server Time
28 Mar 2024 08:03:47 EDT (-0400)
  Re: spiral  
From: Mike Williams
Date: 30 Mar 2007 01:01:18
Message: <ZNn1sIAsaKDGFwYT@econym.demon.co.uk>
Wasn't it sahraoui who wrote:
>Actually
>I use a while loop to make my spiral and I can make
>as many as possible and it is rather simple
>it is a translation and a rotation.
>BUT with this method it is not easy to make the helix
>follow a sine curve.

If you're using a sphere_sweep, like this

#declare R1=1.5;
#declare F1=1.2;
#declare R2=0.15;
#declare N=100;
#declare H=10;

sphere_sweep {
  b_spline
  100,            
  #declare Y=0;
  #while (Y<N)
    <R1*sin(F1*Y),Y*H/N-H/2,R1*cos(F1*Y)>,R2
    #declare Y=Y+1;
  #end
  pigment {rgb 1}
}

Then you can just add an extra sinusoidal factor to the x value of the
points, like this

#declare R1=1.5;
#declare F1=1.2;
#declare R2=0.15;
#declare N=100;
#declare H=10;

#declare F2=0.2;
#declare A=0.25;

sphere_sweep {
  b_spline
  100,            

  #declare Y=0;
  #while (Y<N)
    <R1*sin(F1*Y)+A*sin(F2*Y),Y*H/N-H/2,R1*cos(F1*Y)>,R2
    #declare Y=Y+1;
  #end
  pigment {rgb 1}
}


-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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