haplokuon / netDxf

.net dxf Reader-Writer
MIT License
995 stars 405 forks source link

Arc startAngle or EndAngle Issue #287

Open petercaogx opened 3 years ago

petercaogx commented 3 years ago

I am working on exporting AUTOCAD dxf file to svg file, and most of function worked perfect, but Arc startAngle or endAngle, I tried to correct it in two ways if the object is Arc I will if (l.EndAngle > l.StartAngle) { startAngle = (float)(CIRCLE - l.EndAngle); stopAngle = (float)(l.EndAngle - l.StartAngle); } else { startAngle = (float)(CIRCLE - l.EndAngle); stopAngle = (float)(CIRCLE - l.StartAngle + l.EndAngle); } if the object is Ellipse I will float startAngle = 0.0f; float stopAngle = 0.0f; if (l.EndAngle > l.StartAngle) { startAngle = (float)(225 - l.EndAngle); stopAngle = (float)(l.EndAngle - l.StartAngle); } else { startAngle = (float)(225 - l.EndAngle); stopAngle = (float)(360 - l.StartAngle + l.EndAngle); } Any one can help on this issue?

Thanks

test002 image

petercaogx commented 3 years ago

Sorry, The CIRCLE is a const = 360

haplokuon commented 3 years ago

You still need to explain what are you trying to do and what that piece of code represents and what are you trying to achieve with it. Imagine that I have no idea about the SVG format and its requirements.