/kurbo-smooth

Squircles for kurbo

Primary LanguageRust

kurbo-smooth

NORSE
License - MIT License - Apache2

A squircle generator for kurbo.

Squircles are common tools for achieving smooth curvatures and tend to replace rounded rectangles. This implementation is based on the excellent article Desperately seeking squircles by Daniel Furse from figma which describes their approach for generating squircles.

At the end it results in an arc and two cubic bezier curves for ramp up. We further approximate the arc by two cubic curves to have a nice composite curve which can be used as building block for more complex paths.

Example curves with 0.2, 0.6 and 0.9 smoothness.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any Contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.