1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-04 17:04:49 +00:00

Improve CSGPolygon3D documentation

- Describe why polygon triangulation usually fails in the error message.

(cherry picked from commit 1e1fb145b3)
This commit is contained in:
Hugo Locurcio
2022-01-21 19:57:52 +01:00
committed by Rémi Verschelde
parent 579c6238bb
commit c6ed1ef342
3 changed files with 5 additions and 4 deletions

View File

@@ -1757,7 +1757,7 @@ CSGBrush *CSGPolygon::_build_brush() {
}
int shape_sides = shape_polygon.size();
Vector<int> shape_faces = Geometry::triangulate_polygon(shape_polygon);
ERR_FAIL_COND_V_MSG(shape_faces.size() < 3, brush, "Failed to triangulate CSGPolygon");
ERR_FAIL_COND_V_MSG(shape_faces.size() < 3, brush, "Failed to triangulate CSGPolygon. Make sure the polygon doesn't have any intersecting edges.");
// Get polygon enclosing Rect2.
Rect2 shape_rect(shape_polygon[0], Vector2());