Ideas for converting shapes to shapely (instead of drawing them) #334
villares
started this conversation in
Show and tell
Replies: 1 comment 3 replies
-
Does the Python library bezier help you at all? Although what you are doing is more educational because the math behind bezier curves is more apparent. I don't think trying to use py5 to do the bezier curve calculations to be extracted and put into shapely is the most efficient way to go. py5's bezier curve methods aren't really designed for that. What you are exploring here might be a useful py5 library extension idea for working with py5 + shapely. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
There is a built-in function for getting the points from
bezier_curve()
(the standalone version of the shape you can build withbezier_vertex()
). There is no such method for a quadratic bezier curves... but getting the points from a curve based on `quadratic_vertex()) was not very hard.I think I'll mostly use
shapely.Polygon
to get some of my shapes into shapely, but I wonder if I should add some circle() and ellipse() helpers (maybe using point buffers and affinity transforms for the ellipses).Rotations and transformations are in a different style, and another idea would be to tap into `matplotlib.patches' https://matplotlib.org/stable/api/patches_api.html ...
Beta Was this translation helpful? Give feedback.
All reactions