pub fn rectangle_contour(
rectangle: &RectangleProfile,
) -> Result<ContourProfile, GeomError>Expand description
Lower a rectangle – rounded, hollow, or both – into an exact contour.
Corner radii become exact quarter arcs through the same router the structural sections use, so a rounded corner extrudes to a cylinder wall rather than a fan of chords. A hollow rectangle’s inner boundary comes back as a hole, built counter-clockwise like the outer ring; the extruder re-orients holes itself.
Refuses, rather than clamps, a radius that is negative, non-finite, or wider than the half-extent it rounds, and an inner radius on a filled rectangle.
Also refuses a hollow section whose corners leave no wall. Two rounded
rectangles nest exactly when their support functions do; along the corner
diagonal that requires outer - inner < (2 + sqrt 2) * thickness. Past
that the inner corner reaches the outer arc and the profile crosses itself.