CadQuery / cadquery

A python parametric CAD scripting framework based on OCCT
https://cadquery.readthedocs.io
Other
3.25k stars 294 forks source link

_importDXF wire_set throw "IndexError: list index out of range" #1274

Open tp1415926535 opened 1 year ago

tp1415926535 commented 1 year ago

script:

import cadquery
result = cadquery.importers.importDXF("D:/Machine.dxf")

output:

Traceback (most recent call last):
  File "D:\python scripts\cadTrans.py", line 2, in <module>
    result = cadquery.importers.importDXF("D:/Machine.dxf")
  File "D:\Python3.9.13\lib\site-packages\cadquery\occ_impl\importers\__init__.py", line 86, in importDXF
    faces = _importDXF(filename, tol, exclude, include)
  File "D:\Python3.9.13\lib\site-packages\cadquery\occ_impl\importers\dxf.py", line 198, in _importDXF
    faces.append(Face.makeFromWires(wire_set[0], wire_set[1:]))
IndexError: list index out of range

the dxf file: Machine.zip

adam-urbanczyk commented 1 year ago

CQ does not support ezdxf.entities.acis.Solid3d. Only the following entities are supported:

DXF_CONVERTERS = {
    "LINE": _dxf_line,
    "CIRCLE": _dxf_circle,
    "ARC": _dxf_arc,
    "POLYLINE": _dxf_polyline,
    "LWPOLYLINE": _dxf_polyline,
    "SPLINE": _dxf_spline,
    "ELLIPSE": _dxf_ellipse,
}