[Bf-extensions-cvs] [cb5b133] master: 'Invalid'/ self intersecting BMFaces are apparently not added to the bmesh anymore? in the dxf importer there is a section that tests for selfintersecting quad faces and removes them; but here I now get an error, that the face has been removed.So for now I just wrap it in a try/except clause to make it work across several versions?

Lukas Treyer noreply at git.blender.org
Fri May 12 10:54:50 CEST 2017


Commit: cb5b13309073ae7593bc537e8c14ab0bd4f15470
Author: Lukas Treyer
Date:   Fri May 12 10:54:44 2017 +0200
Branches: master
https://developer.blender.org/rBAcb5b13309073ae7593bc537e8c14ab0bd4f15470

'Invalid'/ self intersecting BMFaces are apparently not added to the bmesh anymore? in the dxf importer there is a section that tests for selfintersecting quad faces and removes them; but here I now get an error, that the face has been removed.So for now I just wrap it in a try/except clause to make it work across several versions?

===================================================================

M	io_import_dxf/dxfimport/do.py

===================================================================

diff --git a/io_import_dxf/dxfimport/do.py b/io_import_dxf/dxfimport/do.py
index 3f80c3a..3d474d2 100644
--- a/io_import_dxf/dxfimport/do.py
+++ b/io_import_dxf/dxfimport/do.py
@@ -509,7 +509,10 @@ class Do:
                     ii = geometry.intersect_line_line(edge1, edge2, opposite1, opposite2)
                     if ii is not None:
                         if _is_on_edge(ii[0]):
-                            bm.faces.remove(face)
+                            try:
+                                bm.faces.remove(face)
+                            except Exception as e:
+                                pass
                             iv = bm.verts.new(ii[0])
                             bm.faces.new((verts[i], iv, verts[(i + 3) % 4]))
                             bm.faces.new((verts[i + 1], iv, verts[i + 2]))



More information about the Bf-extensions-cvs mailing list