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

This commit is contained in:
Jeff Young 2023-08-27 16:36:12 +01:00
parent eba8acf602
commit a946f7ab1b
1 changed files with 5 additions and 1 deletions

View File

@ -645,7 +645,9 @@ void DXF_IMPORT_PLUGIN::addEllipse( const DL_EllipseData& aData )
if( startAngle > endAngle )
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 )
{
@ -666,6 +668,8 @@ void DXF_IMPORT_PLUGIN::addEllipse( const DL_EllipseData& aData )
}
}
// TODO: testcases for negative extrusion vector; handle it here
std::vector<BEZIER<double>> splines;
ELLIPSE<double> ellipse( center, major, aData.ratio, startAngle, endAngle );