Fixed duplicate collinear edge bug

This commit is contained in:
2025-05-17 16:05:10 -04:00
parent 2ff86b88a4
commit 7e39c48d76
2 changed files with 118 additions and 38 deletions

View File

@@ -279,17 +279,22 @@ public class MeshingTest2 extends JPanel {
Mesh< RegionSimple > mesh = new Mesh< RegionSimple >( () -> { return new RegionSimple( GluWindingRule.ODD ); } );
mesh.addPolygon( new Polygon( Arrays.asList(
new Point( -1, -1 ),
new Point( -1, 0 ),
new Point( 1, -2 ),
new Point( 1, -1 ),
new Point( 1, 1 ),
new Point( -1, 1 )
new Point( 2, -1 ),
new Point( 1, 0 ),
new Point( 1, 1 )
) ), RegionRuleWinding.CLOCKWISE );
mesh.simplify();
mesh.generateRegions();
return mesh.mesh();
final Collection< EdgePolygon > polys = mesh.mesh();
chains = mesh.chains;
return polys;
}
private static List< Facet > generateFacetsFor( AABB box ) {