mirror of
https://github.com/bevyengine/bevy
synced 2024-12-19 01:23:09 +00:00
fcaa271693
# 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. ![image](https://github.com/user-attachments/assets/23c62234-abdc-4710-a3b4-feaad5929133) |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
clippy.toml | ||
README.md |