Commit Graph

3 Commits

Author SHA1 Message Date
Peter Keresztes Schmidt 29488900a1 Box: Make range calculations mathematically correct 2021-05-16 19:41:45 +02:00
Peter Keresztes Schmidt 3c85d63655 Polygon: Implement clipping to a boundary box
Using the Sutherland-Hodgman algorithms convex and concave subject polygons can be clipped
by convex clip polygons.
For now we only need clipping to rectangles (Box), so limit our implementation to that. If needed this can be
trivially extended to convex clip polygons (a check whether the clip polygon is actually convex has to be added).
If convex clip polygons are needed we have to switch to e.g the Vatti algorithm.
2021-05-16 19:41:45 +02:00
Peter Keresztes Schmidt c2a7f7b593 tests/Box: Add unit tests 2021-05-16 16:42:58 +02:00