Add option to use layer names in DXF export (#2439) - #2447
goanscryca wants to merge 1 commit into
Conversation
Add dxf_use_layer_names option to DXFWriterOptions, SaveLayoutOptions,
buddy writer options (--use-layer-names), and GUI export dialog.
When enabled, layer names are preserved directly (e.g. 'PAD') without
prepending 'L{layer}D{datatype}' numbers.
|
Thank you for implementing PR #2447! First, I confirmed the new DXF writer option: A. Layers without namesWhen the original KLayout layers do not have layer names: the exported DXF keeps the conventional
B. Layers with namesWhen the KLayout layers have names: with "Use layer names (don't prefix with layer/datatype numbers)" enabled, those names are directly used as the DXF layer names:
This is exactly the behavior @laurentc2 was looking for in the original issue: existing KLayout layer names are now preserved directly in the DXF export, while unnamed layers retain their conventional layer/datatype-based names. Thank you very much for implementing this feature! Best regards, |
|
Hi @goanscryca, thanks for the PR. I think it's solving the issue of Laurent. I had a different solution in mind - if you do GDS to DXF translation, you will always need a layer mapping and my proposal was to have a flag that strips layer/datatype upon mapping. So a change in input translation rather than output translation. I think that this change has more use cases, i.e. for other name-based formats such as CIF. In general, I appreciate if people talk to me before implementing something. Anyway, I think your patch is valid and useful, conforming with the code style and it comes with tests, which is good. I have some remarks though:
Matthias |





This PR addresses #2439 by adding support for exporting DXF layers with their original layout layer names instead of prefixing layer/datatype numbers (e.g.
PADinstead ofL18D0_PAD).Changes
DXFWriterOptions(dbDXFFormat.h):use_layer_namesboolean flag (defaults tofalsefor backwards compatibility).DXFWriter::write(dbDXFWriter.cc):db::SaveLayoutOptions::LP_AssignNameWithPrioritywhenuse_layer_namesis true, preserving layer names directly as DXF layer names.gsiDeclDbDXF.cc,dbcore.pyi,laySaveLayoutOptions.rb):dxf_use_layer_names/dxf_use_layer_names=accessors onSaveLayoutOptions.DXFWriterOptionPage.ui,layDXFWriterPlugin.cc):dbDXF.cc):use-layer-names.bdWriterOptions.h,bdWriterOptions.cc,bdBasicTests.cc):--use-layer-namesflag to generic writer options.dbDXFWriterTests.cc,bdBasicTests.cc,laySaveLayoutOptions.rb):TEST(LayerNames)verifying DXF export with and withoutuse_layer_names.Fixes #2439.