Clipping using meteor allows you to define mathmatical functions or even write c programs to specify what points should be removed. Given two points that share a triangle, if one point is determined to be removed and the other is not, then a new point is added as close as possible to the clipping edge, and the surrounding triangles are updated.
Given a sphere, using the clipping equation to remove all negative y values.
$ meteor -e "x*x + y*y + z*z = .8" --clip y
To clip positive values, -y should be specified instead of y. To clip a cylinder from the sphere:
$ meteor -e "x*x + y*y + z*z = .8" --clip "x*x + y*y = .1" -kc
The -kc option enables display of front and back of triangles
The clipping equation can also be specified for an input source, Using the following source saved in cliptest.c:
static double sub(double x) { return (x-.5) * (x-.25) * x * (x+.25) * (x+.5); } double clip(double x, double y, double z) { return sub(x) * sub(y) * sub(z); }
The result of:
$ meteor -e "x*x + y*y + z*z = .8" cliptest.c -kc