Skip to main content

body_plan_boundary_distance

Function body_plan_boundary_distance 

Source
pub fn body_plan_boundary_distance<'a, 'b>(
    a: impl Into<PlacedBody<'a>>,
    b: impl Into<PlacedBody<'b>>,
    accuracy: f64,
    tolerance: Tolerance,
) -> Result<BodyDistance, BodyMeasureError>
Expand description

Plan distance between two bodies of exact solids – between their shadows on the XY plane – to within accuracy (#237): the least over item pairs, by one shared search.

Zero where an item’s shadow overlaps or lies inside one of the other body’s, as crate::plan_boundary_distance for one pair; items of one body may overlap in plan, or in space. When two planar faces show an overlap of positive area, the interval is [0, 0] and the witnesses project into it. point_a and point_b lie on the items item_a and item_b name, their projections at most upper apart, within rounding. A negative or NaN accuracy is read as zero.

§Errors

BodyMeasureError::EmptyBody for an empty body, BodyMeasureError::Placement for a placement that is not rigid, and BodyMeasureError::Measure with what crate::plan_boundary_distance refuses.