ImplicitFunction

Trait ImplicitFunction 

Source
pub trait ImplicitFunction<S: Debug + RealField> {
    // Required methods
    fn bbox(&self) -> &BoundingBox<S>;
    fn value(&self, p: &Point3<S>) -> S;
    fn normal(&self, p: &Point3<S>) -> Vector3<S>;
}
Expand description

Trait to be implemented by functions that should be tessellated.

Required Methods§

Source

fn bbox(&self) -> &BoundingBox<S>

Return a Bounding Box, which is essential, so the algorithm knows where to search for surfaces.

Source

fn value(&self, p: &Point3<S>) -> S

Evaluate the function on p and return the value. A value of zero signifies that p is on the surface to be tessellated. A negative value means p in inside the object. A positive value means p is outside the object. The magnitude of value must be continuous. Furthermore value has to be equal or greater than the euclidean distance between p and the surface.

Source

fn normal(&self, p: &Point3<S>) -> Vector3<S>

Compute the normal of the function at p.

Implementors§