[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2536] branches/geodesic_domes/ geodesic_259.py: adjusted for (more or less) modal sphere, torus, parabola, cylinder, grid

Peter K.H. Gragert pkhgragert at gmail.com
Thu Oct 27 12:15:16 CEST 2011


Revision: 2536
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2536
Author:   pkhg
Date:     2011-10-27 10:15:16 +0000 (Thu, 27 Oct 2011)
Log Message:
-----------
adjusted for (more or less) modal sphere, torus, parabola, cylinder, grid 

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

Modified: branches/geodesic_domes/geodesic_259.py
===================================================================
--- branches/geodesic_domes/geodesic_259.py	2011-10-27 10:14:03 UTC (rev 2535)
+++ branches/geodesic_domes/geodesic_259.py	2011-10-27 10:15:16 UTC (rev 2536)
@@ -3,6 +3,11 @@
 import math
 import bpy
 
+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
+
+superformparam = []
 def check_contains(cl,name , print_value = False):
     dir_class = dir(cl)
     for el in dir_class:
@@ -17,9 +22,10 @@
     print("\ncheck_contains finished\n\n")
     
 def generate(context):
-    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
+    global superformparam
+#    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
 
     chosen_type = get_chosen_type(context)
     print("\n***INFO*** geodesic_259 generate*** type chosen = ", chosen_type)
@@ -228,3 +234,192 @@
     else:
         geo_orientation = "FaceUp"
     return (geo_type,geo_orientation)
