POV-Ray : Newsgroups : povray.advanced-users : Logarithmic spiral tube : Re: Logarithmic spiral tube Server Time
3 Dec 2021 02:53:58 EST (-0500)
  Re: Logarithmic spiral tube  
From: Bald Eagle
Date: 27 Jan 2021 07:00:00
Message: <web.6011555575e9c60d1f9dae300@news.povray.org>
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:

http://news.povray.org/povray.newusers/thread/%3Cweb.59c7e943ff4768ea832bdcda0%40news.povray.org%3E/?mtop=418031&moff=1
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 RADIUS = 5;
#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
 max_gradient 102
 contained_by {sphere {<0,0,0>, RADIUS}}
 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]


Post a reply to this message

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