Performance enhancement for zone filling.

This commit is contained in:
Jeff Young 2022-09-16 19:16:15 +01:00
parent 907cafef6d
commit 90bc5c19cf
1 changed files with 7 additions and 1 deletions

View File

@ -986,7 +986,10 @@ bool ZONE::IsIsland( PCB_LAYER_ID aLayer, int aPolyIdx ) const
void ZONE::GetInteractingZones( PCB_LAYER_ID aLayer, std::vector<ZONE*>* aZones ) const
{
int epsilon = Millimeter2iu( 0.001 );
int epsilon = Millimeter2iu( 0.001 );
BOX2I bbox = GetCachedBoundingBox();
bbox.Inflate( epsilon );
for( ZONE* candidate : GetBoard()->Zones() )
{
@ -1002,6 +1005,9 @@ void ZONE::GetInteractingZones( PCB_LAYER_ID aLayer, std::vector<ZONE*>* aZones
if( candidate->GetNetCode() != GetNetCode() )
continue;
if( !candidate->GetCachedBoundingBox().Intersects( bbox ) )
continue;
for( auto iter = m_Poly->CIterate(); iter; iter++ )
{
if( candidate->m_Poly->Collide( iter.Get(), epsilon ) )