|
|
I explain this method. The basic concept is just that specifying different
threshold values to a function will produce different but similar isosurfaces.
For instance, in the right picture, upper surface of the shell is
y-sin(2.5*x)= 0.08 , lower surface is
y-sin(2.5*x)=-0.08
Use csg difference in pov-ray between these two isosurface objects can produce a
shell.
//---------------------code----------------------------
#declare f_sin=function(var1,var2,k){
var2-sin(k*var1)
}
#declare CSG_OVERLAP=0.000001;
difference{
isosurface{
function{f_sin(x,z,2.5)-0.08}
max_gradient 2
contained_by{box{<-5,-1,-1.5><5,2,1.5>}}
all_intersections
}
isosurface{
function{f_sin(x,z,2.5)+0.08}
max_gradient 2
contained_by{box{<-5,-1-CSG_OVERLAP,-1.5-CSG_OVERLAP><5,2+CSG_OVERLAP,1.5>}}
all_intersections
}
}
//-----------------------end of code-----------------------
But the shell's thickness is not a canstant. I found a method modifying the
function to let it have uniform thickness at least in a small range.
Post a reply to this message
Attachments:
Download 'sin.jpg' (130 KB)
Preview of image 'sin.jpg'
|
|