Skip to main content

middle_path

Function middle_path 

Source
pub fn middle_path(
    model: &mut Model,
    solid: &Shape,
    start: &Shape,
    end: &Shape,
    tolerance: f64,
    tol: Tolerances,
) -> OgeomResult<MiddlePath>
Expand description

The centre line of a pipe-like solid, from its face start to its face end.

Each point of the path is the centroid of the solid’s section by a plane square to the path there. The path starts at the centroid of start and ends at the centroid of end, and it is a straight edge where every station lies on one line and a fitted spline otherwise. A tube with one sharp (mitred) corner has a path of two edges, one per leg, meeting where the legs carried on straight meet; the sections near the corner, which reach into the other leg, are not measured, and the section on the plane halving the corner is. tolerance bounds the reported deviation; the solid is meshed at a quarter of it.

§Errors

OgeomError::Construction if solid is not a solid, either face is not one of its faces, the two faces are the same, the tolerance is not a positive distance, or the mesh does not close. OgeomError::NotDone if a section square to the march finds no material (the solid is not pipe-like between the faces), the march never reaches end, it turns back on itself where its legs do not meet at one corner, or the deviation stays over the tolerance after every refinement.