POV-Ray : Newsgroups : povray.advanced-users : Logarithmic spiral tube : Re: Logarithmic spiral tube Server Time 1 Mar 2024 00:05:06 EST (-0500)
 Re: Logarithmic spiral tube
 From: Bald Eagle Date: 27 Jan 2021 07:00:00 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.6011555575e9c60d1f9dae300%40news.povray.org",
"dateCreated": "2021-01-27T12:00:00+00:00",
"datePublished": "2021-01-27T12:00:00+00:00",
"author": {
"@type": "Person",
"name": "Bald Eagle"
}
}
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.
>
>
> Mike

I think you HAVE TO use a parametric or a loop, since you're going to need angle
values in your equation greater than tau, else you'll get a "circle of values"
rather than a "spiral of values" due to the atan2 in the implicit form required
for evaluating an isosurface.

so following:

0

this didn't work - it just gives an Archimedian spiral.

camera {orthographic
location <0,10,-0.1>
look_at 0
angle 90}

light_source {<0, 10, -10> rgb 1 shadowless}

plane {y, -1 pigment { checker rgb 0.5, rgb 1 }}

#declare Thickness = 0.1;
#declare Freq = 2;
#declare Spirals = 1;

#declare Logarithmic =
function {
Thickness - y*y*Freq -
pow (
sin (
sqrt (x*x+z*z) * Freq -
(pi * exp (0.15 * atan2 (z,x) ) )
)
, 2)
}

#declare Archimedian = function {(Thickness - y*y*Freq -
pow(sin(sqrt(x*x+z*z)*Freq -
(0.5*Spirals*atan2(z,x)) ),2))}

isosurface {
function {Logarithmic (x, y, z)}

accuracy 0.01
threshold 0 // default value
open
texture {pigment {rgb <1, 0, 0>} finish {specular 0.4}}
}

So you'll need to adapt the parametric equations to a sphere sweep or a
parametric, or just a loop of spheres.

#declare SpiralX = function (Theta) {exp(0.15*Theta)*0.1*cos(Theta)};
#declare SpiralY = function (Theta) {exp(0.15*Theta)*0.1*sin(Theta)};

#for (T, 0, 10*tau, 0.01)
#local X = SpiralX (T);
#local Z = SpiralY (T);
sphere {<X, 0, Z> 0.1 pigment {rgb <1, 0, 0>}}
#end

[* Caution, this conclusion is based on a processor functioning on less than 1
cup of coffee]
```