Remix.run Logo
WillAdams a day ago

The thing is, the problematic curves often violate the rules put forward as best practices:

- place nodes at extrema (top/bottom, left/right)

- place nodes at points of inflection (middle of an _S_ curve)

- where possible/appropriate observe the "rule of 30" and place off-curve nodes not quote one-third of the way towards the other on-curve node

If one expected (or enforced) those rules, does the problem/math become easier?

unconed 14 hours ago | parent [-]

Most of those rules are copes, really.

Placing points at X/Y extremes is by itself useless because beziers are rotation invariant. i.e. If that's the best place for the control points, then by the same argument if you rotated the curve by 45° the points would need to be on diagonal extremes. It's only useful with typography where many letters are oval. IIRC this rule originated because buggy rendering code assumed the curve would never extend beyond the XY bounding box of the control points.

Placing nodes at inflection points is actually a bad idea because there are very few configurations where curvature remains continuous. It's better to construct S bends with the inflection point in the middle, because then you always get a smooth transition.

Picking a specific spacing between control points makes it more likely that equal tangents represent approximately the same curvature on both sides, but it's not guaranteed either.

WillAdams 4 hours ago | parent [-]

A notable context where the the on-curve node placement rules do matter is font design where the node placements interact with hints and are useful for ensuring consistency and consistent rounding when filling in pixels.

Further, these rules facilitate using the shift key to constrain off-curve node placement to in-line w/ the matching on-curve node horizontally or vertically.