pcbnew: Ensure DRC circles have at least 4 points
This prevents invalid outline errors for small circles. Fixes: lp:1822641 * https://bugs.launchpad.net/kicad/+bug/1822641
This commit is contained in:
parent
f20a1314ff
commit
5eb2a33498
|
@ -324,7 +324,7 @@ bool ConvertOutlineToPolygon( std::vector<DRAWSEGMENT*>& aSegList, SHAPE_POLY_SE
|
||||||
// Output the Edge.Cuts perimeter as circle or polygon.
|
// Output the Edge.Cuts perimeter as circle or polygon.
|
||||||
if( graphic->GetShape() == S_CIRCLE )
|
if( graphic->GetShape() == S_CIRCLE )
|
||||||
{
|
{
|
||||||
int steps = GetArcToSegmentCount( graphic->GetRadius(), aTolerance, 360.0 );
|
int steps = std::max<int>( 4, GetArcToSegmentCount( graphic->GetRadius(), aTolerance, 360.0 ) );
|
||||||
TransformCircleToPolygon( aPolygons, graphic->GetCenter(), graphic->GetRadius(), steps );
|
TransformCircleToPolygon( aPolygons, graphic->GetCenter(), graphic->GetRadius(), steps );
|
||||||
}
|
}
|
||||||
else if( graphic->GetShape() == S_POLYGON )
|
else if( graphic->GetShape() == S_POLYGON )
|
||||||
|
@ -530,7 +530,7 @@ bool ConvertOutlineToPolygon( std::vector<DRAWSEGMENT*>& aSegList, SHAPE_POLY_SE
|
||||||
double angle = 3600.0;
|
double angle = 3600.0;
|
||||||
wxPoint start = center;
|
wxPoint start = center;
|
||||||
int radius = graphic->GetRadius();
|
int radius = graphic->GetRadius();
|
||||||
int steps = GetArcToSegmentCount( radius, aTolerance, 360.0 );
|
int steps = std::max<int>( 4, GetArcToSegmentCount( radius, aTolerance, 360.0 ) );
|
||||||
wxPoint nextPt;
|
wxPoint nextPt;
|
||||||
|
|
||||||
start.x += radius;
|
start.x += radius;
|
||||||
|
|
Loading…
Reference in New Issue