|
|
I am trying to create a strand of thatch with an isosurface-based cylinder
which wraps around a turbulated line (the center is determined using polar
coordinates and two patterns). This is what I have so far:
#declare fntR1 = function { pattern { crackle solid } }
#declare fntRad = function { .2+.8*fntR1(x,y,z) }
#declare fntP1 = function { pattern { bozo turbulence .2 } }
#declare fntPhi = function { 2*pi*fntP1(x,y,z) }
#declare fntStrand = function(x,y,z) {
(fntRad(x,y,z)*(cos(fntPhi(x,y,z))+y))^2+(fntRad(x,y,z)*(sin(fntPhi(x,y,z))+
z))^2 }
#macro tStrand(rad,len) isosurface {
#local wid = len*.5;
#local crad = rad*3;
function { fntStrand(x,y*rad,z*rad) }
threshold 1
max_gradient 6
contained_by { box { <-wid, -crad, -crad>, <wid, crad, crad> } }
accuracy 0.001
} #end
I'm starting to wonder what kind of variable substitution I should use (say,
use pattern function substitution in the fntStrand definition).
Can someone please fix this?
Post a reply to this message
|
|