Coordinate transformation for displaying #492
-
Hello and thank you very much for ezdxf. Is there any special transformation that has to be applied to the entity coordinates as they are reported via ezdxf before using them? I noticed that there are a few different coordinate systems (WCS, OCS, DCS) as well as a couple of viewports defined in the file I am interested in. However, I can produce a very quick rendering of the entities of interest via a very simple linear transform, e.g. The question now is, are there any additional transformations that must be applied to the coordinates, as part of the way they are stored within the DXF file before they are considered "correct"? I noticed things such as "extrusion vector" (?), that I am in the process of reading about but if a simple linear transform is enough to "draw" the points on a plain pixel surface then I would use that. (Not an Autocad user myself either). All the best |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The OCS to WCS transformation if the extrusion vector != (0, 0, 1), see https://ezdxf.mozman.at/docs/concepts/ocs.html # example for OCS entity CIRCLE
ocs = circle.ocs()
wcs_center = ocs.to_wcs(circle.dxf.center) |
Beta Was this translation helpful? Give feedback.
The OCS to WCS transformation if the extrusion vector != (0, 0, 1), see https://ezdxf.mozman.at/docs/concepts/ocs.html