|
|
So, I've been trying half a dozen ways to make a shape, and I managed to work
out the equations to do it with an isosurface.
(because OMG are parametrics SLOOOOOOW)
Only the frequency of the sine wave for the serrated, lemon-juicer top doesn't
look right, and it's hard to really see what's going wrong with all of the
unexpected noise.
#declare ISphereR = 24;
#declare I_Phi = function {tan(z/x)}
#declare F_Sphere = function {pow(x,2)+pow(y,2)+pow(z,2) - pow(ISphereR,2)}
// a sine wave 80% of full size, with 3 peaks
#declare F_Wave = function {ISphereR*0.8 * sin(3*I_Phi(x, y, z))}
// only generate a spherical isosurface for the parts where the height
// is less than the sine wave function
#declare I = function {select(F_Wave(x,y,z)-y, 0, 0, 1)}
//----------------For debugging---------------------------
//#declare S_Wave = function {I(x,y,z)*F_Sphere(x,y,z)}
//--------------------------------------------------------
#declare S_Wave = function {select(y, F_Sphere (x, y, z),
I(x,y,z)*F_Sphere(x,y,z))}
#declare Gradient = 5500;
#declare Min_factor= 0.7;
#declare I_Surface = isosurface {
//function {Pattern(x, y, z).red - 0.5}
function {S_Wave (x, y, z)}
open
threshold 0
max_gradient 5500
//evaluate Gradient*Min_factor, sqrt(Gradient/(Gradient*Min_factor)), min
(0.7, 1.0)
accuracy 0.1
contained_by {box {<-1, -1, -1>*ISphereR*1.1, <1, 1, 1>*ISphereR*1.1}}
}
Post a reply to this message
Attachments:
Download 'isosurface.png' (88 KB)
Preview of image 'isosurface.png'
|
|