Game icon indicating copy to clipboard operation
Game copied to clipboard

2D Geometry Library

Open Indy2222 opened this issue 3 years ago • 1 comments

Geometric Objects:

  • [ ] Aabb
  • [ ] LineSegment
    • [ ] normal(&self) -> Vec2
  • [ ] Triangle
  • [ ] ConvexPolygon
    • [ ] to_polygon(self) -> Polygon
  • [ ] Polygon
    • [ ] convex_hull(&self) -> ConvexPolygon

Traits:

  • [ ] Union<T>
    • [ ] <Polygon> for Polygon
  • [ ] Intersects<T>
    • [ ] <LineSegment> for LineSegment
    • [ ] <Vec2> for Triangle
    • [ ] <Vec2> for Polygon
    • [ ] <Vec2> for ConvexPolygon
    • [ ] <Polygon> for Polygon
    • [ ] <ConvexPolygon> for ConvexPolygon
  • [ ] PointQuery -- local & projected closest point
    • [ ] for LineSegment
  • [ ] Offset
    • [ ] Polygon

Indy2222 avatar Jun 09 '22 09:06 Indy2222

This is a last resort solution. I would much prefer using an existing library as long as it supports needed geometric operations or accepts new PRs.

Indy2222 avatar Jun 20 '22 20:06 Indy2222