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

could you please support ellipse? #36

Open
wikywin opened this issue Jan 8, 2020 · 5 comments
Open

could you please support ellipse? #36

wikywin opened this issue Jan 8, 2020 · 5 comments

Comments

@wikywin
Copy link

wikywin commented Jan 8, 2020

hi alexbol99!
I use flatten-js in my project to draw window and door. it works very well right now.
but I need to draw ellipse window. could you please support ellipse

@dmitru
Copy link

dmitru commented Mar 19, 2020

I second that; having ellipse (and perhaps a rectangle) would be very useful!

@mathedu4all
Copy link

I think we can get ellipse by transform a circle by affine matrix.

@alexbol99
Copy link
Owner

@mathedu4all , transform circle gives ellipse in mathematics, but unfortunately not in this library.
In order to support ellipse I need an object that represent ellipse with two radii rx, ry. Then I need to implement at least the common methods like distance, intersection, relation and transformation. Not so trivial task.

@edemaine
Copy link

edemaine commented Jan 25, 2024

I'm not sure, but if implementing ellipses, it might make sense to try to support arbitrary conics. At least, I think a lot of the math is similar between them, and other conics can be useful to work with. (For example, parabolas come up naturally in some computational geometry like the medial axis.) Even within ellipses, it could be nice to support arbitrary rotation (two foci not necessarily horizontally or vertically aligned). I agree that this is a nontrivial task, but maybe we can aim for it someday. 😅

Then again, axis-aligned ellipses are directly supported by SVG, so maybe that should be the first goal.

@alexbol99
Copy link
Owner

I agree, it would be great to support all conic curves, maybe not in the scope of this library.
Even drawing of these curves is not supported neither by SVG nor by Canvas API.

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

5 participants