Solid quadrilateral is not drawing correclty #422
-
Running import ezdxf
doc = ezdxf.new("R2013")
msp = doc.modelspace()
msp.add_solid([(0.0, 0.0), (0.0, 10.0), (10.0, 10.0), (10.0, 0.0)])
doc.saveas("out.dxf") I would expect this to render as a square, but when I open it in eDrawings Viewer or Autodesk DWG TrueView, it renders as an hourglass shape instead: Am I doing something incorrectly? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Because ezdxf is an DXF interface, it writes the vertices as the DXF format stores the vertices, the last two vertices have to be reversed. This is a design decision done by Autodesk. |
Beta Was this translation helpful? Give feedback.
-
Added addtional documentation to SOLID and TRACE: The SOLID entity stores the vertices in an unusual way, the last two vertices are reversed. The coordinates [(0, 0), (1, 0), (1, 1), (0, 1)] do not create a square as you would expect: Reverse the last two vertices to get the |
Beta Was this translation helpful? Give feedback.
Added addtional documentation to SOLID and TRACE:
The SOLID entity stores the vertices in an unusual way, the last two vertices are reversed. The coordinates [(0, 0), (1, 0), (1, 1), (0, 1)] do not create a square as you would expect:
Reverse the last two vertices to get the
expected
square: [(0, 0), (1, 0), (0, 1), (1, 1)]