Fracture self-intersecting polygons

Self-intersecting polygons may form a hole after simplification, so make
sure that we fracture them as well to clear the hole

Fixes https://gitlab.com/kicad/code/kicad/issues/13067
This commit is contained in:
Seth Hillbrand 2022-12-03 12:07:38 -08:00
parent a1617e7c82
commit 73398e07a8
1 changed files with 2 additions and 2 deletions

View File

@ -2758,7 +2758,7 @@ void SHAPE_POLY_SET::CacheTriangulation( bool aPartition, bool aSimplify )
flattened.ClearArcs(); flattened.ClearArcs();
if( flattened.HasHoles() ) if( flattened.HasHoles() || flattened.IsSelfIntersecting() )
flattened.Fracture( PM_FAST ); flattened.Fracture( PM_FAST );
else if( aSimplify ) else if( aSimplify )
flattened.Simplify( PM_FAST ); flattened.Simplify( PM_FAST );
@ -2776,7 +2776,7 @@ void SHAPE_POLY_SET::CacheTriangulation( bool aPartition, bool aSimplify )
tmpSet.ClearArcs(); tmpSet.ClearArcs();
if( tmpSet.HasHoles() ) if( tmpSet.HasHoles() || tmpSet.IsSelfIntersecting() )
tmpSet.Fracture( PM_FAST ); tmpSet.Fracture( PM_FAST );
else if( aSimplify ) else if( aSimplify )
tmpSet.Simplify( PM_FAST ); tmpSet.Simplify( PM_FAST );