SmartCorner
Each SmartPoint has a SmartCorner. The default implementation is RegularCorner, which does nothing. RoundedCorner, as the name suggests adds a circular arc instead of a sharp corner.
Other possible corner types (not yet implemented) :
ChamferedCornerCoveCorner(like RoundedCorner, but inverted)SteppedRoundedCorner(like RoundedCorner, but with a small square step). In woodworking, edges are often rounded with an additional step.
A corner cannot evaluate its geometry on its own - they depend on the position and corner of the previous and next SmartPoints.
Calls prepare. This calculates the distance in the direction of the prev/next SmartPoint that the corner wants to use.
Determines if the distance is too great, and if so, calls limitDistanceBefore/limitDistanceAfter.
Calls calculate. The geometry is now fixed.
Calls buildCorner to add the corner's geometry to the quantised outline of the shape. For a RegularCorner, a single point (SmartPoint.position). For RoundedCorner, the points on the circular arc. The number of points is determined by a heuristic based on the radius of the corner, and the angle swept.
Corners can be used in conjunction with bezier curves. In this case, the "direction" to the next/previous SmartPoint is based on this SmartPoint's bezier handles, and NOT the direction of the next/previous SmartPoint.position.
Properties
The distance towards the next SmartPoint required by the corner.
The distance towards the previous SmartPoint required by the corner.
The end of the corner relative to SmartPoint.position Only valid after calculate has been called.
The start of the corner relative to SmartPoint.position. Only valid after calculate has been called.