Skip to content

Commit 08baeec

Browse files
committed
add a fast return to the already a triangle case
1 parent 32613f2 commit 08baeec

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/main/java/eu/mihosoft/vrl/v3d/ext/org/poly2tri/PolygonUtil.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,10 @@ public static ArrayList<Polygon> triangulatePolygon(Polygon incoming) throws Col
594594
return result;
595595
if (incoming.getVertices().size() < 3)
596596
return result;
597+
if (incoming.getVertices().size() == 3) {
598+
result.add(incoming);
599+
return result;
600+
}
597601
Polygon tmp = incoming;
598602
Vector3d normalOfPlane = incoming.getPlane().getNormal().clone();
599603
normalOfPlane.normalize();

0 commit comments

Comments
 (0)