From 7cba8e847d1a12594ff255ed78f26619f734711f Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 12 Feb 2022 13:35:30 +0000 Subject: [PATCH] Don't use bounding box cache during insideArea. For starters we can't rely on it having been updated, but we also cache the entire result so there's no huge cost-savings anyway. Fixes https://gitlab.com/kicad/code/kicad/issues/10821 (cherry picked from commit 8dcc933fc37049faad44f89195d6b7890b34a206) --- pcbnew/pcb_expr_evaluator.cpp | 8 ++++---- pcbnew/router/pns_kicad_iface.cpp | 3 --- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/pcbnew/pcb_expr_evaluator.cpp b/pcbnew/pcb_expr_evaluator.cpp index b6ac64a2d8..f642907e19 100644 --- a/pcbnew/pcb_expr_evaluator.cpp +++ b/pcbnew/pcb_expr_evaluator.cpp @@ -451,12 +451,12 @@ bool calcIsInsideArea( BOARD_ITEM* aItem, const EDA_RECT& aItemBBox, PCB_EXPR_CO BOARD* board = aArea->GetBoard(); std::shared_ptr shape; - if( !aArea->GetCachedBoundingBox().Intersects( aItemBBox ) ) + if( !aArea->GetBoundingBox().Intersects( aItemBBox ) ) return false; - // Collisions include touching, so we need to deflate outline by enough to - // exclude touching. This is particularly important for detecting copper fills - // as they will be exactly touching along the entire border. + // Collisions include touching, so we need to deflate outline by enough to exclude it. + // This is particularly important for detecting copper fills as they will be exactly + // touching along the entire exclusion border. SHAPE_POLY_SET areaOutline = *aArea->Outline(); areaOutline.Deflate( board->GetDesignSettings().GetDRCEpsilon(), 0, SHAPE_POLY_SET::ALLOW_ACUTE_CORNERS ); diff --git a/pcbnew/router/pns_kicad_iface.cpp b/pcbnew/router/pns_kicad_iface.cpp index d2292c2f21..7b8159357c 100644 --- a/pcbnew/router/pns_kicad_iface.cpp +++ b/pcbnew/router/pns_kicad_iface.cpp @@ -1035,9 +1035,6 @@ bool PNS_KICAD_IFACE_BASE::syncZone( PNS::NODE* aWorld, ZONE* aZone, SHAPE_POLY_ if( !aZone->GetIsRuleArea() && aZone->GetZoneName().IsEmpty() ) return false; - // Required by expression function insideArea() - aZone->CacheBoundingBox(); - // TODO handle aZone->GetDoNotAllowVias() // TODO handle rules which disallow tracks & vias if( !aZone->GetIsRuleArea() || !aZone->GetDoNotAllowTracks() )