Fix D_PAD::BuildPadShapePolygon() incorrect calculation for custom pad shapes.
Fixes: lp:1784340 https://bugs.launchpad.net/kicad/+bug/1784340
This commit is contained in:
parent
aa340e6b85
commit
5e19ed29b8
|
@ -758,8 +758,6 @@ void D_PAD::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Function BuildPadShapePolygon
|
||||
* Build the Corner list of the polygonal shape,
|
||||
|
@ -779,7 +777,6 @@ void D_PAD::BuildPadShapePolygon( SHAPE_POLY_SET& aCornerBuffer,
|
|||
case PAD_SHAPE_CIRCLE:
|
||||
case PAD_SHAPE_OVAL:
|
||||
case PAD_SHAPE_ROUNDRECT:
|
||||
case PAD_SHAPE_CUSTOM:
|
||||
{
|
||||
// We are using TransformShapeWithClearanceToPolygon to build the shape.
|
||||
// Currently, this method uses only the same inflate value for X and Y dirs.
|
||||
|
@ -806,6 +803,15 @@ void D_PAD::BuildPadShapePolygon( SHAPE_POLY_SET& aCornerBuffer,
|
|||
}
|
||||
|
||||
break;
|
||||
|
||||
case PAD_SHAPE_CUSTOM:
|
||||
// for a custom shape, that is in fact a polygon (with holes), we can use only a inflate value.
|
||||
// so use ( aInflateValue.x + aInflateValue.y ) / 2 as polygon inflate value.
|
||||
// (different values for aInflateValue.x and aInflateValue.y has no sense for a custom pad)
|
||||
TransformShapeWithClearanceToPolygon( aCornerBuffer,
|
||||
( aInflateValue.x + aInflateValue.y ) / 2,
|
||||
aSegmentsPerCircle, aCorrectionFactor );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -825,12 +825,10 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter,
|
|||
{
|
||||
// add shapes with exact size
|
||||
module->TransformPadsShapesWithClearanceToPolygon( layer,
|
||||
initialPolys, 0,
|
||||
circleToSegmentsCount, correction );
|
||||
initialPolys, 0, circleToSegmentsCount, correction );
|
||||
// add shapes inflated by aMinThickness/2
|
||||
module->TransformPadsShapesWithClearanceToPolygon( layer,
|
||||
areas, inflate,
|
||||
circleToSegmentsCount, correction );
|
||||
areas, inflate, circleToSegmentsCount, correction );
|
||||
}
|
||||
|
||||
// Plot vias on solder masks, if aPlotOpt.GetPlotViaOnMaskLayer() is true,
|
||||
|
|
Loading…
Reference in New Issue