pcbnew: Treat circular ovals as circles
The oval clearance adds an edge on the 0-length side of a circular oval. This is not needed and can affect the fill algorithm. Instead, we treat round ovals as circles for pad polygons Fixes: lp:1849846 * https://bugs.launchpad.net/kicad/+bug/1849846
This commit is contained in:
parent
42a0cf6283
commit
57f0f88552
|
@ -723,25 +723,33 @@ void D_PAD::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
||||||
|
|
||||||
case PAD_SHAPE_OVAL:
|
case PAD_SHAPE_OVAL:
|
||||||
// An oval pad has the same shape as a segment with rounded ends
|
// An oval pad has the same shape as a segment with rounded ends
|
||||||
|
// If the oval is actually a circle (same x/y size), treat it the same
|
||||||
|
if( dx == dy )
|
||||||
{
|
{
|
||||||
int width;
|
dx = KiROUND( dx * aCorrectionFactor );
|
||||||
wxPoint shape_offset;
|
TransformCircleToPolygon( aCornerBuffer, padShapePos, dx,
|
||||||
if( dy > dx ) // Oval pad X/Y ratio for choosing translation axis
|
aCircleToSegmentsCount );
|
||||||
{
|
|
||||||
shape_offset.y = dy - dx;
|
|
||||||
width = dx * 2;
|
|
||||||
}
|
}
|
||||||
else //if( dy <= dx )
|
else
|
||||||
{
|
{
|
||||||
shape_offset.x = dy - dx;
|
int width;
|
||||||
width = dy * 2;
|
wxPoint shape_offset;
|
||||||
}
|
if( dy > dx ) // Oval pad X/Y ratio for choosing translation axis
|
||||||
|
{
|
||||||
|
shape_offset.y = dy - dx;
|
||||||
|
width = dx * 2;
|
||||||
|
}
|
||||||
|
else //if( dy <= dx )
|
||||||
|
{
|
||||||
|
shape_offset.x = dy - dx;
|
||||||
|
width = dy * 2;
|
||||||
|
}
|
||||||
|
|
||||||
RotatePoint( &shape_offset, angle );
|
RotatePoint( &shape_offset, angle );
|
||||||
wxPoint start = padShapePos - shape_offset;
|
wxPoint start = padShapePos - shape_offset;
|
||||||
wxPoint end = padShapePos + shape_offset;
|
wxPoint end = padShapePos + shape_offset;
|
||||||
TransformOvalClearanceToPolygon( aCornerBuffer, start, end, width,
|
TransformOvalClearanceToPolygon( aCornerBuffer, start, end, width,
|
||||||
aCircleToSegmentsCount, aCorrectionFactor );
|
aCircleToSegmentsCount, aCorrectionFactor );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue