aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/graph/geom
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-02-12 06:17:07 +0100
committerSven Göthel <[email protected]>2024-02-12 06:17:07 +0100
commita77b487a44124a9e55fa9a53d1f9c3ae20b9c3ba (patch)
treebb9271e933b09bfaa92253bc76e8295f56174041 /src/jogl/classes/com/jogamp/graph/geom
parentbf882af1675f390500cc36c5396f75c394372d52 (diff)
Bug 1501: Graph Delaunay: Use default winding outer-boundary:=CCW and inner-hole:=CW w/o using winding determination (might be incorrect)
This simplifies our code further and it has been validated that our polygon shoelace-algo for area >= 0 ? CCW doesn't produce correct results with all curves. Hence rely on given winding depending on outer-boundary and inner-hole if CDTriangulator2D.FixedWindingRule == true (default and fixed). This also removes the more costly winding shoelace calculus, hence Outline ctor only sets dirtyWinding:=true w/o calculating the winding.
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/geom')
-rw-r--r--src/jogl/classes/com/jogamp/graph/geom/Outline.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/geom/Outline.java b/src/jogl/classes/com/jogamp/graph/geom/Outline.java
index 522919cc6..a9ebd0346 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/Outline.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/Outline.java
@@ -78,8 +78,8 @@ public class Outline implements Comparable<Outline> {
public Outline(final Outline src) {
final int count = src.vertices.size();
vertices = new ArrayList<Vertex>(count);
- winding = src.getWinding();
- dirtyWinding = false;
+ winding = Winding.CCW;
+ dirtyWinding = true;
for(int i=0; i<count; i++) {
vertices.add( src.vertices.get(i).copy() );
}
@@ -138,7 +138,7 @@ public class Outline implements Comparable<Outline> {
}
/**
- * Compute the winding of the {@link #getLastOutline()} using the {@link #area(ArrayList)} function over all of its vertices.
+ * Compute the winding of the {@link #getLastOutline()} using the {@link VectorUtil#area2d(ArrayList)} function over all of its vertices.
* @return {@link Winding#CCW} or {@link Winding#CW}
*/
public final Winding getWinding() {
@@ -149,7 +149,7 @@ public class Outline implements Comparable<Outline> {
if( 3 > count ) {
winding = Winding.CCW;
} else {
- winding = VectorUtil.getWinding( getVertices() );
+ winding = VectorUtil.getWinding2d( getVertices() );
}
dirtyWinding = false;
return winding;