Skip to main content

GeometryKernel

Trait GeometryKernel 

Source
pub trait GeometryKernel {
    // Required methods
    fn orientation_2(&self, a: Point2, b: Point2, c: Point2) -> Orientation;
    fn orient_3d(&self, a: Point3, b: Point3, c: Point3, d: Point3) -> Sign;
    fn incircle(&self, a: Point2, b: Point2, c: Point2, d: Point2) -> Sign;
    fn insphere(
        &self,
        a: Point3,
        b: Point3,
        c: Point3,
        d: Point3,
        e: Point3,
    ) -> Sign;
}
Expand description

The geometric-predicate kernel abstraction.

P10.4: All four predicate methods are now required (no default implementations). A kernel that does not provide all four predicates cannot compile — this eliminates the class of runtime panics that the pre-P10.4 panicking defaults allowed.

Implementors provide the sign of geometric predicates (orientation, incircle, insphere) under a specific number model. The default FilteredF64Kernel is the fast filtered-f64 path; the super::exact_kernel::ExactConstructionKernel provides the robust fallback for degenerate cases.

Required Methods§

Source

fn orientation_2(&self, a: Point2, b: Point2, c: Point2) -> Orientation

2D orientation: the sign of the turn a → b → c.

CounterClockwise / Collinear / Clockwise. This is the predicate convex_hull_2 and delaunay_2 are built on.

Source

fn orient_3d(&self, a: Point3, b: Point3, c: Point3, d: Point3) -> Sign

3D orientation: the sign of det(b−a, c−a, d−a) (the signed volume of tetrahedron a b c d). Sign::Positive = d below the oriented plane a → b → c; Sign::Negative = above; Sign::Zero = coplanar.

Source

fn incircle(&self, a: Point2, b: Point2, c: Point2, d: Point2) -> Sign

2D in-circle: the side of d w.r.t. the oriented circle through a, b, c. Sign::Positive = inside (when a, b, c are CCW); Sign::Zero = on; Sign::Negative = outside.

Source

fn insphere( &self, a: Point3, b: Point3, c: Point3, d: Point3, e: Point3, ) -> Sign

3D in-sphere: the side of e w.r.t. the oriented sphere through a, b, c, d. Sign::Positive = inside (when a, b, c, d are positively oriented); Sign::Zero = on; Sign::Negative = outside.

Implementors§