Module kurbo::offset

source ·
Expand description

Computation of offset curves of cubic Béziers, based on a curve fitting approach.

See the Parallel curves of cubic Béziers blog post for a discussion of how this algorithm works and what kind of results can be expected. In general, it is expected to perform much better than most published algorithms. The number of curve segments needed to attain a given accuracy scales as O(n^6) with accuracy.

In general, to compute the offset curve (also known as parallel curve) of a cubic Bézier segment, create a CubicOffset struct with the curve segment and offset, then use fit_to_bezpath or fit_to_bezpath_opt depending on how much time to spend optimizing the resulting path.

Structs