|
|
Wasn't it Jari Juslin who wrote:
>I am in need of source code or explanation of how to make plane "cut" or
>"split" iso surfaces. I know I have seen a picture of metallic rounded
>box being cut to pieces in a smooth way; like you had cut some irl clay
>object with scissors.
>
>So, if anybody can tell me how to do that, I'd appreciate it :-).
>
Do you mean something like this?
What I've done is blobbed together a sphere and two double planes
inversed (one flipped y for x, giving a vertical cut).
The clever bit is that I've multiplied the double plane functions by
some value, "Edge_Sharpness", so that points close to the cut are more
strongly affected by the double plane functions than by the sphere
function. Without this trick, the edges of the cut are very round
indeed.
The inversing of the double planes is done by adding Blobbyness^(Plane(x
,y,z)*Edge_Sharpness) instead of subtracting it as you would normally do
when blobbing isosurfaces together.
#declare Cut_Width = 0.1;
#declare Blobbyness = 0.001;
#declare Edge_Sharpness = 6;
#declare Sphere = function {f_sphere(x,y,z,1)} // Sphere
#declare Plane = function {(abs(x)-Cut_Width)} // Double plane
isosurface {
function { (1+Blobbyness) - Blobbyness^Sphere(x,y,z)
+ Blobbyness^(Plane(x,y,z)*Edge_Sharpness)
+ Blobbyness^(Plane(y,x,z)*Edge_Sharpness)
}
max_gradient 3000
contained_by{sphere{0,1.01}}
pigment {rgb 1}
}
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|