dxf import crash #51474

Closed
opened 2017-05-12 10:22:29 +02:00 by matali23 · 5 comments

System Information
Windows 7 x64
Blender Version
Broken: 1cfc481

Short description of error
some simple shapes make the importer to crash

Exact steps for others to reproduce the error
Try to import this file:
simple shape error.dxf
You get this error:

Traceback (most recent call last):
  File "C:\blender-2.78.0-git.1cfc481-windows64\2.78\scripts\addons\io_import_dxf\__init__.py", line 540, in execute
    proj_dxf, proj_scn, self.represent_thickness_and_width, self.import_atts, dxf_unit_scale)
  File "C:\blender-2.78.0-git.1cfc481-windows64\2.78\scripts\addons\io_import_dxf\__init__.py", line 119, in read
    errors = do.entities(os.path.basename(filename).replace(".dxf", ""), new_scene)
  File "C:\blender-2.78.0-git.1cfc481-windows64\2.78\scripts\addons\io_import_dxf\dxfimport\do.py", line 1611, in entities
    self.combined_objects((en for en in self.dwg.modelspace() if is_.combined_entity(en)), scene)
  File "C:\blender-2.78.0-git.1cfc481-windows64\2.78\scripts\addons\io_import_dxf\dxfimport\do.py", line 1515, in combined_objects
    o = self._call_object_types(TYPE, by_att, group, name, scene, False)
  File "C:\blender-2.78.0-git.1cfc481-windows64\2.78\scripts\addons\io_import_dxf\dxfimport\do.py", line 1364, in _call_object_types
    o = type_func(entity, scene, name)
  File "C:\blender-2.78.0-git.1cfc481-windows64\2.78\scripts\addons\io_import_dxf\dxfimport\do.py", line 1236, in object_mesh
    self.the3dface(en, bm)
  File "C:\blender-2.78.0-git.1cfc481-windows64\2.78\scripts\addons\io_import_dxf\dxfimport\do.py", line 526, in the3dface
    self._gen_meshface(points, bm)
  File "C:\blender-2.78.0-git.1cfc481-windows64\2.78\scripts\addons\io_import_dxf\dxfimport\do.py", line 512, in _gen_meshface
    bm.faces.remove(face)
ReferenceError: BMesh data of type BMFace has been removed

location: <unknown location>:-1


**System Information** Windows 7 x64 **Blender Version** Broken: 1cfc481 **Short description of error** some simple shapes make the importer to crash **Exact steps for others to reproduce the error** Try to import this file: [simple shape error.dxf](https://archive.blender.org/developer/F596013/simple_shape_error.dxf) You get this error: ``` Traceback (most recent call last): File "C:\blender-2.78.0-git.1cfc481-windows64\2.78\scripts\addons\io_import_dxf\__init__.py", line 540, in execute proj_dxf, proj_scn, self.represent_thickness_and_width, self.import_atts, dxf_unit_scale) File "C:\blender-2.78.0-git.1cfc481-windows64\2.78\scripts\addons\io_import_dxf\__init__.py", line 119, in read errors = do.entities(os.path.basename(filename).replace(".dxf", ""), new_scene) File "C:\blender-2.78.0-git.1cfc481-windows64\2.78\scripts\addons\io_import_dxf\dxfimport\do.py", line 1611, in entities self.combined_objects((en for en in self.dwg.modelspace() if is_.combined_entity(en)), scene) File "C:\blender-2.78.0-git.1cfc481-windows64\2.78\scripts\addons\io_import_dxf\dxfimport\do.py", line 1515, in combined_objects o = self._call_object_types(TYPE, by_att, group, name, scene, False) File "C:\blender-2.78.0-git.1cfc481-windows64\2.78\scripts\addons\io_import_dxf\dxfimport\do.py", line 1364, in _call_object_types o = type_func(entity, scene, name) File "C:\blender-2.78.0-git.1cfc481-windows64\2.78\scripts\addons\io_import_dxf\dxfimport\do.py", line 1236, in object_mesh self.the3dface(en, bm) File "C:\blender-2.78.0-git.1cfc481-windows64\2.78\scripts\addons\io_import_dxf\dxfimport\do.py", line 526, in the3dface self._gen_meshface(points, bm) File "C:\blender-2.78.0-git.1cfc481-windows64\2.78\scripts\addons\io_import_dxf\dxfimport\do.py", line 512, in _gen_meshface bm.faces.remove(face) ReferenceError: BMesh data of type BMFace has been removed location: <unknown location>:-1 ```
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @matali23

Added subscriber: @matali23
Lukas Treyer was assigned by matali23 2017-05-12 10:23:00 +02:00
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Member

added try/except clause; commit cb5b133090
Do you really think this is a simple shape? It's a 3D shape with 210 faces. Or if you really do think, this importer cannot even handle the most simple shapes then start look for the error yourself and adjust the script. The fix I now added, could have been added by someone with at most one hour of intro to python. Just leave out the emotional judging. And don't forget to activate the option that centers your geometry to the middle of the scene. Even AutoDesks online dxf viewer struggles with your geometry when orbiting around it, because it's sooo far away from 0,0.

added try/except clause; commit cb5b13309073ae7593bc537e8c14ab0bd4f15470 Do you really think this is a simple shape? It's a 3D shape with 210 faces. Or if you really do think, this importer cannot even handle the most simple shapes then start look for the error yourself and adjust the script. The fix I now added, could have been added by someone with at most one hour of intro to python. Just leave out the emotional judging. And don't forget to activate the option that centers your geometry to the middle of the scene. Even AutoDesks online dxf viewer struggles with your geometry when orbiting around it, because it's sooo far away from 0,0.
Author

@cnd thanks for the fix and sorry if you perceived it as a judgement, it was not meant so. Simple was compared to what else I import like digital terrain model that your importer handle very good. I really appreciate your work, it's really usefull.

@cnd thanks for the fix and sorry if you perceived it as a judgement, it was not meant so. Simple was compared to what else I import like digital terrain model that your importer handle very good. I really appreciate your work, it's really usefull.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#51474
No description provided.