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

force dxf layer name case agreement #630

Merged
merged 3 commits into from
Feb 13, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cadquery/occ_impl/importers.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,13 @@ def importDXF(filename, tol=1e-6, exclude=[]):
:param exclude: a list of layer names not to import (default: [])
"""

exclude_lwr = [ex.lower() for ex in exclude]

dxf = ezdxf.readfile(filename)
faces = []

for name, layer in dxf.modelspace().groupby(dxfattrib="layer").items():
res = _dxf_convert(layer, tol) if name not in exclude else None
res = _dxf_convert(layer, tol) if name.lower() not in exclude_lwr else None
if res:
wire_sets = sortWiresByBuildOrder(res)
for wire_set in wire_sets:
Expand Down