[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2500] branches/geodesic_domes/ geodesic_259.py: all *hedron type are generated now

Peter K.H. Gragert pkhgragert at gmail.com
Fri Oct 21 07:38:59 CEST 2011


Revision: 2500
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2500
Author:   pkhg
Date:     2011-10-21 05:38:58 +0000 (Fri, 21 Oct 2011)
Log Message:
-----------
all *hedron type are generated now

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

Modified: branches/geodesic_domes/geodesic_259.py
===================================================================
--- branches/geodesic_domes/geodesic_259.py	2011-10-21 05:33:10 UTC (rev 2499)
+++ branches/geodesic_domes/geodesic_259.py	2011-10-21 05:38:58 UTC (rev 2500)
@@ -1,13 +1,31 @@
-#v 0.1
+#v 0.3
 ###TODO a reset necessary!
 
 import math
 import bpy
 
+def check_contains(cl,name , print_value = False):
+    dir_class = dir(cl)
+    for el in dir_class:
+        if el.startswith("_"):
+            pass
+        else:
+            if print_value:
+                tmp = getattr(cl,el)
+                print(name , " contains ==>",el," value = ", tmp)
+            else:
+                print(name , " contains ==>",el)
+    print("\ncheck_contains finished\n\n")
+    
 def generate(context):
-    from geodesic_domes import forms_259 
-    from geodesic_domes import vefm_259 
-#    print("generate called")
+    from geodesic_domes import forms_259  as forms_259
+    from geodesic_domes import vefm_259 as vefm_259
+    from geodesic_domes import geodesic_classes_259 as geodesic_classes_259
+    '''
+    print("\n...... forms",dir(forms_259))
+    print("\n........vefm ",dir(vefm_259))
+    print("\n..... classes",dir(geodesic_classes_259))    
+    #'''
     chosen_type = get_chosen_type(context)
     print("\n***INFO*** geodesic_259 generate*** type chosen = ", chosen_type)
     um = context.scene.superformula_um
@@ -31,28 +49,52 @@
 
  
     superformparam=[um,un1,un2,un3,ua,ub,vm,vn1,vn2,vn3,va,vb,uact,vact,uturn*math.pi,vturn*(math.pi),utwist,vtwist]
-    print("\n***info geodesic_259.generate***  \nsuperformparam = ",superformparam)    
-#startvaule 2.49    superformparam = [3, 10.0, 10.0, 10.0, 1.0, 1.0, 4, 10.0, 10.0, 10.0, 1.0, 1.0, 0, 0, 0.0, 0.0, 0.0, 0.0]
+    print("***info geodesic_259.generate***  \nsuperformparam = ",superformparam)    
+#startvaule 2.49
+#???PKHG TODO
+    superformparam = [3, 10.0, 10.0, 10.0, 1.0, 1.0, 4, 10.0, 10.0, 10.0, 1.0, 1.0, 0, 0, 0.0, 0.0, 0.0, 0.0]
     if chosen_type == 'Geodesic':
         which_geodesic, which_orientation = get_geodesic_special()
+        frequency = context.scene.geodesic_frequency
+        eccentricity = context.scene.geodesic_eccentricity
+        squish = context.scene.geodesic_flatten
+        radius = context.scene.geodesic_radius
+        squareness = context.scene.geodesic_square
+        squarez = context.scene.geodesic_square_z
+        parameters=[frequency, eccentricity, squish, radius,\
+        squareness,squarez,0,0,0,0,0,0,0,1,superformparam]
+        basegeodesic = geodesic_classes_259.geodesic(parameters)
+        basegeodesic.setparameters()
         if which_geodesic == 'Tetrahedron':
-            print('\n***TEST geodsic_259 L39***\ntestphase, ', which_geodesic, which_orientation)
-            frequency = context.scene.geodesic_frequency
-            eccentricity = context.scene.geodesic_eccentricity
-            squish = context.scene.geodesic_flatten
-            radius = context.scene.geodesic_radius
-            squareness = context.scene.geodesic_square
-            squarez = context.scene.geodesic_square_z
-            #parameters=[frequency, eccentricity, squish, radius,\
-            #squareness,squarez.val,cart.val,shape.val,baselevel.val,\
-            #faceshape.val,dual.val,rotxy.val,rotz.val,
-            #klass.val,superformparam]
-
-            #basegeodesic=creategeo(polytype.val,orientation.val,parameters)
-        else:
-            print('\n***TEST geodsic_259 L39***\ntestphase, other types ', which_geodesic, which_orientation)            
-            
-    
+            if which_orientation == "PointUp":
+                tetrahedron = geodesic_classes_259.tetrahedron(basegeodesic)
+            elif which_orientation == "EdgeUp":
+                tetrahedron = geodesic_classes_259.tetraedge(basegeodesic)
+            else:
+                tetrahedron = geodesic_classes_259.tetraface(basegeodesic)
+            tetrahedron.vertedgefacedata()
+            tetrahedron.config(frequency = frequency)
+            vefm_259.vefm_add_object(tetrahedron)
+        elif which_geodesic == 'Octahedron':
+            if which_orientation == "PointUp":
+                octahedron = geodesic_classes_259.octahedron(basegeodesic)
+            elif which_orientation == "EdgeUp":
+                octahedron = geodesic_classes_259.octaedge(basegeodesic)
+            else:
+                octahedron = geodesic_classes_259.octaface(basegeodesic)
+            octahedron.vertedgefacedata()
+            octahedron.config(frequency = frequency)
+            vefm_259.vefm_add_object(octahedron)
+        elif which_geodesic == 'Icosahedron':       
+            if which_orientation == "PointUp":
+                icosahedron = geodesic_classes_259.icosahedron(basegeodesic)
+            elif which_orientation == "EdgeUp":
+                icosahedron = geodesic_classes_259.icoedge(basegeodesic)
+            else:
+                icosahedron = geodesic_classes_259.icoface(basegeodesic)
+            icosahedron.vertedgefacedata()
+            icosahedron.config(frequency = frequency)
+            vefm_259.vefm_add_object(icosahedron)
     elif chosen_type == 'Grid':        
         grxres = context.scene.grid_xres #at this moment any res = 1 will generate only points!
         gryres = context.scene.grid_yres
@@ -166,13 +208,4 @@
         geo_orientation = "EdgeUp"
     else:
         geo_orientation = "FaceUp"
-        
     return (geo_type,geo_orientation)
-#    return ("Tetrahedron","EdgeUp")
-#    return ("Tetrahedron","FaceUp")
-#    return ("Octahedron","PointUp")
-#    return ("Octahedron","EdgeUp")
-#    return ("Octahedron","FaceUp")
-#    return ("Icosahedron","PointUp")
-#    return ("Icosahedron","EdgeUp")
-#    return ("Icosahedron","FaceUp")



More information about the Bf-extensions-cvs mailing list