POV-Ray : Newsgroups : povray.text.tutorials : spiral : Re: spiral Server Time17 Sep 2021 20:58:43 EDT (-0400)
 Re: spiral
 From: sahraoui Date: 30 Mar 2007 16:10:00 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.460d7c0acef26043439ba8f00%40news.povray.org",
"dateCreated": "2007-03-30T20:10:00+00:00",
"datePublished": "2007-03-30T20:10:00+00:00",
"author": {
"@type": "Person",
"name": "sahraoui"
}
}
Hi Mike

Thanks a lot for the file.
Actually i was trying that same loop
but got entangled inside and got the code
to run forever until I saw your message. thanks again.
The parametric stuff did not work for some reason.

Now here is the thing. What you sent me make the spiral follow
the sinus line indeed but BUT every "circle" of the spiral
is NOT perpendicular to the line of the sinus but it
is always perpendicular to the horizontal.
In other words your code produce a helix who axis is
always parallel to the horizontal
but what would be perfect is a helix whose axis
is parallel to the sinus fonction that follows, andn that I beleive
is not a piece of cake...but may be not for you Oh gentleman of Leisure

embedding that into a larger sheet of beads would be quite a challenge too.

Regards and have a great week end

Mike Williams <nos### [at] econymdemoncouk> wrote:
> 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
```