[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2581] branches/geodesic_domes/vefm_259 .py: strut implented, needed small change

Peter K.H. Gragert pkhgragert at gmail.com
Thu Nov 3 13:26:53 CET 2011


Revision: 2581
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2581
Author:   pkhg
Date:     2011-11-03 12:26:53 +0000 (Thu, 03 Nov 2011)
Log Message:
-----------
strut implented, needed small change 

Modified Paths:
--------------
    branches/geodesic_domes/vefm_259.py

Modified: branches/geodesic_domes/vefm_259.py
===================================================================
--- branches/geodesic_domes/vefm_259.py	2011-11-03 04:31:23 UTC (rev 2580)
+++ branches/geodesic_domes/vefm_259.py	2011-11-03 12:26:53 UTC (rev 2581)
@@ -236,8 +236,8 @@
         v1.findlength()
         v2.findlength()
         if v1.length == 0 or v2.length == 0:
-            print("\nPKHG warning, =========== at least one zero vector 0.0 used")
-            return 0.0
+            print("\nPKHG warning, =========== at least one zero vector 0.0 used")         
+            return pi * 0.25  #45 degrees??? #PKHG???TODO
 #        dot=(v1.x*v2.x)+(v1.y*v2.y)+(v1.z*v2.z)
         dot = v1.vector.dot(v2.vector)
         costheta = dot/(v1.length*v2.length)
@@ -869,8 +869,9 @@
         copied_mesh = None
         if breakquadflag:
             name = impmesh.name
-            impmesh.name = "Original_" + name
-#PKHG TODO use a copy?            bpy.ops.object.duplicate_move(OBJECT_OT_duplicate={"linked":False, "mode":'TRANSLATION'}, TRANSFORM_OT_translate={"value":(0, 0,0}))
+#PKHG???needed???NO 3-11-2011            impmesh.name = "Original_" + name
+            impmesh.name =  name
+#PKHG TODO use a copy?   no not necessary         bpy.ops.object.duplicate_move(OBJECT_OT_duplicate={"linked":False, "mode":'TRANSLATION'}, TRANSFORM_OT_translate={"value":(0, 0,0}))
 #PKHG TODO use a copy?            copied_mesh = bpy.context.active_object
             bpy.ops.object.mode_set(mode='EDIT')
             bpy.ops.mesh.quads_convert_to_tris()
@@ -969,7 +970,7 @@
         if widthtog:
             self.width = width
         else:
-            self.width = width*yardstick
+            self.width = width * yardstick
         if heighttog:
             self.height = height
         else:
@@ -977,7 +978,7 @@
         if lengthtog:
             self.shrink = length
         else:
-            self.shrink = length#*yardstick        
+            self.shrink = length * yardstick        
         if not base.facenormalflag:
             for currentface in base.faces:
                 currentface.docorners()
@@ -1007,12 +1008,18 @@
             start = len(self.verts)
             centre = average([edj.a,edj.b]).centroid()
             split = edj.vect.length/2
-            dubbl = edj.vect.length/(maxx-minx)
+            #PKHG no division by zero!!
+            tmp = 1.0
+            if maxx != minx:
+                tmp = 1.0/(maxx - minx)
+#            dubbl = edj.vect.length/(maxx-minx)
+            dubbl = edj.vect.length * tmp
+            #PKHG end no division by zero!!
             diffplus = split-maxx
             diffminus=-split-minx
             for point in template.verts:
 #                ay=(edj.normal*point.z*self.height)+(edj.normal*lift)
-                ay=(edj.normal * point.vectorz * self.height) + (edj.normal * lift)
+                ay=(edj.normal * point.vector.z * self.height) + (edj.normal * lift)
 #                ce = edj.cross * point.y * self.width
                 ce = edj.cross * point.vector.y * self.width
                 if stretchflag:



More information about the Bf-extensions-cvs mailing list