Handle non-cardinal major-axis arcs when importing DXF.

(cherry picked from commit a946f7ab1b)
This commit is contained in:
Jeff Young 2023-08-27 16:36:12 +01:00
parent bfdbf969c2
commit 82ed223b02
1 changed files with 5 additions and 1 deletions

View File

@ -601,7 +601,9 @@ void DXF_IMPORT_PLUGIN::addEllipse( const DL_EllipseData& aData )
if( startAngle > endAngle ) if( startAngle > endAngle )
endAngle += ANGLE_360; endAngle += ANGLE_360;
// TODO: testcases for negative extrusion vector; handle it here // Angles are relative to major axis
startAngle -= EDA_ANGLE( major );
endAngle -= EDA_ANGLE( major );
if( aData.ratio == 1.0 ) if( aData.ratio == 1.0 )
{ {
@ -622,6 +624,8 @@ void DXF_IMPORT_PLUGIN::addEllipse( const DL_EllipseData& aData )
} }
} }
// TODO: testcases for negative extrusion vector; handle it here
std::vector<BEZIER<double>> splines; std::vector<BEZIER<double>> splines;
ELLIPSE<double> ellipse( center, major, aData.ratio, startAngle, endAngle ); ELLIPSE<double> ellipse( center, major, aData.ratio, startAngle, endAngle );