medialAxis
Computes the medial axis of this Shape.
The shape is linearized using ShapeContour.sampleLinear (which keeps corners) after which every linear segment is subdivided to a spacing of at most samplingDistance, then a ConstrainedVoronoiDiagram of the linearized shape is used to find the topology of the medial axis, see medialAxis.
Parameters
the spacing of the boundary samples, smaller values capture finer detail
the maximum distance between the refined medial axis points and the fitted branches
leaf branches attached to a junction whose significance is less than this are removed, see medialAxis
Computes the medial axis of shape from diagram, a ConstrainedVoronoiDiagram of a linear simplification of shape whose vertices lie on the boundary of shape (and no interior points).
ConstrainedVoronoiDiagram.internalEdges approximates the medial axis; it determines the topology of the result. Every vertex of the approximation is moved onto the medial axis of the original shape by finding the boundary pieces it is (nearly) equidistant to and solving for equal distance. Junctions are solved for equal distance to three boundary pieces. Leaves nearly equidistant to the two segments of a convex corner are extended to that corner. Finally every branch is fitted with cubic Béziers, keeping the shared node positions exact.
Parameters
the maximum distance between the refined medial axis points and the fitted branches, defaults to a tenth of the mean edge length of the simplification
leaf branches attached to a junction whose significance is less than this are removed, defaults to two times the mean edge length of the simplification. The significance of a branch is its length minus the decrease of the inscribed radius along it; it is close to zero for the spurious branches that run straight towards the boundary.