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.

A sharp (mitred) corner stops the march: past the point where a section square to the leg reaches the mitre, it takes in the next leg too and its centroid jumps aside. The march then runs back from the end face as well, each leg is kept up to the last station whose section cannot reach the mitre, and the two legs, carried on straight along their last tangents, must meet: there is the corner. The corner is measured too, by the section on the plane halving it, whose centroid a mitred tube has on the corner.

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.