mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 18:23:15 +02:00
Handle cases where Simplify removes all outlines
This could theoretically happen for a fully degenerate polygon Fixes https://gitlab.com/kicad/code/kicad/issues/12120 (cherry picked from commit 5a37211fdb0d565be640ea1c224f68f1b0475ba3)
This commit is contained in:
parent
b72675ba92
commit
b324abefe5
@ -503,8 +503,8 @@ void BITMAPCONV_INFO::createOutputData( BMP2CMP_MOD_LAYER aModLayer )
|
|||||||
polyset_areas.BooleanSubtract( polyset_holes, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
polyset_areas.BooleanSubtract( polyset_holes, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||||
|
|
||||||
// Ensure there are no self intersecting polygons
|
// Ensure there are no self intersecting polygons
|
||||||
polyset_areas.NormalizeAreaOutlines();
|
if( polyset_areas.NormalizeAreaOutlines() )
|
||||||
|
{
|
||||||
// Convert polygon with holes to a unique polygon
|
// Convert polygon with holes to a unique polygon
|
||||||
polyset_areas.Fracture( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
polyset_areas.Fracture( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||||
|
|
||||||
@ -519,6 +519,7 @@ void BITMAPCONV_INFO::createOutputData( BMP2CMP_MOD_LAYER aModLayer )
|
|||||||
polyset_holes.RemoveAllContours();
|
polyset_holes.RemoveAllContours();
|
||||||
main_outline = true;
|
main_outline = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
paths = paths->next;
|
paths = paths->next;
|
||||||
}
|
}
|
||||||
|
@ -1294,6 +1294,8 @@ int SHAPE_POLY_SET::NormalizeAreaOutlines()
|
|||||||
BooleanSubtract( holesBuffer, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
BooleanSubtract( holesBuffer, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In degenerate cases, simplify might return no outlines
|
||||||
|
if( OutlineCount() > 0 )
|
||||||
RemoveNullSegments();
|
RemoveNullSegments();
|
||||||
|
|
||||||
return OutlineCount();
|
return OutlineCount();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user