From b077b32c4339efd5aeffcb7d31aeace1286f974e Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 3 Jul 2025 22:40:28 -0600 Subject: [PATCH] Clear arcs before boolean ops (KICAD-CFQ). --- pcbnew/pcb_base_frame.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index 9124f9abbf..3c31469c8b 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -352,8 +352,7 @@ void PCB_BASE_FRAME::FocusOnItems( std::vector aItems, PCB_LAYER_ID } catch( const std::exception& e ) { - wxFAIL_MSG( wxString::Format( wxT( "Clipper exception occurred: %s" ), - e.what() ) ); + wxFAIL_MSG( wxString::Format( wxT( "Clipper exception occurred: %s" ), e.what() ) ); } break; @@ -376,27 +375,25 @@ void PCB_BASE_FRAME::FocusOnItems( std::vector aItems, PCB_LAYER_ID case PCB_DIM_CENTER_T: case PCB_DIM_RADIAL_T: case PCB_DIM_ORTHOGONAL_T: - item->TransformShapeToPolygon( itemPoly, aLayer, 0, pcbIUScale.mmToIU( 0.1 ), - ERROR_INSIDE ); + item->TransformShapeToPolygon( itemPoly, aLayer, 0, pcbIUScale.mmToIU( 0.1 ), ERROR_INSIDE ); break; case PCB_ZONE_T: { ZONE* zone = static_cast( item ); - #if 0 +#if 0 // Using the filled area shapes to find a Focus point can give good results, but // unfortunately the calculations are highly time consuming, even for not very // large areas (can be easily a few minutes for large areas). // so we used only the zone outline that usually do not have too many vertices. - zone->TransformShapeToPolygon( itemPoly, aLayer, 0, pcbIUScale.mmToIU( 0.1 ), - ERROR_INSIDE ); + zone->TransformShapeToPolygon( itemPoly, aLayer, 0, pcbIUScale.mmToIU( 0.1 ), ERROR_INSIDE ); if( itemPoly.IsEmpty() ) itemPoly = *zone->Outline(); - #else +#else // much faster calculation time when using only the zone outlines itemPoly = *zone->Outline(); - #endif +#endif break; } @@ -416,6 +413,8 @@ void PCB_BASE_FRAME::FocusOnItems( std::vector aItems, PCB_LAYER_ID try { + itemPoly.ClearArcs(); + viewportPoly.ClearArcs(); clippedPoly.BooleanIntersection( itemPoly, viewportPoly ); } catch( const std::exception& e )