Skip to main content

Module middle

Module middle 

Source
Expand description

The middle path of a pipe-like solid: the curve its cross-sections’ centroids trace from one end face to the other.

The solid is meshed once, and the march cuts that mesh with planes. Each station is found by predictor and corrector: a plane square to the current tangent one step ahead gives a first centroid, the chord to it turns the tangent (on a circular spine the chord’s direction is the mean of its end tangents), and the plane square to the turned tangent through the centroid gives the next, until the station stops moving. A plane square to a tube’s own spine cuts it in a section centred on the spine, so the stations sit on the spine to within the mesh’s chord.

The spine is fitted through the stations and then measured: planes square to the fitted curve between the stations are cut again, and the largest distance from a cut’s centroid to the curve is the deviation reported. A deviation over the tolerance halves the step and marches again.

Structs§

MiddlePath
A middle path and how closely it follows the solid’s sections.

Functions§

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