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. 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, or the deviation stays over the tolerance after every refinement.