Weird "start_angle" / "end_angle" behavior for arcs #659
Unanswered
git-n-pissed
asked this question in
Q&A
Replies: 1 comment 1 reply
-
That is the "usual" angle orientation, where 0 degree is "east" (3 o'clock) or the x-axis in the coordinate system. This is defined by the DXF reference or more precise: how AutoCAD defines and expects angle values. The imported DXF file by SolidWorks is already an interpretation of the DXF content and not a good starting point for understanding the DXF format. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm seeing some weird behavior regarding the
start_angle
andend_angle
of arcs that doesn't seem to align with what is written in the documentation and possibly isn't consistent across DXF files. All the arcs I'm dealing with are from 2D drawings which were generated by SolidWorks 2020. All DXF files I'm dealing with contain a single layer, which is the "Front Plane" in SolidWorks.Here is one arc I'm dealing with:

And here are the properties that ezdxf gives me for that arc:
And the arc's extrusion:
Note that the
start_angle
is 270 and theend_angle
is 90. The documentation doesn't specify where the 0/360 position of the arc is, but based on the actual drawing and what ezdxf is showing it appears that in this case the 0/360 is at the 3 o'clock position and not the 12 o'clock position as one would assume. That means these values are 90 degrees off. I thought this is "just how it is" and I had been compensating with this code:But then I started seeing inconsistencies between this arc and arcs in other DXF files. Here is one such example:

And here are the properties that ezdxf gives me for that arc:
And the arc's extrusion (identical to the first arc's extrusion):
Note that the
start_angle
is 180 and theend_angle
is 270, but based on what I saw from the previous arc this is not what I was expecting.The documentation which claims arcs are drawn from
start_angle
toend_angle
in a counter-clockwise direction, but the only way that can be true for both of the example arcs I gave is for the 0/360 position to be at 3 o'clock and degree marks increment counter-clockwise.What am I missing here?
UPDATE:
I've done some more investigating with additional files and it does seem that ezdxf consistently has the 0/360 position at 3 o'clock and the degree markers always increment counter-clockwise. Not sure if there is a reason for this, but it is extremely unintuitive.
For those of you who, like me, expect 0/360 to be at the 12 o'clock position and have degree markers increment clockwise, here is some code that will accomplish that:
Here is a before and after example of that code:
Beta Was this translation helpful? Give feedback.
All reactions