haplokuon / netDxf

.net dxf Reader-Writer
MIT License
990 stars 401 forks source link

How can i determine if an arc is clockwise or counterwise? #233

Open PacoLAR opened 3 years ago

PacoLAR commented 3 years ago

Good afternoon, I would like to know when an arc is clockwise or counterclockwise. If there is an attribute that specifies it or how it could be obtained.

haplokuon commented 3 years ago

In the Arc DXF definition there is no value that defines if the arc is CCW or CW. This is handle by a header variable named "AngDir" that you can find in the DrawingVariables of the document. This not only affects the arc but also all angle values. See the AutoCad manual for more information on that. If that value is changed while adding arcs to a document, netDxf will not modify the start and end angles of the existing ones you will need to take care of that, this is also applicable to other places where angles are involved.

By default, the AngDir value is set to CCW and my recommendation is to follow the standards, where positive angles are CCW, and always leave this as it is.