Skip to content

Commit

Permalink
Fix T39979
Browse files Browse the repository at this point in the history
Checking for zero-length vector wasn't sufficiently robust.
Could result in NaNs being assigned to vertex coordinates.
  • Loading branch information
Crouch committed Aug 6, 2014
1 parent 80c7986 commit 6b57e3e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mesh_looptools.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
bl_info = {
"name": "LoopTools",
"author": "Bart Crouch",
"version": (4, 6, 1),
"blender": (2, 69, 3),
"version": (4, 6, 2),
"blender": (2, 71, 3),
"location": "View3D > Toolbar and View3D > Specials (W-key)",
"warning": "",
"description": "Mesh modelling toolkit. Several tools to aid modelling",
Expand Down Expand Up @@ -1686,7 +1686,7 @@ def circle_3d_to_2d(bm_mod, loop, com, normal):
# calculate two vectors (p and q) along the plane
m = mathutils.Vector((normal[0] + 1.0, normal[1], normal[2]))
p = m - (m.dot(normal) * normal)
if p.dot(p) == 0.0:
if p.dot(p) < 1e-6:
m = mathutils.Vector((normal[0], normal[1] + 1.0, normal[2]))
p = m - (m.dot(normal) * normal)
q = p.cross(normal)
Expand Down Expand Up @@ -4093,7 +4093,6 @@ def execute(self, context):

# saving cache for faster execution next time
if not cached:
print(loops)
cache_write("Space", object, bm, self.input, False, False, loops,
derived, mapping)

Expand Down

0 comments on commit 6b57e3e

Please sign in to comment.