[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2478] branches/geodesic_domes/ geodesic_259.py: version 0.2 (cleanup) works in 2.6

Peter K.H. Gragert pkhgragert at gmail.com
Tue Oct 18 11:16:27 CEST 2011


Revision: 2478
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2478
Author:   pkhg
Date:     2011-10-18 09:16:27 +0000 (Tue, 18 Oct 2011)
Log Message:
-----------
version 0.2 (cleanup) works in 2.6

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

Modified: branches/geodesic_domes/geodesic_259.py
===================================================================
--- branches/geodesic_domes/geodesic_259.py	2011-10-18 09:16:03 UTC (rev 2477)
+++ branches/geodesic_domes/geodesic_259.py	2011-10-18 09:16:27 UTC (rev 2478)
@@ -1,11 +1,69 @@
+#v 0.1
+###TODO a reset necessary!
+
+#import sys
+#sys.path.append("c:/BlenderSVN/cmake_all3/bin/2.59/scripts/addons/geodesic_domes")
+#import forms_259
+#import vefm_259
+import math
 import bpy
 
 def generate(context):
+    from geodesic_domes import forms_259 
+    from geodesic_domes import vefm_259 
+    from geodesic_domes import geodesic_classes_259 
+
 #    chosen_type  = get_chosen_type(context)
 #    print(chosen_type) #PKHG seems to work
 #    parameters = get_parameter_of_chosen_type(chosen_type)
 #    print("parameters of ", chosen_type, parameters)
     print("generate called")
+    chosen_type = get_chosen_type(context)
+    print("type chosen =", chosen_type)
+    um = context.scene.superformula_um
+    un1 = context.scene.superformula_un1
+    un2 = context.scene.superformula_un2
+    un3 = context.scene.superformula_un3
+    ua = context.scene.superformula_ua
+    ub = context.scene.superformula_ub
+    vm = context.scene.superformula_vm
+    vn1 = context.scene.superformula_vn1
+    vn2 = context.scene.superformula_vn2
+    vn3 = context.scene.superformula_vn3
+    va = context.scene.superformula_va
+    vb = context.scene.superformula_vb
+    uact = context.scene.superformula_uact
+    vact = context.scene.superformula_vact
+    uturn = context.scene.superformula_uturn
+    vturn = context.scene.superformula_vturn
+    utwist = context.scene.superformula_utwist
+    vtwist = context.scene.superformula_vtwist
+
+ 
+    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)    
+#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':        
+        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
+        grysz = context.scene.grid_ysize
+        grid=forms_259.grid(grxres,gryres,grxsz,grysz,1.0,1.0,0,0,0,0,1.0,1.0,superformparam)
+        vefm_259.vefm_add_object(grid)
+    if chosen_type == 'Sphere':
+        uresolution = context.scene.sphere_xres #number of lines N-S  (u coordinate)
+        vresolution = context.scene.sphere_yres #number of lines O-W  (v cordinate)
+        uscale = 10  #seams to be scaling from center in r direction
+        vscale = 0   #expand and shift get factor vscale
+        upart = 6.5 #gap?
+        vpart = 1 #defines gaps?!
+        uphase = vphase = 1
+        utwist = 0
+        vtwist = 0
+        xscale = 1  #scale in x direction
+        yscale = 1  #scale in z direction not y ?! the heigth so to say 
+        sphere=forms_259.sphere(uresolution,vresolution,uscale,vscale,upart,vpart,uphase,vphase,utwist,vtwist,xscale,yscale,superformparam)
+        vefm_259.vefm_add_object(sphere)        
     return {'FINISHED'}
 
 def get_chosen_type(context):
@@ -16,7 +74,7 @@
                '2':'Cylinder',
                '3':'Parabola',
                '4':'Torus',
-               '5':'Ball',
+               '5':'Sphere',
                '6':'Your mesh'}
     result = posible_types[chosen_type]
     return result
@@ -44,7 +102,7 @@
 
 def geodesic_parameters():
     scene = bpy.context.scene
-    parameters = [(0,)*14]
+    parameters = [(0,)*15]
     parameters[0] =     scene.geodesic_frequency   ## How many subdivisions - up to 20.
     parameters[1] =     scene.geodesic_eccentricity   ## Elliptical if >1.0.
     parameters[2] =     0 #TODO scene.geodesic_squish       ## Flattened if < 1.0.



More information about the Bf-extensions-cvs mailing list