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
(cherry picked from commit 5eb2a33498
)
This commit is contained in:
parent
17fdce01a9
commit
658820a25e
|
@ -324,7 +324,7 @@ bool ConvertOutlineToPolygon( std::vector<DRAWSEGMENT*>& aSegList, SHAPE_POLY_SE
|
|||
// Output the Edge.Cuts perimeter as circle or polygon.
|
||||
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 );
|
||||
}
|
||||
else if( graphic->GetShape() == S_POLYGON )
|
||||
|
@ -530,7 +530,7 @@ bool ConvertOutlineToPolygon( std::vector<DRAWSEGMENT*>& aSegList, SHAPE_POLY_SE
|
|||
double angle = 3600.0;
|
||||
wxPoint start = center;
|
||||
int radius = graphic->GetRadius();
|
||||
int steps = GetArcToSegmentCount( radius, aTolerance, 360.0 );
|
||||
int steps = std::max<int>( 4, GetArcToSegmentCount( radius, aTolerance, 360.0 ) );
|
||||
wxPoint nextPt;
|
||||
|
||||
start.x += radius;
|
||||
|
|
Loading…
Reference in New Issue