From be12cf26e04d0e7582de7b0f5651c14d881bacfc Mon Sep 17 00:00:00 2001 From: BananaPuncher714 Date: Sat, 17 May 2025 18:19:13 -0400 Subject: [PATCH] Use the region lower and upper edge instead of an arbitrary edge when constructing a link --- .../com/aaaaahhhhhhh/bananapuncher714/mesh/Mesh.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/aaaaahhhhhhh/bananapuncher714/mesh/Mesh.java b/src/main/java/com/aaaaahhhhhhh/bananapuncher714/mesh/Mesh.java index 632371b..a304fc4 100644 --- a/src/main/java/com/aaaaahhhhhhh/bananapuncher714/mesh/Mesh.java +++ b/src/main/java/com/aaaaahhhhhhh/bananapuncher714/mesh/Mesh.java @@ -1222,7 +1222,7 @@ public class Mesh< T extends Region > { // New cross value for this vertex, so create a new queue // Also add in the original vertex final List< HalfEdge > links = new ArrayList< HalfEdge >(); - links.add( vert.getEdge() ); + links.add( region.upperEdge ); links.add( edge ); if ( region.links.put( region.upper, links ) != null ) { throw new IllegalStateException( "Cross value already used!" ); @@ -1373,7 +1373,7 @@ public class Mesh< T extends Region > { // New cross value for this vertex, so create a new queue // Also add in the original vertex final List< HalfEdge > links = new ArrayList< HalfEdge >(); - links.add( vert.getEdge() ); + links.add( region.lowerEdge ); links.add( edge ); if ( region.links.put( region.lower, links ) != null ) { throw new IllegalStateException( "Cross value already used!" ); @@ -1883,12 +1883,6 @@ public class Mesh< T extends Region > { return Integer.compare( c1.intersections.size(), c2.intersections.size() ); } ).get(); - System.out.println( "Removing chain " + least.getOrigin() + ",\t" + least.getDest() ); - System.out.println( "Intersection with " + least.intersections.size() ); - for ( Chain c : least.intersections ) { - System.out.println( "\t" + c.getOrigin() + ",\t" + c.getDest() ); - } - // Now remove this chain and all other chains that it intersects with remainingChains.remove( least ); if ( !least.intersections.isEmpty() ) { @@ -1903,6 +1897,8 @@ public class Mesh< T extends Region > { System.out.println( "After reducing the amount of intersecting chains: " + selectedChains.size() ); + // TODO Now resolve the chains into the collection!!! + return selectedChains; }