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§
Sourcefn orientation_2(&self, a: Point2, b: Point2, c: Point2) -> Orientation
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.
Sourcefn orient_3d(&self, a: Point3, b: Point3, c: Point3, d: Point3) -> Sign
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.
Sourcefn incircle(&self, a: Point2, b: Point2, c: Point2, d: Point2) -> Sign
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.
Sourcefn insphere(
&self,
a: Point3,
b: Point3,
c: Point3,
d: Point3,
e: Point3,
) -> Sign
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.