From 878c4d2f6b64e30d0445aaa2bba1d03e1e3ab712 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 4 Mar 2022 12:11:07 +0000 Subject: [PATCH] Must clear arcs before calling Clipper. --- pcbnew/zone.cpp | 2 +- pcbnew/zone_filler.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pcbnew/zone.cpp b/pcbnew/zone.cpp index ce3b92113d..55caca755a 100644 --- a/pcbnew/zone.cpp +++ b/pcbnew/zone.cpp @@ -1056,7 +1056,7 @@ bool ZONE::BuildSmoothedPoly( SHAPE_POLY_SET& aSmoothedPoly, PCB_LAYER_ID aLayer return false; // Processing of arc shapes in zones is not yet supported because Clipper can't do boolean - // operations on them. The poly outline must be flattened first. + // operations on them. The poly outline must be converted to segments first. SHAPE_POLY_SET flattened = *m_Poly; flattened.ClearArcs(); diff --git a/pcbnew/zone_filler.cpp b/pcbnew/zone_filler.cpp index a27626d01e..5d3aa91e93 100644 --- a/pcbnew/zone_filler.cpp +++ b/pcbnew/zone_filler.cpp @@ -936,7 +936,15 @@ void ZONE_FILLER::subtractHigherPriorityZones( const ZONE* aZone, PCB_LAYER_ID a return; if( aKnockout->GetCachedBoundingBox().Intersects( aZone->GetCachedBoundingBox() ) ) - aRawFill.BooleanSubtract( *aKnockout->Outline(), SHAPE_POLY_SET::PM_FAST ); + { + // Processing of arc shapes in zones is not yet supported because Clipper + // can't do boolean operations on them. The poly outline must be converted to + // segments first. + SHAPE_POLY_SET outline = *aKnockout->Outline(); + outline.ClearArcs(); + + aRawFill.BooleanSubtract( outline, SHAPE_POLY_SET::PM_FAST ); + } }; for( ZONE* otherZone : m_board->Zones() )