Skip to main content

inside_boundary_with

Function inside_boundary_with 

Source
pub fn inside_boundary_with<P: Predicates>(
    rings: &[Vec<Point2>],
    p: Point2,
) -> bool
Expand description

As inside_boundary, with the predicate implementation named.

This is the seam docs/DATA_MODEL.md ยง9 describes, and it is here rather than anywhere else because this is where the combinatorial decision is. Whether a point is inside a ring is not a measurement that can be a little wrong: it decides whether a triangle is kept or dropped, so an error near a boundary is a hole in the mesh rather than a slightly misplaced one.

The naive form divides to find where an edge crosses the sampling ray, and that division cancels catastrophically for a point nearly on the edge. orient2d answers the same question with no division at all, and Exact answers it correctly however close the point is.