Skip to main content

fixed_reference_plan

Function fixed_reference_plan 

Source
pub fn fixed_reference_plan(
    pieces: &[PathPiece],
    closed: bool,
    reference: Vec3,
    reach: Scalar,
    chord: Scalar,
    tolerance: Tolerance,
) -> GeomResult<FixedReferencePlan>
Expand description

Check a chain of pieces for a fixed-reference sweep of a profile of reach at wall budget chord and decide whether the bound is proven.

closed is whether the path declares itself a loop (a closed polyline): its closing joint is then checked like any other. An undeclared chain is a loop all the same when its last piece ends within the smaller of the linear tolerance and a quarter of chord of where its first starts, and the joint there is tangent continuous (a full circle, a composite closing on itself); where it is not, the ends just meet and the chain is open, nothing refused.

Refused by name, in this order: no pieces or a reference, chord or reach that is zero or not finite; a malformed piece; a joint with a gap above a quarter of chord or a corner; a piece whose tangent comes within the angular tolerance of the reference’s direction. Then an arc whose exact frame twists off the rotation-minimising one by more than an eighth of chord at reach makes the plan FixedReferencePlan::Twisting; a smaller twist comes out of the walls’ half of the budget. Last, a joint whose kink turns the re-seeded profile (by about the kink times the cotangent of the reference’s angle to the tangent) further than a quarter of chord at reach is refused.