Browse Source

Respect ERROR_OUTSIDE when inflating polygons.

Fixes https://gitlab.com/kicad/code/kicad/issues/10896
7.0
Jeff Young 4 years ago
parent
commit
e6c617b74d
  1. 6
      pcbnew/plot_board_layers.cpp
  2. 9
      pcbnew/zone.cpp
  3. 1
      pcbnew/zone.h
  4. 3
      pcbnew/zone_filler.cpp

6
pcbnew/plot_board_layers.cpp

@ -928,10 +928,12 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask,
continue;
// add shapes inflated by aMinThickness/2 in areas
zone->TransformSmoothedOutlineToPolygon( areas, inflate + zone_margin, boardOutline );
zone->TransformSmoothedOutlineToPolygon( areas, inflate + zone_margin, maxError,
ERROR_OUTSIDE, boardOutline );
// add shapes with their exact mask layer size in initialPolys
zone->TransformSmoothedOutlineToPolygon( initialPolys, zone_margin, boardOutline );
zone->TransformSmoothedOutlineToPolygon( initialPolys, zone_margin, maxError,
ERROR_OUTSIDE, boardOutline );
}
}

9
pcbnew/zone.cpp

@ -1174,6 +1174,7 @@ double ZONE::CalculateOutlineArea()
void ZONE::TransformSmoothedOutlineToPolygon( SHAPE_POLY_SET& aCornerBuffer, int aClearance,
int aMaxError, ERROR_LOC aErrorLoc,
SHAPE_POLY_SET* aBoardOutline ) const
{
// Creates the zone outline polygon (with holes if any)
@ -1193,6 +1194,10 @@ void ZONE::TransformSmoothedOutlineToPolygon( SHAPE_POLY_SET& aCornerBuffer, int
maxError = board->GetDesignSettings().m_MaxError;
int segCount = GetArcToSegmentCount( aClearance, maxError, FULL_CIRCLE );
if( aErrorLoc == ERROR_OUTSIDE )
aClearance += aMaxError;
polybuffer.Inflate( aClearance, segCount );
}
@ -1300,6 +1305,10 @@ void ZONE::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
if( aClearance )
{
int numSegs = GetArcToSegmentCount( aClearance, aError, FULL_CIRCLE );
if( aErrorLoc == ERROR_OUTSIDE )
aClearance += aError;
aCornerBuffer.InflateWithLinkedHoles( aClearance, numSegs, SHAPE_POLY_SET::PM_FAST );
}
}

1
pcbnew/zone.h

@ -404,6 +404,7 @@ public:
* @param aBoardOutline is the board outline (if a valid one exists; nullptr otherwise)
*/
void TransformSmoothedOutlineToPolygon( SHAPE_POLY_SET& aCornerBuffer, int aClearance,
int aError, ERROR_LOC aErrorLoc,
SHAPE_POLY_SET* aBoardOutline ) const;
/**

3
pcbnew/zone_filler.cpp

@ -851,7 +851,8 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE* aZone, PCB_LAYER_ID aLa
if( aKnockout->GetIsRuleArea() )
{
// Keepouts use outline with no clearance
aKnockout->TransformSmoothedOutlineToPolygon( aHoles, 0, nullptr );
aKnockout->TransformSmoothedOutlineToPolygon( aHoles, 0, m_maxError,
ERROR_OUTSIDE, nullptr );
}
else
{

Loading…
Cancel
Save