aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/graph
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-05-05 03:17:35 +0200
committerSven Gothel <[email protected]>2023-05-05 03:17:35 +0200
commit45a3a220c43cdc40112b0bb9677197139b758347 (patch)
treee8be72806d863acbf4d1b22550c7ae68088aaf80 /src/jogl/classes/jogamp/graph
parent67973c43fb1f6873b19b327b3c665452e5131960 (diff)
Graph CDTriangulator2D: Drop invalid innerPoly, avoiding Loop.initFromPolyline(..) outline.getGraphPoint().size() < 3 IllegalArgumentException
This issue has to be added to our CD .. /* * Font FreeMono-Bold: ID 0 + 465: Glyph[id 465 'uni020F', advance 600, leftSideBearings 42, kerning[size 0, horiz true, cross true], shape true], OutlineShape@5e8a459[outlines 2, vertices 34] Drop innerPoly ctrlpts < 3 - innerPo[vertices 2, ctrlpts 2] < 3 - outline[vertices 4, ctrlpts 4] - Input[vertices 4] * * Font FreeSans-Regular: ID 0 + 409: Glyph[id 409 'Udieresiscaron', advance 720, leftSideBearings 80, kerning[size 0, horiz true, cross false], shape true], OutlineShape@5eb97ced[outlines 3, vertices 33] Drop innerPoly ctrlpts < 3 - innerPo[vertices 1, ctrlpts 1] < 3 - outline[vertices 1, ctrlpts 1] - Input[vertices 1] * Stack: at jogamp.graph.curve.tess.CDTriangulator2D.addCurve(CDTriangulator2D.java:97) at com.jogamp.graph.curve.OutlineShape.triangulateImpl(OutlineShape.java:988) at com.jogamp.graph.curve.OutlineShape.getTriangles(OutlineShape.java:1012) at com.jogamp.graph.curve.Region.countOutlineShape(Region.java:503) at com.jogamp.graph.ui.shapes.GlyphShape.<init>(GlyphShape.java:77) */
Diffstat (limited to 'src/jogl/classes/jogamp/graph')
-rw-r--r--src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java b/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java
index 9772b860f..85a18c982 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java
@@ -89,8 +89,36 @@ public class CDTriangulator2D implements Triangulator {
final GraphOutline outline = new GraphOutline(polyline); // , winding);
final GraphOutline innerPoly = extractBoundaryTriangles(sink, outline, false, sharpness);
// vertices.addAll(polyline.getVertices());
- loop = new Loop(innerPoly, winding);
- loops.add(loop);
+ if( innerPoly.getGraphPoint().size() >= 3 ) {
+ loop = new Loop(innerPoly, winding);
+ loops.add(loop);
+ } else if( DEBUG ) {
+ /*
+ * Font FreeMono-Bold: ID 0 + 465: Glyph[id 465 'uni020F', advance 600, leftSideBearings 42, kerning[size 0, horiz true, cross true], shape true], OutlineShape@5e8a459[outlines 2, vertices 34]
+ Drop innerPoly ctrlpts < 3
+ - innerPo[vertices 2, ctrlpts 2] < 3
+ - outline[vertices 4, ctrlpts 4]
+ - Input[vertices 4]
+ *
+ * Font FreeSans-Regular: ID 0 + 409: Glyph[id 409 'Udieresiscaron', advance 720, leftSideBearings 80, kerning[size 0, horiz true, cross false], shape true], OutlineShape@5eb97ced[outlines 3, vertices 33]
+ Drop innerPoly ctrlpts < 3
+ - innerPo[vertices 1, ctrlpts 1] < 3
+ - outline[vertices 1, ctrlpts 1]
+ - Input[vertices 1]
+
+ * Stack:
+ at jogamp.graph.curve.tess.CDTriangulator2D.addCurve(CDTriangulator2D.java:97)
+ at com.jogamp.graph.curve.OutlineShape.triangulateImpl(OutlineShape.java:988)
+ at com.jogamp.graph.curve.OutlineShape.getTriangles(OutlineShape.java:1012)
+ at com.jogamp.graph.curve.Region.countOutlineShape(Region.java:503)
+ at com.jogamp.graph.ui.shapes.GlyphShape.<init>(GlyphShape.java:77)
+ */
+ System.err.println("Drop innerPoly ctrlpts < 3");
+ System.err.println("- innerPo[vertices "+innerPoly.getOutline().getVertexCount()+", ctrlpts "+innerPoly.getGraphPoint().size()+"] < 3");
+ System.err.println("- outline[vertices "+outline.getOutline().getVertexCount()+", ctrlpts "+outline.getGraphPoint().size()+"]");
+ System.err.println("- Input[vertices "+polyline.getVertexCount()+"]");
+ Thread.dumpStack();
+ }
} else {
// final Winding winding = Winding.CW; // -> HEdge.HOLE
// Not required, handled in Loop.initFromPolyline(): polyline.setWinding(winding);