|
|
Libellule wrote:
>
> I was wondering if it was possible to add a Heaviside step function for
> use in isosurfaces:
>
You can do it with the gradient pattern used as a pigment. In the
following example, the Heaviside function domain is restricted to the x
interval (-1, 1)
#version unofficial MegaPov 0.5;
#default{pigment{rgb 1}}
camera{location <3, 5, -5> look_at 0 angle 60}
light_source{<2,5,-5> rgb 1}
#macro Heaviside(jump)
#local lx = (jump + 1)/2;
#declare myheavi =
function{
pigment{gradient x translate -x/2 scale 2
color_map{[lx rgb 0][lx rgb 1]}
}
}
#end
Heaviside(.5)
isosurface{function{y - myheavi(x, y, z)/10}
contained_by{box -<1, 1, 1> <1, 1, 1>}
accuracy .01
max_gradient 21
}
Hope this will help you.
Regards, Alberto
Post a reply to this message
|
|