+
+from bpy.props import EnumProperty, IntProperty, FloatProperty, StringProperty, BoolProperty
+
+class AddTorus(bpy.types.Operator):
+    bl_idname = "mesh.add_pkhgtorus"
+    bl_label = "PKHG Torus"
+    bl_options = {'REGISTER','UNDO'}
+    torus_uresolution = IntProperty(name = 'uresolution', min = 2, soft_min = 4, soft_max = 24, max = 36, default =  12) #PKHG 23 oct needed for torus
+    torus_vresolution = IntProperty(name = 'vresolution', min = 2, soft_min = 4, soft_max = 24, max = 36, default =  12) 
+    torus_uscale = FloatProperty(name = 'small radius', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default = .25)   #seams to be scaling from center in r direction
+    torus_vscale = FloatProperty(name = 'big radius', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)    #expand and shift get factor vscale
+    torus_upart = FloatProperty(name = 'upart(gap)', min = -4, soft_min = 0, soft_max = 1 ,max = 4, default =  1)  #PKHG default no u-gap
+    torus_vpart = FloatProperty(name = 'vpart(gap)', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  1)  #PKHG defalut: no v-gap
+    torus_uphase = FloatProperty(name = 'uphase', min = -4, soft_min = 0, soft_max = 1 ,max = 4, default =  1) 
+    torus_vphase = FloatProperty(name = 'vphase', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  1) 
+    torus_utwist = FloatProperty(name = 'utwist', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  0) 
+    torus_vtwist = FloatProperty(name = 'vtwist', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  0) 
+    torus_xscale = FloatProperty(name = 'xscale', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)  #scale in x direction
+    torus_yscale = FloatProperty(name = 'yscale', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)  #scale in z direction not y ?! the heigth so to say
+    
+    def execute(self,context):
+        global superformparam
+        torus = forms_259.torus(self.torus_uresolution,self.torus_vresolution,self.torus_uscale,self.torus_vscale,self.torus_upart,self.torus_vpart,self.torus_uphase,self.torus_vphase,self.torus_utwist,self.torus_vtwist,self.torus_xscale,self.torus_yscale,superformparam)
+        add_object(torus)
+        return {'FINISHED'}
+    
+def torus_menu_func(self, context):
+    self.layout.operator(AddTorus.bl_idname, icon='MESH_CUBE')
+
+class AddCylinder(bpy.types.Operator):
+    bl_idname = "mesh.add_pkhgcylinder"
+    bl_label = "PKHG Cylinder"
+    bl_options = {'REGISTER','UNDO'}
+    cylinder_uresolution = IntProperty(name = 'uresolution', min = 2, soft_min = 4, soft_max=24, max = 36, default =  12) #PKHG 23 oct needed for cylinder
+    cylinder_vresolution = IntProperty(name = 'vresolution', min = 2, soft_max=5, max = 10, default =  4) 
+    cylinder_uscale = FloatProperty(name = 'radius', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)   #seams to be scaling from center in r direction
+    cylinder_vscale = FloatProperty(name = 'height', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)    #expand and shift get factor vscale
+    cylinder_upart = FloatProperty(name = 'upart(gap)', min = -4, soft_min = 0, soft_max = 1 ,max = 4, default =  1)  #PKHG default no u-gap
+    cylinder_vpart = FloatProperty(name = 'vpart(gap)', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  1)  #PKHG defalut: no v-gap
+    cylinder_uphase = FloatProperty(name = 'uphase', min = -4, soft_min = 0, soft_max = 1 ,max = 4, default =  1) 
+    cylinder_vphase = FloatProperty(name = 'vphase', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  1) 
+    cylinder_utwist = FloatProperty(name = 'utwist', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  0) 
+    cylinder_vtwist = FloatProperty(name = 'vtwist', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  0) 
+    cylinder_xscale = FloatProperty(name = 'xscale', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)  #scale in x direction
+    cylinder_yscale = FloatProperty(name = 'yscale', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)  #scale in z direction not y ?! the heigth so to say
+
+    def execute(self,context):
+        global superformparam
+        cylinder = forms_259.cylinder(self.cylinder_uresolution,self.cylinder_vresolution,self.cylinder_uscale,self.cylinder_vscale,self.cylinder_upart,self.cylinder_vpart,self.cylinder_uphase,self.cylinder_vphase,self.cylinder_utwist,self.cylinder_vtwist,self.cylinder_xscale,self.cylinder_yscale,superformparam)
+        add_object(cylinder)
+        return {'FINISHED'}
+
+    
+def cylinder_menu_func(self, context):
+    self.layout.operator(AddCylinder.bl_idname, icon='MESH_CUBE')
+
+class AddParabola(bpy.types.Operator):
+    bl_idname = "mesh.add_pkhgparabola"
+    bl_label = "PKHG Parabola"
+    bl_options = {'REGISTER','UNDO'}
+    parabola_uresolution = IntProperty(name = 'uresolution', min = 2, soft_min = 4, soft_max = 24, max = 36, default =  12) #PKHG 23 oct needed for parabola
+    parabola_vresolution = IntProperty(name = 'vresolution', min = 2, soft_max = 12, max = 24, default =  6) 
+    parabola_uscale = FloatProperty(name = 'radius', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)   #seams to be scaling from center in r direction
+    parabola_vscale = FloatProperty(name = 'height', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  2)    #expand and shift get factor vscale
+    parabola_upart = FloatProperty(name = 'upart(gap)', min = -4, soft_min = 0, soft_max = 1 ,max = 4, default =  1)  #PKHG default no u-gap
+    parabola_vpart = FloatProperty(name = 'vpart(gap)', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  1)  #PKHG defalut: no v-gap
+    parabola_uphase = FloatProperty(name = 'uphase', min = -4, soft_min = 0, soft_max = 1 ,max = 4, default =  0) 
+    parabola_vphase = FloatProperty(name = 'vphase', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  0) 
+    parabola_utwist = FloatProperty(name = 'utwist', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  0) 
+    parabola_vtwist = FloatProperty(name = 'vtwist', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  0) 
+    parabola_xscale = FloatProperty(name = 'xscale', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)  #scale in x direction
+    parabola_yscale = FloatProperty(name = 'yscale', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)  #scale in z direction not y ?! the heigth so to say
+    
+    def execute(self,context):
+        global superformparam
+        parabola = forms_259.parabola(self.parabola_uresolution,self.parabola_vresolution,self.parabola_uscale,self.parabola_vscale,self.parabola_upart,self.parabola_vpart,self.parabola_uphase,self.parabola_vphase,self.parabola_utwist,self.parabola_vtwist,self.parabola_xscale,self.parabola_yscale,superformparam)
+        add_object(parabola)
+        return {'FINISHED'}
+    
+def parabola_menu_func(self, context):
+    self.layout.operator(AddParabola.bl_idname, icon='MESH_CUBE')
+
+
+#Sphere
+
+class AddSphere(bpy.types.Operator):
+    bl_idname = "mesh.add_pkhgsphere"
+    bl_label = "PKHG Sphere"
+    bl_options = {'REGISTER','UNDO'}
+    sphere_uresolution = IntProperty(name = 'uresolution', min = 2, soft_min = 4, soft_max = 24, max = 36, default =  12) #PKHG 23 oct needed for sphere
+    sphere_vresolution = IntProperty(name = 'vresolution', min = 2, soft_max = 12, max = 24, default =  6) 
+    sphere_uscale = FloatProperty(name = 'radius', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)   #seams to be scaling from center in r direction
+    sphere_vscale = FloatProperty(name = 'height', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  2)    #expand and shift get factor vscale
+    sphere_upart = FloatProperty(name = 'upart(gap)', min = -4, soft_min = 0, soft_max = 1 ,max = 4, default =  1)  #PKHG default no u-gap
+    sphere_vpart = FloatProperty(name = 'vpart(gap)', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  1)  #PKHG defalut: no v-gap
+    sphere_uphase = FloatProperty(name = 'uphase', min = -4, soft_min = 0, soft_max = 1 ,max = 4, default =  0) 
+    sphere_vphase = FloatProperty(name = 'vphase', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  0) 
+    sphere_utwist = FloatProperty(name = 'utwist', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  0) 
+    sphere_vtwist = FloatProperty(name = 'vtwist', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  0) 
+    sphere_xscale = FloatProperty(name = 'xscale', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)  #scale in x direction
+    sphere_yscale = FloatProperty(name = 'yscale', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)  #scale in z direction not y ?! the heigth so to say
+    
+    def execute(self,context):
+        global superformparam

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-extensions-cvs mailing list