mirror of
https://github.com/bevyengine/bevy
synced 2025-03-08 01:07:16 +00:00
# Objective - This PR adds the ability to determine whether a `Polygon<N>` or `BoxedPolygon` is simple (aka. not self-intersecting) by calling `my_polygon.is_simple()`. - This may be useful information for users to determine whether their polygons are 'valid' and will be useful when adding meshing for polygons. - As such this is a step towards fixing #15255 ## Solution - Implemented the Shamos-Hoey algorithm in its own module `polygon`. ## Testing - Tests are included, and can be verified visually. --- ## Performance - The Shamos-Hoey algorithm runs in O(n * log n) - In reality, the results look more linear to me. - Determining simplicity for a simple polygon (the worst case) with less than 100 vertices takes less than 0.2ms.  |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
clippy.toml | ||
README.md |