|
|
Oops, there was some vestigial code in that last macro. Here's a better
version:
#macro hf_slicer(hfs, hfs_control_pigment, hfs_n_slices)
#local hfs_incre=1/hfs_n_slices;
#local hfs_function=function{pigment{hfs_control_pigment}}
#local hfs_p1=0;
#local hfs_V=0;
union{
#while(hfs_V<=1)
#local hfs_pv=hfs_function(0,hfs_V,0).x;
#local hfs_p2=hfs_p1;
#local hfs_p1=hfs_pv;
object{hfs
#if(hfs_p1>hfs_p2)
clipped_by{plane{y,hfs_p1}} clipped_by{plane{y,hfs_p2 inverse}}
#else
clipped_by{plane{y,hfs_p1 inverse}} clipped_by{plane{y,hfs_p2}}
#end
translate -y*hfs_p2
scale<1,hfs_incre/(hfs_p1-hfs_p2),1>
translate y*hfs_V
}
#local hfs_V=hfs_V+hfs_incre;
#end
translate -y*hfs_incre
}
#end
Post a reply to this message
|
|