[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2524] branches/geodesic_domes/ geodesic_259.py: basic working version 0.3
Peter K.H. Gragert
pkhgragert at gmail.com
Tue Oct 25 17:29:20 CEST 2011
Revision: 2524
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2524
Author: pkhg
Date: 2011-10-25 15:29:20 +0000 (Tue, 25 Oct 2011)
Log Message:
-----------
basic working version 0.3
Modified Paths:
--------------
branches/geodesic_domes/geodesic_259.py
Modified: branches/geodesic_domes/geodesic_259.py
===================================================================
--- branches/geodesic_domes/geodesic_259.py 2011-10-25 15:28:41 UTC (rev 2523)
+++ branches/geodesic_domes/geodesic_259.py 2011-10-25 15:29:20 UTC (rev 2524)
@@ -1,6 +1,5 @@
#v 0.3
###TODO a reset necessary!
-
import math
import bpy
@@ -21,11 +20,7 @@
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
@@ -46,13 +41,11 @@
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("***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
@@ -61,10 +54,7 @@
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()
+ parameters=[frequency, eccentricity, squish, radius, squareness,squarez,0,0,0,0,0,0,0,1,superformparam]
if which_geodesic == 'Tetrahedron':
if which_orientation == "PointUp":
new_geodesic = geodesic_classes_259.tetrahedron(parameters)
@@ -96,34 +86,68 @@
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' or chosen_type == 'Cylinder' \
-# or chosen_type == 'Parabola' or chosen_type == '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
- vscale = context.scene.formobs_vscale #expand and shift get factor vscale
- upart = context.scene.formobs_upart #gap?
- vpart = context.scene.formobs_vpart #defines gaps?!
- uphase = context.scene.formobs_uphase
- vphase = context.scene.formobs_vphase
- utwist = context.scene.formobs_utwist
- vtwist = context.scene.formobs_vtwist
- xscale = context.scene.formobs_xscale #scale in x direction
- yscale = context.scene.formobs_yscale #scale in z direction not y ?! the heigth so to say
- if chosen_type == 'Sphere':
- sphere=forms_259.sphere(uresolution,vresolution,uscale,vscale,upart,vpart,uphase,vphase,utwist,vtwist,xscale,yscale,superformparam)
- vefm_259.vefm_add_object(sphere)
- elif chosen_type == 'Cylinder':
- cylinder = forms_259.cylinder(uresolution,vresolution,uscale,vscale,upart,vpart,uphase,vphase,utwist,vtwist,xscale,yscale,superformparam)
- vefm_259.vefm_add_object(cylinder)
- elif chosen_type == 'Parabola':
- parabola = forms_259.parabola(uresolution,vresolution,uscale,vscale,upart,vpart,uphase,vphase,utwist,vtwist,xscale,yscale,superformparam)
- vefm_259.vefm_add_object(parabola)
- elif chosen_type == 'Torus':
- torus = forms_259.parabola(uresolution,vresolution,uscale,vscale,upart,vpart,uphase,vphase,utwist,vtwist,xscale,yscale,superformparam)
- vefm_259.vefm_add_object(torus)
-
+ elif chosen_type == 'Sphere':
+ uresolution = context.scene.sphere_uresolution #number of lines N-S (u coordinate)
+ vresolution = context.scene.sphere_vresolution #number of lines O-W (v cordinate)
+ uscale = context.scene.sphere_uscale #seams to be scaling from center in r direction
+ vscale = context.scene.sphere_vscale #expand and shift get factor vscale
+ upart = context.scene.sphere_upart # only at side
+ vpart = context.scene.sphere_vpart # only at side
+ uphase = context.scene.sphere_uphase
+ vphase = context.scene.sphere_vphase #default
+ utwist = context.scene.sphere_utwist
+ vtwist = context.scene.sphere_vtwist
+ xscale = context.scene.sphere_xscale #seams to be scaling from center in r direction
+ yscale = context.scene.sphere_yscale #expand and shift get factor vscale
+ if upart == 0 or vpart == 0:
+ print("\n***Info*** xgap and/or ygap should not be zeor, singular type")
+ sphere=forms_259.sphere(uresolution,vresolution,uscale,vscale,upart,vpart,uphase,vphase,utwist,vtwist,xscale,yscale,superformparam)
+ vefm_259.vefm_add_object(sphere)
+ elif chosen_type == 'Cylinder':
+ uresolution = context.scene.cylinder_uresolution #number of lines N-S (u coordinate)
+ vresolution = context.scene.cylinder_vresolution #number of lines O-W (v cordinate)
+ uscale = context.scene.cylinder_uscale #seams to be scaling from center in r direction
+ vscale = context.scene.cylinder_vscale #expand and shift get factor vscale
+ upart = context.scene.cylinder_upart # only at side
+ vpart = context.scene.cylinder_vpart # only at side
+ uphase = context.scene.cylinder_uphase
+ vphase = context.scene.cylinder_vphase #default
+ utwist = context.scene.cylinder_utwist
+ vtwist = context.scene.cylinder_vtwist
+ xscale = context.scene.cylinder_xscale #seams to be scaling from center in r direction
+ yscale = context.scene.cylinder_yscale #expand and shift get factor vscale
+ cylinder = forms_259.cylinder(uresolution,vresolution,uscale,vscale,upart,vpart,uphase,vphase,utwist,vtwist,xscale,yscale,superformparam)
+ vefm_259.vefm_add_object(cylinder)
+ elif chosen_type == 'Parabola':
+ uresolution = context.scene.parabola_uresolution #number of lines N-S (u coordinate)
+ vresolution = context.scene.parabola_vresolution #number of lines O-W (v cordinate)
+ uscale = context.scene.parabola_uscale #seams to be scaling from center in r direction
+ vscale = context.scene.parabola_vscale #expand and shift get factor vscale
+ upart = context.scene.parabola_upart # only at side
+ vpart = context.scene.parabola_vpart # only at side
+ uphase = context.scene.parabola_uphase
+ vphase = context.scene.parabola_vphase #default
+ utwist = context.scene.parabola_utwist
+ vtwist = context.scene.parabola_vtwist
+ xscale = context.scene.parabola_xscale #seams to be scaling from center in r direction
+ yscale = context.scene.parabola_yscale #expand and shift get factor vscale
+ parabola = forms_259.parabola(uresolution,vresolution,uscale,vscale,upart,vpart,uphase,vphase,utwist,vtwist,xscale,yscale,superformparam)
+ vefm_259.vefm_add_object(parabola)
+ elif chosen_type == 'Torus':
+ uresolution = context.scene.torus_uresolution #old ures
+ vresolution = context.scene.torus_vresolution #old vres
+ uscale = context.scene.torus_uscale #old vrad
+ vscale = context.scene.torus_vscale #old urad
+ upart = context.scene.torus_upart #old upart
+ vpart = context.scene.torus_vpart #old vpart
+ uphase = context.scene.torus_uphase #old ugap
+ vphase = context.scene.torus_vphase #old vgap
+ utwist = 0 #context.scene.torus_utwist #old 0
+ vtwist = 0 #context.scene.torus_vtwist #old 0
+ xscale = context.scene.torus_xscale #old uellipse
+ yscale = context.scene.torus_yscale #old vellipse
+ torus = forms_259.torus(uresolution,vresolution,uscale,vscale,upart,vpart,uphase,vphase,utwist,vtwist,xscale,yscale,superformparam)
+ vefm_259.vefm_add_object(torus)
return {'FINISHED'}
def get_chosen_type(context):
@@ -138,6 +162,7 @@
result = posible_types[chosen_type]
return result
+'''
def get_parameter_of_chosen_type(chosen_type):
#parameter = [(0,)*14]
result = [(0,)*14]
@@ -177,6 +202,7 @@
parameters[12] = 0 #TODOscene.geodesic_rotz
parameters[13] = 0 #TODO scene.geodesic_klass
parameters[14] = [] #TODO scene.geodesic_sform
+'''
#TODO self.super = 0 ## Toggles superellipse.
#TODO if self.square != 2.0 or self.squarez != 2.0:
@@ -184,7 +210,6 @@
#TODO self.odd = 0 ## Is the frequency odd. It matters for dome building.
#TODO if self.geodesic_frequency % 2 != 0:
#TODO self.odd = 1
- return result
def get_geodesic_special():
get_scene = bpy.context.scene
More information about the Bf-extensions-cvs
mailing list