PAD::TransformShapeWithClearanceToPolygon(): better polygonal shapes:
- Oval and round pads ensure at least 16 segments per CIRCLE (like other shapes) - For ERROR_OUTSIDE option, ensure the aarc approx error is the actual error, not max allowed error. These changes can be seen only for a large max allowed approx error, especially when filling zones.
This commit is contained in:
parent
5116fa6d12
commit
1a23502e98
|
@ -607,7 +607,7 @@ void PAD::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
||||||
if( dx == dy || ( GetShape() == PAD_SHAPE::CIRCLE ) )
|
if( dx == dy || ( GetShape() == PAD_SHAPE::CIRCLE ) )
|
||||||
{
|
{
|
||||||
TransformCircleToPolygon( aCornerBuffer, padShapePos, dx + aClearanceValue, aError,
|
TransformCircleToPolygon( aCornerBuffer, padShapePos, dx + aClearanceValue, aError,
|
||||||
aErrorLoc );
|
aErrorLoc, pad_min_seg_per_circle_count );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -617,7 +617,8 @@ void PAD::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
||||||
RotatePoint( &delta, angle );
|
RotatePoint( &delta, angle );
|
||||||
|
|
||||||
TransformOvalToPolygon( aCornerBuffer, padShapePos - delta, padShapePos + delta,
|
TransformOvalToPolygon( aCornerBuffer, padShapePos - delta, padShapePos + delta,
|
||||||
( half_width + aClearanceValue ) * 2, aError, aErrorLoc );
|
( half_width + aClearanceValue ) * 2, aError, aErrorLoc,
|
||||||
|
pad_min_seg_per_circle_count );
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -651,7 +652,10 @@ void PAD::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
||||||
int clearance = aClearanceValue;
|
int clearance = aClearanceValue;
|
||||||
|
|
||||||
if( aErrorLoc == ERROR_OUTSIDE )
|
if( aErrorLoc == ERROR_OUTSIDE )
|
||||||
clearance += GetCircleToPolyCorrection( aError );
|
{
|
||||||
|
int actual_error = CircleToEndSegmentDeltaRadius( clearance, numSegs );
|
||||||
|
clearance += GetCircleToPolyCorrection( actual_error );
|
||||||
|
}
|
||||||
|
|
||||||
outline.Inflate( clearance, numSegs );
|
outline.Inflate( clearance, numSegs );
|
||||||
}
|
}
|
||||||
|
@ -726,7 +730,10 @@ void PAD::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
||||||
int clearance = aClearanceValue;
|
int clearance = aClearanceValue;
|
||||||
|
|
||||||
if( aErrorLoc == ERROR_OUTSIDE )
|
if( aErrorLoc == ERROR_OUTSIDE )
|
||||||
clearance += GetCircleToPolyCorrection( aError );
|
{
|
||||||
|
int actual_error = CircleToEndSegmentDeltaRadius( clearance, numSegs );
|
||||||
|
clearance += GetCircleToPolyCorrection( actual_error );
|
||||||
|
}
|
||||||
|
|
||||||
outline.Inflate( clearance, numSegs );
|
outline.Inflate( clearance, numSegs );
|
||||||
outline.Simplify( SHAPE_POLY_SET::PM_FAST );
|
outline.Simplify( SHAPE_POLY_SET::PM_FAST );
|
||||||
|
|
Loading…
Reference in New Issue