[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2491] branches/geodesic_domes/ geodesic_259.py: preparations for the 9 geodesic type (tetra, octa, icosa)

Peter K.H. Gragert pkhgragert at gmail.com
Wed Oct 19 08:14:01 CEST 2011


Revision: 2491
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2491
Author:   pkhg
Date:     2011-10-19 06:14:01 +0000 (Wed, 19 Oct 2011)
Log Message:
-----------
preparations for the 9 geodesic type (tetra, octa, icosa)

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

Modified: branches/geodesic_domes/geodesic_259.py
===================================================================
--- branches/geodesic_domes/geodesic_259.py	2011-10-18 19:11:12 UTC (rev 2490)
+++ branches/geodesic_domes/geodesic_259.py	2011-10-19 06:14:01 UTC (rev 2491)
@@ -31,9 +31,29 @@
 
  
     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***  superformparam = ",superformparam)    
+    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]
-    if chosen_type == 'Grid':        
+    if chosen_type == 'Geodesic':
+        which_geodesic, which_orientation = get_geodesic_special()
+        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)            
+            
+    
+    elif chosen_type == 'Grid':        
         grxres = context.scene.grid_xres #at this moment any res = 1 will generate only points!
         gryres = context.scene.grid_yres
         grxsz = context.scene.grid_xsize
@@ -42,7 +62,7 @@
         vefm_259.vefm_add_object(grid)
 #    if chosen_type == 'Sphere' or chosen_type == 'Cylinder' \
 #           or chosen_type == 'Parabola' or chosen_type == 'Torus':
-    if chosen_type in ['Sphere', 'Cylinder', 'Parabola', 'Torus']:
+    elif chosen_type in ['Sphere', 'Cylinder', 'Parabola', 'Torus']:
         uresolution = context.scene.formobs_uresolution #number of lines N-S  (u coordinate)
         vresolution = context.scene.formobs_vresolution #number of lines O-W  (v cordinate)
         uscale = context.scene.formobs_uscale  #seams to be scaling from center in r direction
@@ -129,3 +149,30 @@
 #TODO    if self.geodesic_frequency % 2 != 0:
 #TODO        self.odd = 1    
     return result
+
+def get_geodesic_special():
+    get_scene = bpy.context.scene
+    geo_type = ""
+    geo_orientation = ''
+    if get_scene.base_type ==  '0':
+        geo_type = "Tetrahedron"
+    elif get_scene.base_type ==  '1':
+        geo_type = "Octahedron"
+    else:
+        geo_type = "Icosahedron"
+    if get_scene.orientation ==  '0':
+        geo_orientation = "PointUp"
+    elif get_scene.orientation ==  '1':
+        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