|
|
Looking at various pictures of trefoils, such as Tor Olav's, made me want to
create my own. But I have no idea how to. I tried looking for a formula or
something that would at least point me in the right direction, but so far I
haven't found anything. Any help is appreciated.
Post a reply to this message
|
|
|
|
Wasn't it Sleazy Saint who wrote:
>Looking at various pictures of trefoils, such as Tor Olav's, made me want to
>create my own. But I have no idea how to. I tried looking for a formula or
>something that would at least point me in the right direction, but so far I
>haven't found anything. Any help is appreciated.
There's several ways to do it.
Here's a method using a short piece of a helix, transformed by using
cylindrical polar co-ordinates
(see <http://www.econym.demon.co.uk/isotut/substitute.htm#polar>)
#declare R1=0.3; // helix minor radius
#declare R2=0.5; // helix major radius
#declare R3=2.0; // shape major radius
#declare Strands=2; // DNA = double strand
#declare Turns=1.5; // number of helix turns in the loop
#declare Shape=1.5; // helix1 shape parameter
// Set Strands=2 Turns=1.5 for a trefoil.
// Other low values give other knotted and interlocked shapes
// Turns*Strands should be an integer to avoid a discontinuity
// Shape, max_gradient and contained_by may need to be adjusted
// when you change any of the other parameters
// the helix function
#declare F=function { f_helix1 (x, z, y, Strands, Turns, R1, R2, Shape,
1, 0) }
isosurface {
function{F(f_r(x,y,z)-R3, y, f_th(x,y,z))} // cylindrical polar
max_gradient 2.5
contained_by {box {<-3,-1,-3><3,1,3>}}
pigment {rgb 1}
}
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|