POV-Ray : Newsgroups : povray.general : Spiral Ribbon.. : Re: Spiral Ribbon.. Server Time
4 Aug 2024 02:20:03 EDT (-0400)
  Re: Spiral Ribbon..  
From: Mike Williams
Date: 15 Aug 2003 18:07:26
Message: <fT57KAAkjVP$EwPy@econym.demon.co.uk>
Wasn't it BorisW37 who wrote:
>Is there an inc file out there, or a feature already included in Pov-Ray
>that would let me easily make a Ribbon of a certain thickness and width
>turned into a spiral with a certain radius and a set pitch. If you are
>confused think of the DNA double helix, and the twisting ribbon. There are
>2 of them in DNA, but i just need 1

You could use a f_helix1 isosurface, like this:

isosurface {
  function { f_helix1(x,y,z,1,5,0.01,0.3,30,0,0) }
        max_gradient 1.5
        accuracy 0.00001
        contained_by {box {-<0.31,1,0.31>,<0.31,1,0.31>}}
        pigment {rgb x}
}

The parameters I've used in f_helix1() after the x,y,z are

1       Number of helixes (e.g. 2 for DNA double helix)
5       Period (number of turns per unit length/2Pi)
0.01    Half-thickness of ribbon
0.3     Radius of the helix
30      Ratio of ribbon width to thickness
0       Cross section shape (0=square, 1=circle, 2=diamond)
0       Cross section rotation

The x and z parameters in the size of the box container need to be at
least (Radius of helix) + (Half-thickness of ribbon) to avoid clipping.

If you want a thicker ribbon, with the same width you should decrease
the (Ratio of ribbon width to thickness), and increase the size of the
container box.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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