mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 10:13:19 +02:00
Respect ERROR_OUTSIDE when inflating polygons.
Fixes https://gitlab.com/kicad/code/kicad/issues/10896
This commit is contained in:
parent
79c7859052
commit
e6c617b74d
@ -928,10 +928,12 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// add shapes inflated by aMinThickness/2 in areas
|
// 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
|
// 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 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1174,6 +1174,7 @@ double ZONE::CalculateOutlineArea()
|
|||||||
|
|
||||||
|
|
||||||
void ZONE::TransformSmoothedOutlineToPolygon( SHAPE_POLY_SET& aCornerBuffer, int aClearance,
|
void ZONE::TransformSmoothedOutlineToPolygon( SHAPE_POLY_SET& aCornerBuffer, int aClearance,
|
||||||
|
int aMaxError, ERROR_LOC aErrorLoc,
|
||||||
SHAPE_POLY_SET* aBoardOutline ) const
|
SHAPE_POLY_SET* aBoardOutline ) const
|
||||||
{
|
{
|
||||||
// Creates the zone outline polygon (with holes if any)
|
// 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;
|
maxError = board->GetDesignSettings().m_MaxError;
|
||||||
|
|
||||||
int segCount = GetArcToSegmentCount( aClearance, maxError, FULL_CIRCLE );
|
int segCount = GetArcToSegmentCount( aClearance, maxError, FULL_CIRCLE );
|
||||||
|
|
||||||
|
if( aErrorLoc == ERROR_OUTSIDE )
|
||||||
|
aClearance += aMaxError;
|
||||||
|
|
||||||
polybuffer.Inflate( aClearance, segCount );
|
polybuffer.Inflate( aClearance, segCount );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1300,6 +1305,10 @@ void ZONE::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
|||||||
if( aClearance )
|
if( aClearance )
|
||||||
{
|
{
|
||||||
int numSegs = GetArcToSegmentCount( aClearance, aError, FULL_CIRCLE );
|
int numSegs = GetArcToSegmentCount( aClearance, aError, FULL_CIRCLE );
|
||||||
|
|
||||||
|
if( aErrorLoc == ERROR_OUTSIDE )
|
||||||
|
aClearance += aError;
|
||||||
|
|
||||||
aCornerBuffer.InflateWithLinkedHoles( aClearance, numSegs, SHAPE_POLY_SET::PM_FAST );
|
aCornerBuffer.InflateWithLinkedHoles( aClearance, numSegs, SHAPE_POLY_SET::PM_FAST );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -404,6 +404,7 @@ public:
|
|||||||
* @param aBoardOutline is the board outline (if a valid one exists; nullptr otherwise)
|
* @param aBoardOutline is the board outline (if a valid one exists; nullptr otherwise)
|
||||||
*/
|
*/
|
||||||
void TransformSmoothedOutlineToPolygon( SHAPE_POLY_SET& aCornerBuffer, int aClearance,
|
void TransformSmoothedOutlineToPolygon( SHAPE_POLY_SET& aCornerBuffer, int aClearance,
|
||||||
|
int aError, ERROR_LOC aErrorLoc,
|
||||||
SHAPE_POLY_SET* aBoardOutline ) const;
|
SHAPE_POLY_SET* aBoardOutline ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -851,7 +851,8 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE* aZone, PCB_LAYER_ID aLa
|
|||||||
if( aKnockout->GetIsRuleArea() )
|
if( aKnockout->GetIsRuleArea() )
|
||||||
{
|
{
|
||||||
// Keepouts use outline with no clearance
|
// Keepouts use outline with no clearance
|
||||||
aKnockout->TransformSmoothedOutlineToPolygon( aHoles, 0, nullptr );
|
aKnockout->TransformSmoothedOutlineToPolygon( aHoles, 0, m_maxError,
|
||||||
|
ERROR_OUTSIDE, nullptr );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user