Improve CSGPolygon3D documentation

- Describe why polygon triangulation usually fails in the error message.
This commit is contained in:
Hugo Locurcio
2022-01-21 19:57:52 +01:00
parent 3a41bf0e04
commit 69617a893e
3 changed files with 5 additions and 4 deletions

View File

@ -1694,7 +1694,7 @@ CSGBrush *CSGPolygon3D::_build_brush() {
}
int shape_sides = shape_polygon.size();
Vector<int> shape_faces = Geometry2D::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());