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:
parent
875caa694c
commit
37afcd93e2
|
@ -638,18 +638,18 @@ void D_PAD::TransformShapeWithClearanceToPolygon(
|
||||||
case PAD_SHAPE_CHAMFERED_RECT:
|
case PAD_SHAPE_CHAMFERED_RECT:
|
||||||
case PAD_SHAPE_ROUNDRECT:
|
case PAD_SHAPE_ROUNDRECT:
|
||||||
{
|
{
|
||||||
SHAPE_POLY_SET outline;
|
int radius = GetRoundRectCornerRadius() + aClearanceValue;
|
||||||
int radius = GetRoundRectCornerRadius() + aClearanceValue;
|
int numSegs = std::max( GetArcToSegmentCount( radius, aError, 360.0 ), 6 );
|
||||||
int numSegs = std::max( GetArcToSegmentCount( radius, aError, 360.0 ), 6 );
|
double correction = GetCircletoPolyCorrectionFactor( numSegs );
|
||||||
double correction = GetCircletoPolyCorrectionFactor( numSegs );
|
int clearance = KiROUND( aClearanceValue * correction );
|
||||||
int clearance = KiROUND( aClearanceValue * correction );
|
int rounding_radius = KiROUND( radius * correction );
|
||||||
int rounding_radius = GetRoundRectCornerRadius() + clearance;
|
wxSize shapesize( m_Size );
|
||||||
wxSize shapesize( m_Size );
|
|
||||||
|
|
||||||
shapesize.x += clearance * 2;
|
shapesize.x += clearance * 2;
|
||||||
shapesize.y += clearance * 2;
|
shapesize.y += clearance * 2;
|
||||||
bool doChamfer = GetShape() == PAD_SHAPE_CHAMFERED_RECT;
|
bool doChamfer = GetShape() == PAD_SHAPE_CHAMFERED_RECT;
|
||||||
|
|
||||||
|
SHAPE_POLY_SET outline;
|
||||||
TransformRoundChamferedRectToPolygon( outline, padShapePos, shapesize, angle,
|
TransformRoundChamferedRectToPolygon( outline, padShapePos, shapesize, angle,
|
||||||
rounding_radius, doChamfer ? GetChamferRectRatio() : 0.0,
|
rounding_radius, doChamfer ? GetChamferRectRatio() : 0.0,
|
||||||
doChamfer ? GetChamferPositions() : 0, aError );
|
doChamfer ? GetChamferPositions() : 0, aError );
|
||||||
|
|
Loading…
Reference in New Issue