Use the region lower and upper edge instead of an arbitrary edge when constructing a link
This commit is contained in:
@@ -1222,7 +1222,7 @@ public class Mesh< T extends Region > {
|
|||||||
// New cross value for this vertex, so create a new queue
|
// New cross value for this vertex, so create a new queue
|
||||||
// Also add in the original vertex
|
// Also add in the original vertex
|
||||||
final List< HalfEdge > links = new ArrayList< HalfEdge >();
|
final List< HalfEdge > links = new ArrayList< HalfEdge >();
|
||||||
links.add( vert.getEdge() );
|
links.add( region.upperEdge );
|
||||||
links.add( edge );
|
links.add( edge );
|
||||||
if ( region.links.put( region.upper, links ) != null ) {
|
if ( region.links.put( region.upper, links ) != null ) {
|
||||||
throw new IllegalStateException( "Cross value already used!" );
|
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
|
// New cross value for this vertex, so create a new queue
|
||||||
// Also add in the original vertex
|
// Also add in the original vertex
|
||||||
final List< HalfEdge > links = new ArrayList< HalfEdge >();
|
final List< HalfEdge > links = new ArrayList< HalfEdge >();
|
||||||
links.add( vert.getEdge() );
|
links.add( region.lowerEdge );
|
||||||
links.add( edge );
|
links.add( edge );
|
||||||
if ( region.links.put( region.lower, links ) != null ) {
|
if ( region.links.put( region.lower, links ) != null ) {
|
||||||
throw new IllegalStateException( "Cross value already used!" );
|
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() );
|
return Integer.compare( c1.intersections.size(), c2.intersections.size() );
|
||||||
} ).get();
|
} ).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
|
// Now remove this chain and all other chains that it intersects with
|
||||||
remainingChains.remove( least );
|
remainingChains.remove( least );
|
||||||
if ( !least.intersections.isEmpty() ) {
|
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() );
|
System.out.println( "After reducing the amount of intersecting chains: " + selectedChains.size() );
|
||||||
|
|
||||||
|
// TODO Now resolve the chains into the collection!!!
|
||||||
|
|
||||||
return selectedChains;
|
return selectedChains;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user