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
committerLukas Treyer <treyer@arch.ethz.ch>2016-10-11 12:12:27 +0300
commit1b58a90cd418bf07df8a9c411dbdaa8698a905ae (patch)
treeaea73e2594f0640fc2237f991ce845c3649eb204 /io_import_dxf
parent2f3e4104de5a1a08ba91900e9e0b0d739ca61a3c (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).
Diffstat (limited to 'io_import_dxf')
-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