[Bf-extensions-cvs] [ee68a176] master: Fix T70899: Looptools circle fails when new plane created aligned to view

Germano Cavalcante noreply at git.blender.org
Fri Oct 18 19:23:13 CEST 2019


Commit: ee68a17611920264c4353a1fdc79f80be08fc710
Author: Germano Cavalcante
Date:   Fri Oct 18 14:22:48 2019 -0300
Branches: master
https://developer.blender.org/rBAee68a17611920264c4353a1fdc79f80be08fc710

Fix T70899: Looptools circle fails when new plane created aligned to view

loop tools uses a custom matrix inverse function with high precision.
So this precision has to extend to other parts.

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

M	mesh_looptools.py

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

diff --git a/mesh_looptools.py b/mesh_looptools.py
index 41c1be0a..67855477 100644
--- a/mesh_looptools.py
+++ b/mesh_looptools.py
@@ -19,7 +19,7 @@
 bl_info = {
     "name": "LoopTools",
     "author": "Bart Crouch",
-    "version": (4, 6, 7),
+    "version": (4, 6, 8),
     "blender": (2, 80, 0),
     "location": "View3D > Sidebar > Edit Tab / Edit Mode Context Menu",
     "warning": "",
@@ -290,8 +290,10 @@ def calculate_plane(bm_mod, loop, method="best_fit", object=False):
             for i in range(itermax):
                 vec = vec2
                 vec2 = mat @ vec
-                if vec2.length != 0:
-                    vec2 /= vec2.length
+                # Calculate length with double precision to avoid problems with `inf`
+                vec2_length = math.sqrt(vec2[0] ** 2 + vec2[1] ** 2 + vec2[2] ** 2)
+                if vec2_length != 0:
+                    vec2 /= vec2_length
                 if vec2 == vec:
                     break
             if vec2.length == 0:



More information about the Bf-extensions-cvs mailing list