Methods in Gemetry2D don't explain how to use is_polygon_clockwise to tell boundaries from holes #9919
Labels
area:class reference
Issues and PRs about the class reference, which should be addressed on the Godot engine repository
enhancement
Your Godot version:
4.3
Issue description:
There are some methods in the Geometry2D doc page (see URLs below) that return an
Array[PackedVector2Array]
with this indication:but without telling how to use the result from
is_polygon_clockwise
to distinguish boundaries from holes.It would be less confusing to explicitly state which convention is used by Geometry2D: are clockwise polygons used to represent holes or boundaries?
Looking through the geometry2d.cpp source, it looks like the implementation relies on the Clipper2 Lib that states:
Hoping I got everything right, the indication of the methods listed below could be changed to this:
The proposed description already flips the results of
is_polygon_clockwise
to adapt the Clipper2 Cartesian coordinates in the expected "y+ is down" screen coordinates.URL to the documentation page (if already existing):
https://docs.godotengine.org/en/stable/classes/class_geometry2d.html#class-geometry2d-method-clip-polygons
https://docs.godotengine.org/en/stable/classes/class_geometry2d.html#class-geometry2d-method-exclude-polygons
https://docs.godotengine.org/en/stable/classes/class_geometry2d.html#class-geometry2d-method-intersect-polygons
https://docs.godotengine.org/en/stable/classes/class_geometry2d.html#class-geometry2d-method-merge-polygons
https://docs.godotengine.org/en/stable/classes/class_geometry2d.html#class-geometry2d-method-offset-polygon
https://docs.godotengine.org/en/stable/classes/class_geometry2d.html#class-geometry2d-method-offset-polyline
The text was updated successfully, but these errors were encountered: