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:
authorHoward Trickey <howard.trickey@gmail.com>2015-05-01 14:53:07 +0300
committerHoward Trickey <howard.trickey@gmail.com>2015-05-01 14:53:07 +0300
commit44153e0c67f7ccbe3091215875c7f127ec847f1f (patch)
tree4b91a1fe3d4aa41dd36727ac856b27b87f74d385 /mesh_inset/geom.py
parent922272e6bed1829df4b71fa731aa40ddb3e39655 (diff)
Fix T44567: inset polygon added crash
Crash caused by some vertices in the input model being doubled. The code to test for the maximum inset deduped the vertices but the faces were not remapped. Fixed by having that test code not dedup the vertices.
Diffstat (limited to 'mesh_inset/geom.py')
-rw-r--r--mesh_inset/geom.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/mesh_inset/geom.py b/mesh_inset/geom.py
index a7eb4fed..dce2a818 100644
--- a/mesh_inset/geom.py
+++ b/mesh_inset/geom.py
@@ -67,11 +67,12 @@ class Points(object):
return tuple([int(round(v * INVDISTTOL)) for v in p])
- def AddPoint(self, p):
+ def AddPoint(self, p, allowdups = False):
"""Add point p to the Points set and return vertex number.
If there is an existing point which quantizes the same,,
don't add a new one but instead return existing index.
+ Except if allowdups is True, don't do that deduping.
Args:
p: tuple of float - coordinates (2-tuple or 3-tuple)
@@ -80,14 +81,14 @@ class Points(object):
"""
qp = Points.Quantize(p)
- if qp in self.invmap:
+ if qp in self.invmap and not allowdups:
return self.invmap[qp]
else:
self.invmap[qp] = len(self.pos)
self.pos.append(p)
return len(self.pos) - 1
- def AddPoints(self, points):
+ def AddPoints(self, points, allowdups = False):
"""Add another set of points to this set.
We need to return a mapping from indices
@@ -102,7 +103,7 @@ class Points(object):
vmap = [0] * len(points.pos)
for i in range(len(points.pos)):
- vmap[i] = self.AddPoint(points.pos[i])
+ vmap[i] = self.AddPoint(points.pos[i], allowdups)
return vmap
def AddZCoord(self, z):