Skip to main content

shell_contains_from

Function shell_contains_from 

Source
pub fn shell_contains_from(
    model: &Model,
    shell_id: ShellId,
    point: Vector3,
    from: Vector3,
    from_inside: bool,
    max_nodes: usize,
    epsilon: Scalar,
    seed: u64,
) -> GeopResult<PointClassification>
Expand description

Like shell_contains, from from: a point already classified against shell_id, strictly inside it (from_inside) or strictly outside.

The first path tried ends there, and point is then on the same side as from exactly when that path crosses the boundary an even number of times — the same parity argument as a ray cast past the whole shell, with the answer at the far end known instead of “outside”. A point near from — another point of the same face, say — makes that path short, and a short path rules out nearly every face of the shell before any search runs (see curve_could_meet_aabb), where a ray cast past the shell is tested against all of them. A degenerate one (grazing a vertex or an edge, hitting a face at its trim or at an end of the path) falls back to the rays of shell_contains.