|
|
On 1/26/2021 7:42 PM, Robert McGregor wrote:
> 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:
>
> #macro Spherical_Spiral(turns, outer_rad, tube_rad, incr)
> #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);
> <xt, yt, zt> tube_rad
> #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
>
>
Good idea thank you!
Another option is to create a mesh parametrically.
Mike
Post a reply to this message
|
|