Geometry Library
Closed this issue · 0 comments
srush commented
I looked at a couple of Geometry libraries today to see if we could pull that part out of chalk. My conclusion is that the best one to use would be Planar
. https://pythonhosted.org/planar/
It's a weird choice, because it is unsupported, and hasn't been updated since 2011. However, I found it because it is where our Affine
class comes from which I really like.
Benefits of Planar:
- Simple API that looks like what you built.
- Optionally has a C implementation
- Very similar vector, segments, polygons, bounding boxes to what we have.
- Additional functionality for convex hulls etc.
- Has a fast Vec2Array class that we could use for long path/trails.
- Includes Affine.
Downsides:
- No support for circles, arcs
- On pip and works, but not currently supported (but how much has 2d geometry changed in 10 years)