Don't apply electrical clearance to non-copper zones.
Also removes a very old (and somewhat confusing) comment. Fixes https://gitlab.com/kicad/code/kicad/issues/7404
This commit is contained in:
parent
6dee7f30fa
commit
e26c912b86
|
@ -1165,12 +1165,19 @@ bool ZONE::BuildSmoothedPoly( SHAPE_POLY_SET& aSmoothedPoly, PCB_LAYER_ID aLayer
|
|||
if( GetNumCorners() <= 2 ) // malformed zone. polygon calculations will not like it ...
|
||||
return false;
|
||||
|
||||
int zoneClearance = m_ZoneClearance;
|
||||
|
||||
if( GetIsRuleArea() )
|
||||
{
|
||||
// We like keepouts just the way they are....
|
||||
aSmoothedPoly = *m_Poly;
|
||||
return true;
|
||||
}
|
||||
else if( !IsOnCopperLayer() )
|
||||
{
|
||||
// Non-copper zones don't have electrical clearances
|
||||
zoneClearance = 0;
|
||||
}
|
||||
|
||||
BOARD* board = GetBoard();
|
||||
int edgeClearance = 0;
|
||||
|
@ -1229,21 +1236,21 @@ bool ZONE::BuildSmoothedPoly( SHAPE_POLY_SET& aSmoothedPoly, PCB_LAYER_ID aLayer
|
|||
for( ZONE* zone : interactingZones )
|
||||
aSmoothedPoly.BooleanAdd( *zone->Outline(), SHAPE_POLY_SET::PM_FAST );
|
||||
|
||||
if( !GetIsRuleArea() && aBoardOutline )
|
||||
if( aBoardOutline )
|
||||
{
|
||||
SHAPE_POLY_SET bufferedOutline = *aBoardOutline;
|
||||
bufferedOutline.Deflate( std::max( m_ZoneClearance, edgeClearance ), 16 );
|
||||
aSmoothedPoly.BooleanIntersection( bufferedOutline, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
SHAPE_POLY_SET poly = *aBoardOutline;
|
||||
poly.Deflate( std::max( zoneClearance, edgeClearance ), 16 );
|
||||
aSmoothedPoly.BooleanIntersection( poly, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
}
|
||||
|
||||
smooth( aSmoothedPoly );
|
||||
|
||||
if( aSmoothedPolyWithApron )
|
||||
{
|
||||
SHAPE_POLY_SET bufferedExtents = *maxExtents;
|
||||
bufferedExtents.Inflate( m_ZoneMinThickness, 16 );
|
||||
SHAPE_POLY_SET poly = *maxExtents;
|
||||
poly.Inflate( m_ZoneMinThickness, 16 );
|
||||
*aSmoothedPolyWithApron = aSmoothedPoly;
|
||||
aSmoothedPolyWithApron->BooleanIntersection( bufferedExtents, SHAPE_POLY_SET::PM_FAST );
|
||||
aSmoothedPolyWithApron->BooleanIntersection( poly, SHAPE_POLY_SET::PM_FAST );
|
||||
}
|
||||
|
||||
aSmoothedPoly.BooleanIntersection( *maxExtents, SHAPE_POLY_SET::PM_FAST );
|
||||
|
|
|
@ -1193,11 +1193,6 @@ bool ZONE_FILLER::fillSingleZone( ZONE* aZone, PCB_LAYER_ID aLayer, SHAPE_POLY_S
|
|||
aLayer = F_Cu;
|
||||
}
|
||||
|
||||
/*
|
||||
* convert outlines + holes to outlines without holes (adding extra segments if necessary)
|
||||
* m_Poly data is expected normalized, i.e. NormalizeAreaOutlines was used after building
|
||||
* this zone
|
||||
*/
|
||||
if ( !aZone->BuildSmoothedPoly( maxExtents, aLayer, boardOutline, &smoothedPoly ) )
|
||||
return false;
|
||||
|
||||
|
@ -1234,7 +1229,7 @@ bool ZONE_FILLER::fillSingleZone( ZONE* aZone, PCB_LAYER_ID aLayer, SHAPE_POLY_S
|
|||
}
|
||||
else if( half_min_width - epsilon > epsilon )
|
||||
{
|
||||
smoothedPoly.Deflate( -( half_min_width - epsilon ), numSegs );
|
||||
smoothedPoly.Inflate( half_min_width - epsilon, numSegs );
|
||||
}
|
||||
|
||||
aRawPolys = smoothedPoly;
|
||||
|
|
Loading…
Reference in New Issue