[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1167] contrib/py/scripts/addons/ mesh_bridge.py: Version 1.4.4

Bart Crouch bartius.crouch at gmail.com
Sat Nov 20 16:52:51 CET 2010


Revision: 1167
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-extensions&revision=1167
Author:   crouch
Date:     2010-11-20 16:52:51 +0100 (Sat, 20 Nov 2010)

Log Message:
-----------
Version 1.4.4
Minor fix in calculating rotation_matrix, which improves twist detection.

Modified Paths:
--------------
    contrib/py/scripts/addons/mesh_bridge.py

Modified: contrib/py/scripts/addons/mesh_bridge.py
===================================================================
--- contrib/py/scripts/addons/mesh_bridge.py	2010-11-18 00:50:02 UTC (rev 1166)
+++ contrib/py/scripts/addons/mesh_bridge.py	2010-11-20 15:52:51 UTC (rev 1167)
@@ -31,9 +31,9 @@
 bl_addon_info = {
     'name': 'Bridge',
     'author': 'Bartius Crouch',
-    'version': (1, 4, 3),
+    'version': (1, 4, 4),
     'blender': (2, 5, 6),
-    'api': 33078,
+    'api': 33191,
     'location': 'View3D > Ctrl+F > Bridge',
     'warning': '',
     'description': 'Bridge two, or loft several, loops of vertices.',
@@ -273,7 +273,7 @@
     loop1_circular, loop2_circular = [i[1] for i in loops]
     circular = loop1_circular or loop2_circular
     circle_full = False
-
+    
     # calculate loop centers
     centers = []
     for loop in [loop1, loop2]:
@@ -336,9 +336,10 @@
         normals[0].negate()
     if ((center2 + normals[1]) - center1).length > ((center2 - normals[1]) - center1).length:
         normals[1].negate()
-        
+    
     # calculate rotation matrix, representing the difference between the plane normals
     axis = normals[0].cross(normals[1])
+    axis = mathutils.Vector([loc if abs(loc) > 1e-8 else 0 for loc in axis])
     if axis.angle(mathutils.Vector([0, 0, 1]), 0) > 1.5707964:
         axis.negate()
     angle = normals[0].dot(normals[1])
@@ -360,7 +361,7 @@
             dif_angles = [[(mesh.vertices[loop2[0]].co - mesh.vertices[loop1[index]].co).length, angle, index] for angle, distance, index in dif_angles if angle <= angle_limit]
             dif_angles.sort()
         loop1 = loop1[dif_angles[0][2]:] + loop1[:dif_angles[0][2]]
-
+    
     # have both loops face the same way
     if normal_plurity and not circular:
         second_to_first, second_to_second, second_to_last = [(mesh.vertices[loop1[1]].co - center1).angle(mesh.vertices[loop2[i]].co - center2) for i in [0, 1, -1]]




More information about the Bf-extensions-cvs mailing list