Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Treyer <treyer@arch.ethz.ch>2016-10-11 12:12:27 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-10-19 15:42:29 +0300
commit8df8fb0342874b2c76c488df081c34d57f17c643 (patch)
treee0bda155db6190ba0d08de164bf6964027dc5795
parentd791f42c54bea18a0a528747153aa7162383bed5 (diff)
bugfix for T49593: _gen_meshface removes points from a 3DFACE or SOLID if the they share the same location. This was a good a idea but it was not implemented completely. Now it is: faces with overlapping verts get imported as edges if the remaining geometry has only 2 verts. This allows the user to easily select all edges if extraction is needed to make it visible in a rendering. (e.g. select one edge and then choose Select > Select Similar > Amount of connecting edges).
-rw-r--r--io_import_dxf/dxfimport/do.py33
1 files changed, 19 insertions, 14 deletions
diff --git a/io_import_dxf/dxfimport/do.py b/io_import_dxf/dxfimport/do.py
index 4b73eaac..66551f53 100644
--- a/io_import_dxf/dxfimport/do.py
+++ b/io_import_dxf/dxfimport/do.py
@@ -493,21 +493,26 @@ class Do:
verts = []
for p in points:
verts.append(bm.verts.new(self.proj(p)))
- face = bm.faces.new(verts)
- if len(points) == 4:
- for i in range(2):
- edge1 = verts[i].co
- edge2 = verts[i + 1].co
- opposite1 = verts[i + 2].co
- opposite2 = verts[(i + 3) % 4].co
- ii = geometry.intersect_line_line(edge1, edge2, opposite1, opposite2)
- if ii is not None:
- if _is_on_edge(ii[0]):
- bm.faces.remove(face)
- 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]))
+ # add only an edge if len points < 3
+ if len(points) == 2:
+ bm.edges.new(verts)
+ elif len(points) > 2:
+ face = bm.faces.new(verts)
+
+ if len(points) == 4:
+ for i in range(2):
+ edge1 = verts[i].co
+ edge2 = verts[i + 1].co
+ opposite1 = verts[i + 2].co
+ opposite2 = verts[(i + 3) % 4].co
+ ii = geometry.intersect_line_line(edge1, edge2, opposite1, opposite2)
+ if ii is not None:
+ if _is_on_edge(ii[0]):
+ bm.faces.remove(face)
+ 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]))
def the3dface(self, en, bm):
""" f: dxf entity