pcbnew: Fix missing correction to Pad->Polygon transform

The rounded radius needs to be corrected even when there is no clearance
to ensure that the pad segments fall on the arc.
This commit is contained in:
Seth Hillbrand 2019-06-17 05:28:52 -07:00
parent 875caa694c
commit 37afcd93e2
1 changed files with 7 additions and 7 deletions

View File

@ -638,18 +638,18 @@ void D_PAD::TransformShapeWithClearanceToPolygon(
case PAD_SHAPE_CHAMFERED_RECT:
case PAD_SHAPE_ROUNDRECT:
{
SHAPE_POLY_SET outline;
int radius = GetRoundRectCornerRadius() + aClearanceValue;
int numSegs = std::max( GetArcToSegmentCount( radius, aError, 360.0 ), 6 );
double correction = GetCircletoPolyCorrectionFactor( numSegs );
int clearance = KiROUND( aClearanceValue * correction );
int rounding_radius = GetRoundRectCornerRadius() + clearance;
wxSize shapesize( m_Size );
int radius = GetRoundRectCornerRadius() + aClearanceValue;
int numSegs = std::max( GetArcToSegmentCount( radius, aError, 360.0 ), 6 );
double correction = GetCircletoPolyCorrectionFactor( numSegs );
int clearance = KiROUND( aClearanceValue * correction );
int rounding_radius = KiROUND( radius * correction );
wxSize shapesize( m_Size );
shapesize.x += clearance * 2;
shapesize.y += clearance * 2;
bool doChamfer = GetShape() == PAD_SHAPE_CHAMFERED_RECT;
SHAPE_POLY_SET outline;
TransformRoundChamferedRectToPolygon( outline, padShapePos, shapesize, angle,
rounding_radius, doChamfer ? GetChamferRectRatio() : 0.0,
doChamfer ? GetChamferPositions() : 0, aError );