KLayout / klayout

KLayout Main Sources
http://www.klayout.org
GNU General Public License v3.0
779 stars 199 forks source link

Saving DXF with HATCH entities in 0.26.9 #796

Closed ttshaw1 closed 3 years ago

ttshaw1 commented 3 years ago

I just ran into a problem saving a GDS file as a DXF. I selected "Polygon handling - Write HATCH entity" . If I inspect the DXF file, I see the version is AC1006 (R10), which doesn't support HATCH entities. Opening the output file caused various bad things depending on what program I opened it with. Saving with SOLID entities worked fine.

I'd recommend restricting polygon handling to entities that are supported by DXF R10, or the current DXF version if that's selectable.

Additionally, the link to the DXF specifications at https://klayout.de/dxf_format.html no longer points to the specifications and should be updated to http://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf

klayoutmatthias commented 3 years ago

Thanks for reporting this.

KLayout support for DXF is only rudimentary. DXF is hardly documented (maybe by intention) and has a couple of design flaws which disqualifies it for mask data representation. The DXF written can be read by some other tools, but it does not follow a specific version. If you can recommend a better version string to use for the header, please let me know. Still I will not give any warranty about compliance with that version and use of DXF is entirely on your own risk.

The link reflects my interpretation. It's my documentation, not a reference to an external resource.

Matthias

ttshaw1 commented 3 years ago

I have to admit, I know almost nothing about the DXF format. It appears that LibreCAD's fallback DXF version is R14, or AC1014. To me that implies that it's either a particularly safe or common standard, so that might be a good target.

Sorry, I was unclear on the link. In the first section of the page you wrote, there's a link "DXF Specification Page" that apparently has 404ed and redirects to Autodesk's main page. That's the link that I'd like to see updated.