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
(cherry picked from commit 57f0f88552
)
This commit is contained in:
parent
08169afbee
commit
9c8ae217a6
|
@ -562,27 +562,33 @@ void D_PAD::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
|||
break;
|
||||
|
||||
case PAD_SHAPE_OVAL:
|
||||
{
|
||||
// An oval pad has the same shape as a segment with rounded ends
|
||||
int width;
|
||||
wxPoint shape_offset;
|
||||
|
||||
if( dy > dx ) // Oval pad X/Y ratio for choosing translation axis
|
||||
// If the oval is actually a circle (same x/y size), treat it the same
|
||||
if( dx == dy )
|
||||
{
|
||||
shape_offset.y = dy - dx;
|
||||
width = dx * 2;
|
||||
TransformCircleToPolygon( aCornerBuffer, padShapePos, dx, aError );
|
||||
}
|
||||
else //if( dy <= dx )
|
||||
else
|
||||
{
|
||||
shape_offset.x = dy - dx;
|
||||
width = dy * 2;
|
||||
int width;
|
||||
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 );
|
||||
wxPoint start = padShapePos - shape_offset;
|
||||
wxPoint end = padShapePos + shape_offset;
|
||||
TransformOvalToPolygon( aCornerBuffer, start, end, width, aError );
|
||||
}
|
||||
|
||||
RotatePoint( &shape_offset, angle );
|
||||
wxPoint start = padShapePos - shape_offset;
|
||||
wxPoint end = padShapePos + shape_offset;
|
||||
TransformOvalToPolygon( aCornerBuffer, start, end, width, aError );
|
||||
}
|
||||
break;
|
||||
|
||||
case PAD_SHAPE_TRAPEZOID:
|
||||
|
|
Loading…
Reference in New Issue