Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DXF Importer (C++) no longer imports layers other than the "0" layer #13597

Open
2 tasks done
furgo16 opened this issue Apr 23, 2024 · 2 comments
Open
2 tasks done

DXF Importer (C++) no longer imports layers other than the "0" layer #13597

furgo16 opened this issue Apr 23, 2024 · 2 comments
Labels
Bug This issue or PR is related to a bug File format: DXF Regression Bugs describing a regression or PRs fixing one

Comments

@furgo16
Copy link
Contributor

furgo16 commented Apr 23, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Problem description

The DXF importer in the development branch seems to no longer create layers correctly. I've seen it working at some point, but now only layer 0 seems to be imported correctly, and the rest are ignored –either their contents or their names. On the other hand, the stable branch has some sort of layer support, and the results are also shown here for comparison.

The starting point is a sample file that contains 3 layers, with a simple object (rectangle or circle) in each layer. The drawing looks like in the following screenshot, as loaded by QCAD:

Captura de pantalla de 2024-04-23 10-55-57

DXF import with FreeCAD 0.22

As single elements

The following settings were used:
image

The result:

  • [ok] Single elements are imported correctly, including colors. They use specific names (line, circle) according to their shape.
  • [fail] Only layer 0 is imported as a layer. The rest of elements outside of 0 appear layerless

image

dxf_layers_single_dev.zip

As layer blocks

The following settings were used:
image

The result:

  • [ok] Grouped elements are imported correctly as compounds, including colors. They a generic name (CompoundNNN).
  • [fail] Only layer 0 is imported as a layer. The rest of elements outside of 0 appear layerless. However, each block is correctly created as a container for the elements that would belong to a specific layer. This was a similar behavior to FreeCAD 0.21, but 0.21 had the ability to name the block/compound as the layer it had been constructed from (see 0.21 example below).

image

dxf_layers_layerblocks_dev.zip

DXF import with FreeCAD 0.21

The following comparison was made using FreeCAD's stable version:

OS: Ubuntu Core 20 (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.21.2.33771 (Git) Snap 908
Build type: Release
Branch: tag: 0.21.2
Hash: b9bfa5c5507506e4515816414cd27f4851d00489
Python 3.8.10, Qt 5.15.7, Coin 4.0.0, Vtk 7.1.1, OCC 7.6.3
Locale: C/Default (C)
Installed mods: 
  * Curves 0.6.23
  * Assembly4 0.50.7

As single elements

The following settings were used:
image

  • [ok] Single elements are imported correctly, without colors. They use generic names (ShapeNNN).
  • [fail] No layer grouping at all

image

dxf_layers_single_stable.zip

As layer blocks

The following settings were used:
image

  • [ok] Grouped elements are imported correctly as compounds, including colors. Compounds are named after the layer it originally contained all their elements.
  • [fail] No layer grouping, but each block is correctly created as a container for the elements that would belong to a specific layer. However, the naming of the compounds using the original layer name makes it possible to identify and use the original layers

Captura de pantalla de 2024-04-23 11-34-53

dxf_layers_layerblocks_stable.zip

Conclusion

As mentioned at the top, I have seen layers being imported in the development branch at some point (a couple of weeks in the past?). This would seem like a regression, but unfortunately, I don't have the older files to show it.

A proper fix would bring back support for layers, but a quick fix improvement could already be to regain the functionality of 0.21 whereby when imported as blocks, the blocks were named like the layers.

Full version info

OS: Ubuntu Core 22 (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.36961 (Git) Snap 996
Build type: Release
Branch: main
Hash: c4c453312d148fd67bd893366c42b559e28a85e6
Python 3.10.12, Qt 5.15.10, Coin 4.0.0, Vtk 7.1.1, OCC 7.7.1
Installed mods: 
  * OpenTheme 2024.4.20
  * BIM 2021.12.0
  * Curves 0.6.35
  * ExplodedAssembly
  * BillOfMaterials 0.0.8.2
  * Ondsel-Lens 2024.4.16.01
  * Assembly4 0.50.12

Subproject(s) affected?

File formats

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@maxwxyz maxwxyz added Bug This issue or PR is related to a bug File format: DXF Regression Bugs describing a regression or PRs fixing one labels Apr 23, 2024
@furgo16
Copy link
Contributor Author

furgo16 commented Apr 24, 2024

Also related to imported DXF layers: #13621

@furgo16 furgo16 changed the title DXF importer no longer imports layers other than the "0" layer DXF Importer (C++) no longer imports layers other than the "0" layer Apr 24, 2024
@furgo16
Copy link
Contributor Author

furgo16 commented Apr 27, 2024

I can no longer reproduce this issue. Today I could import layers successfully with the C++ importer. I wonder if the fix for #13636 had something to do with it. I'll keep monitoring, as I'll be doing more imports in the next few days, and if I still cannot reproduce it, I'll close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This issue or PR is related to a bug File format: DXF Regression Bugs describing a regression or PRs fixing one
Projects
None yet
Development

No branches or pull requests

2 participants