POV-Ray : Newsgroups : povray.advanced-users : Logarithmic spiral tube : Re: Logarithmic spiral tube Server Time24 Feb 2024 18:01:01 EST (-0500)
 Re: Logarithmic spiral tube
 From: Robert McGregor Date: 26 Jan 2021 19:45:01 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.6010b70675e9c60d87570eab0%40news.povray.org",
"dateCreated": "2021-01-27T00:45:01+00:00",
"datePublished": "2021-01-27T00:45:01+00:00",
"author": {
"@type": "Person",
"name": "Robert McGregor"
}
}
Mike Horvath <mik### [at] gmailcom> wrote:
> How would I create a tube in the shape of a logarithmic spiral? It
> should have an even thickness. Do I need to use an isosurface once
> again? Thanks.

If you have the parametric equation already for a spiral isosurface and you just
a need a smooth tube, then a difference of two sphere sweeps would render *much*
faster than an isosurface.

Just make the radius of the outer one a bit larger and the length of the
differenced sweep a bit longer, so you get open ends (or just use other
differencing objects to snip off the ends).

Maybe something like this non-logarithmic spiral:

#local pt_cnt = int(pi/incr+0.5);
#local tt = 0;
sphere_sweep {
cubic_spline
pt_cnt
#while (tt < pi)
#local xt = outer_rad * cos(turns*2*tt) * sin(tt);
#local yt = outer_rad * sin(turns*2*tt) * sin(tt);
#local zt = outer_rad * cos(tt);
#local tt = tt + incr;
#end
tolerance 0.1
}
#end

difference {
object { Spherical_Spiral(5, 3, 0.12, 0.03) pigment {color Red} }
object { Spherical_Spiral(5, 3, 0.10, 0.03) pigment {color Blue} }
box {-1, 1 scale 12 translate x*12}
rotate y*40
}

Cheers,
Rob
```