I am implementing a DXF importer, for now I am taking into consideration the HEADER
section and only one variable from it INSUNITS
, TABLES
section only one table BLOCK_RECORD
table, BLOCKS
section, ENTITIES
section (INSERT
, LINE
, LWPOLYLINE
, ARC
, CIRCLE
).
When importing I don't know if I need to take into consideration units, and if I need to, I don't know how exactly to take this into consideration. My file is not imported in the correct way now, it is most likely due to these units as I think I am doing my INSERT
transformations correctly:
EXTRUSIONDIRECTIONTRANSFORMATION *
INSERTIONPOINTTRANSLATION *
ROTATION * SCALING * BASEPOINTTRANSLATION
A file I am importing is imported in the correct way when I remove the BASEPOINTTRANSLATION
, but some other files are not imported in the right way and some parts of the drawing get imported very far away from rest.
It looks to me like the base point of a block is in inches and when I convert it to meters it becomes a bit better. So if someone knows in which order I should do the transformations and how to handle units in DXF files I would be really grateful as I am stuck now.