Browse Source

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
7.0
Jeff Young 4 years ago
parent
commit
8dcc933fc3
  1. 8
      pcbnew/pcb_expr_evaluator.cpp
  2. 3
      pcbnew/router/pns_kicad_iface.cpp

8
pcbnew/pcb_expr_evaluator.cpp

@ -454,12 +454,12 @@ bool calcIsInsideArea( BOARD_ITEM* aItem, const EDA_RECT& aItemBBox, PCB_EXPR_CO
BOARD* board = aArea->GetBoard();
std::shared_ptr<SHAPE> 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 );

3
pcbnew/router/pns_kicad_iface.cpp

@ -1039,9 +1039,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() )

Loading…
Cancel
Save