7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-11 09:00:13 +00:00

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

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 );