Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support cubic bezier curves #116

Open
cuixiping opened this issue Mar 22, 2022 · 3 comments
Open

Support cubic bezier curves #116

cuixiping opened this issue Mar 22, 2022 · 3 comments

Comments

@cuixiping
Copy link

flatten-js is a great library for web vector graphics apps.
Cubic bezier curves are widely used in web apps.
Is there a plan to support cubic bezier curves?

@alexbol99
Copy link
Owner

Currently I don't have a plans to support bezier curves in this library

@sysmaya
Copy link

sysmaya commented Mar 1, 2023

That's what I came to ask. Support for bezier curves.
Summing up: If I handle paths like this circle "M 193.1 253.5 C 193.1 218.3 223.8 190 261.8 190 C 299.7 190 330.5 218.3 330.5 253.5 C 330.5 288.5 299.7 316.8 261.8 317 C 223.8 316.8 193.1 288.5 193.1 253.5"
this library doesn't work for me.

It's a real pity. This is the best library to handle geometry. The best and most complete (almost...) :(

@romgrk
Copy link

romgrk commented Mar 31, 2024

In case someone needs cubic Bezier curves, I have forked the library and added support for them in https://github.com/romgrk/2d-geometry. They're not optimized much, for example the bounding box is computed by iteration rather than through the analytical solution, but they work well enough. It also has a new Path primitive that works like an SVG Path but allows operating on it, e.g. length, splitting, etc.

I have opted to fork rather than open PRs because I saw quite a few things I wanted changed for a graph library I'm working on, and going through many cycles of PR reviews wouldn't have worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants