[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2461] branches/geodesic_domes/ start_geodesic_dome_259.py: The start of the all in 2. 49 is very strange this

Peter K.H. Gragert pkhgragert at gmail.com
Sun Oct 16 17:45:12 CEST 2011


Revision: 2461
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2461
Author:   pkhg
Date:     2011-10-16 15:45:12 +0000 (Sun, 16 Oct 2011)
Log Message:
-----------
The start of the all in 2.49 is very strange   this
is a conversion to 2.59 with all basic objects tested

Have to investigate what the superformparameter really means ..

Added Paths:
-----------
    branches/geodesic_domes/start_geodesic_dome_259.py

Added: branches/geodesic_domes/start_geodesic_dome_259.py
===================================================================
--- branches/geodesic_domes/start_geodesic_dome_259.py	                        (rev 0)
+++ branches/geodesic_domes/start_geodesic_dome_259.py	2011-10-16 15:45:12 UTC (rev 2461)
@@ -0,0 +1,1391 @@
+import bpy
+import sys
+#!!!!!!!!!!!!!!!!!!adjust this path to your settings
+sys.path.append("c:\\Users\\Peter\\25blender\\branches\\geodesic_domes")
+#sys.path.append("c:/BlenderSVN/cmake_all3/bin/2.59/scripts/addons/geodesic_domes")
+import math
+#???PKHG import goo
+import geodesic_classes_259
+from geodesic_classes_259 import *
+import forms_259
+from forms_259 import *
+try:
+    import psyco
+    psyco.full
+    print("psyco in use")
+except:
+    print("Psyco Failed, will run slowly :( ")
+    
+import vefm_259
+from vefm_259 import mesh,average,facetype,strut,hub,importmesh
+
+pi2=2*math.pi
+
+mousex=1
+mousey=1
+
+rounded=[1,1,1,1]
+
+mainpageid = 3 # Draw.Create( #Draw.Create give a button  int float string or 3 floats
+
+subpageid = 0 # Draw.Create(
+pageflag = 4 # Draw.Create(
+idtrack=[0,0]
+
+impmesh = 0 # Draw.Create(
+outputmeshname = "defaultimport" # Draw.Create(
+
+##   Geodesic controls
+polytype = 1 # Draw.Create(
+shape = 0 # Draw.Create(
+orientation = 0 # Draw.Create(
+faceshape = 0 # Draw.Create(
+
+klass = 0 # Draw.Create(
+
+class1 = 1 # Draw.Create(
+class2 = 0 # Draw.Create(
+
+tetra = 0 # Draw.Create(
+octa = 1 # Draw.Create(
+ico = 0 # Draw.Create(
+
+point = 1 # Draw.Create(
+edge = 0 # Draw.Create(
+face = 0 # Draw.Create(
+
+sphere = 1 # Draw.Create(
+dome = 0 # Draw.Create(
+other = 0 # Draw.Create(
+
+tri = 1 # Draw.Create(
+hexa = 0 # Draw.Create(
+star = 0 # Draw.Create(
+
+dual = 0 # Draw.Create(
+cart = 0 # Draw.Create(
+
+frequency =  2 #Draw.Create(2)
+baselevel = 5  # Draw.Create(
+radius = 1.0 # Draw.Create(
+eccentricity = 1.0 # Draw.Create(
+squish = 1.0 # Draw.Create(
+
+squareness = 2.0 # Draw.Create(
+squarez = 2.0 # Draw.Create(
+
+rotxy = 0.0 # Draw.Create(
+rotz = 0.0 # Draw.Create(
+
+#PKHG TODO which parameters are neede?
+parameters=[    frequency,eccentricity,squish,
+        radius,squareness,squarez,
+        cart,shape,baselevel,dual,rotxy,rotz,klass,faceshape,[]]
+
+##   Grid controls
+grxres = 5 # Draw.Create(
+gryres = 5 # Draw.Create(
+grxsz = 1.0 # Draw.Create(
+grysz = 1.0    # Draw.Create(
+            
+##   cylinder controls
+cyxres = 5 # Draw.Create(
+cyyres = 5 # Draw.Create(
+cyxsz = 1.0 # Draw.Create(
+cyysz = 1.0    # Draw.Create(
+cyxell = 1.0 # Draw.Create(
+cygap = 1.0 # Draw.Create(
+cygphase = 0.0 # Draw.Create(
+
+##   Parabola controls
+paxres = 5 # Draw.Create(
+payres = 5 # Draw.Create(
+paxsz = 0.30 # Draw.Create(
+paysz = 1.0 # Draw.Create(
+paxell = 1.0 # Draw.Create(
+pagap = 1.0 # Draw.Create(
+pagphase = 0.0 # Draw.Create(
+            
+##   Torus controls
+ures = 8 # Draw.Create(
+vres = 8 # Draw.Create(
+urad = 1.0 # Draw.Create(
+vrad = 0.250 # Draw.Create(
+uellipse = 1.0 # Draw.Create(
+vellipse = 1.0 # Draw.Create(
+upart = 1.0 # Draw.Create(
+vpart = 1.0 # Draw.Create(
+ugap = 0.0 # Draw.Create(
+vgap = 0.0 # Draw.Create(
+uphase = 0.0 # Draw.Create(
+vphase = 0.0 # Draw.Create(
+uexp = 0 # Draw.Create(
+vexp = 0 # Draw.Create(
+usuper = 2.00 # Draw.Create(
+vsuper = 2.00 # Draw.Create(
+usupertwist = 0.0 # Draw.Create(
+vsupertwist = 0.0 # Draw.Create(
+
+##   Sphere controls
+bradius = 1.0 # Draw.Create(
+bures = 8 # Draw.Create(
+bvres = 8 # Draw.Create(
+burad = 1.0 # Draw.Create(
+bupart = 1.0 # Draw.Create(
+bvpart = 1.0 # Draw.Create(
+buphase = 0.0 # Draw.Create(
+bvphase = 0.0 # Draw.Create(
+buellipse = 1.0 # Draw.Create(
+bvellipse = 1.0 # Draw.Create(
+
+            
+##   Superformula controls
+um = 3 # Draw.Create(
+un1 = 10.0 # Draw.Create(
+un2 = 10.0 # Draw.Create(
+un3 = 10.0 # Draw.Create(
+ua = 1.0 # Draw.Create(
+ub = 1.0 # Draw.Create(
+vm = 4 # Draw.Create(
+vn1 = 10.0 # Draw.Create(
+vn2 = 10.0 # Draw.Create(
+vn3 = 10.0 # Draw.Create(
+va = 1.0 # Draw.Create(
+vb = 1.0 # Draw.Create(
+uact = 0 # Draw.Create(
+vact = 0 # Draw.Create(
+uturn = 0.0 # Draw.Create(
+vturn = 0.0 # Draw.Create(
+utwist = 0.0 # Draw.Create(
+vtwist = 0.0 # Draw.Create(
+
+arbimptog = 0 # Draw.Create(
+arbimpstring = "None" # Draw.Create(
+select = "" # Draw.Create(
+
+facetypes = 0 # Draw.Create(
+facetoggle = 0 # Draw.Create(
+faceimporttoggle = 0 # Draw.Create(
+faceimportstring = "None" # Draw.Create(
+facewidth = .50 # Draw.Create(
+fwtog = 0 # Draw.Create(
+faceheight = 1.0 # Draw.Create(
+fhtog = 0 # Draw.Create(
+detatch = 0 # Draw.Create(
+fmeshname = "defaultface" # Draw.Create(
+    
+struttype = 0 # Draw.Create(
+struttoggle = 0 # Draw.Create(
+strutimporttoggle = 0 # Draw.Create(
+strutimpmesh = "None" # Draw.Create(
+strutwidth = 1.0 # Draw.Create(
+swtog = 0 # Draw.Create(
+strutheight = 1.0 # Draw.Create(
+shtog = 0 # Draw.Create(
+strutshrink = 1.0 # Draw.Create(
+sstog = 0 # Draw.Create(
+stretch = 0 # Draw.Create(
+lift = 0.0 # Draw.Create(
+smeshname = "defaultstrut" # Draw.Create(
+
+
+hubtype = 0 # Draw.Create(
+hubtoggle = 0 # Draw.Create(
+hubimporttoggle = 0 # Draw.Create(
+hubimpmesh = "None" # Draw.Create(
+hubwidth = 1.0 # Draw.Create(
+hwtog = 0 # Draw.Create(
+hubheight = 1.0 # Draw.Create(
+hhtog = 0 # Draw.Create(
+hublength = 1.0 # Draw.Create(
+hstog = 0 # Draw.Create(
+hmeshname = "defaulthub" # Draw.Create(
+
+
+background=[0.7,0.7,0.7,0.0]
+border=[0.0,0.0,0.0]
+lowpane=[0.65,0.65,0.55]
+black=[0.0,0.0,0.0]
+
+maincol=[0.7,0.8,0.7]
+formcol=[0.90,0.9,0.50]
+facecol=[0.50,0.65,0.75]
+strutcol=[0.50,0.60,0.7]
+hubcol=[0.50,0.55,0.65]
+helpcol=[0.59,0.59,0.59]
+
+form1col=[0.8,0.7,0.6]
+form2col=[0.70,0.60,0.5]
+
+green0=[0.65,0.75,0.65]
+green1=[0.6,0.7,0.6]
+green2=[0.55,0.65,0.55]
+green3=[0.5,0.6,0.5]
+green4=[0.45,0.55,0.45]
+green5=[0.40,0.50,0.40]    
+green6=[0.35,0.45,0.35]
+green7=[0.30,0.40,0.30]
+palegreen=[0.7,0.9,0.7]    
+
+
+
+maintitles=["Main","Formula","Faces","Struts","Hubs","Help"]
+maincolours=[maincol,formcol,facecol,strutcol,hubcol,helpcol]
+#mainpageid=Draw.Create(5)
+mainpageid = 5
+subtitles=["Geodesic","Grid","Cylinder","Parabola","Torus","Ball","Your Mesh"]
+subcolours=[green0,green1,green2,green3,green4,green5,green6,green7]
+formulatitles=["Formula 1","Formula 2"]
+formulacolours=[form1col,form2col]
+#formulapageid=Draw.Create(0)
+formulapageid = 0
+
+#maintabs=goo.tabs( 6, maintitles, maincolours, border, black, mainpageid)
+#subtabs=goo.tabs(7, subtitles, subcolours, border, black, subpageid)
+#formulatabs=goo.tabs(2,formulatitles,formulacolours,border,black,formulapageid)
+
+def creat_tetra_octa_icosa(polytype,orientation,parameters):
+
+#    print("\n======start_geodesic_dome_259 L248=========\ncreat_tetra_octa_icosa called\nparametervalues are\n",polytype,orientation,parameters)
+    basegeo  = geodesic_classes_259.geodesic(vefm_259.mesh)
+#    print("\n======start_geodesic_dome_259 L251\n len basegio.verts", len(basegeo.verts))
+#    geo = geodesic_classes_259.tetrahedron(basegeo)
+#    return geo
+    
+    if polytype==0:
+
+        if orientation == 0:
+            geo = geodesic_classes_259.tetrahedron(basegeo)
+        #    geo=geodesic.tetrahedron(parameters)
+
+            return geo
+
+        elif orientation==1:
+
+            geo=geodesic_classes_259.tetraedge(basegeo)
+
+            return geo
+
+        elif orientation==2:
+
+            geo=geodesic_classes_259.tetraface(basegeo)
+
+            return geo
+
+    elif polytype==1:        # octahedron
+
+        if orientation==0:
+
+            geo=geodesic_classes_259.octahedron(basegeo)
+
+        elif orientation==1:
+
+            geo=geodesic_classes_259.octaedge(basegeo)
+
+        elif orientation==2:
+
+            geo=geodesic_classes_259.octaface(basegeo)
+        
+        return geo
+
+    elif polytype==2:    # icosahedron
+
+        if orientation==0:
+
+            geo=geodesic_classes_259.icosahedron(basegeo)
+
+        elif orientation==1:
+
+            geo=geodesic_classes_259.icoedge(basegeo)
+
+        elif orientation==2:
+
+            geo=geodesic_classes_259.icoface(basegeo)
+
+        return geo
+    
+
+def finalfill(source,target):
+    count=0
+    for point in source.verts:
+        newvert = vertex(point.vector)#NMesh.Vert(point.x,point.y,point.z)
+        target.verts.append(newvert)
+        point.index=count
+        count += 1
+    #PKHG the points of source are renumbered too
+    
+    for facey in source.faces:
+        row = len(facey.vertices)
+        #PKHG TODO ???
+        if row>=5:
+            newvert=average(facey.vertices).centroid()
+#            centre=NMesh.Vert(newvert.x,newvert.y,newvert.z)
+            centre=vertex(newvert.x,newvert.y,newvert.z)
+            target.verts.append(centre)
+            for i in range(row):
+#                f=NMesh.Face()
+#                f = []
+                if i == row-1:
+                    a=target.verts[facey.vertices[-1].index]
+                    b=target.verts[facey.vertices[0].index]
+                else:
+                    a=target.verts[facey.vertices[i].index]
+                    b=target.verts[facey.vertices[i+1].index]
+                c = centre
+#                f.v.append(a)
+#                f.v.append(b)
+#                f.v.append(c)
+                f = [a,b,c] #PKHG a nice tri of vertexes!
+                target.faces.append(f)
+        else:
+#            f=NMesh.Face()
+            f = [] #???PKHG
+            #use enumerate PKHG OPTIMIZE
+            for j in range(len(facey.vertices)):
+                a=facey.vertices[j]
+#                f.v.append(target.verts[a.index])
+                f.append(target.verts[a.index])
+            target.faces.append(f) #PKHG just a copy of a face 
+
+#???PKHG really needed???
+def edgefill(source,target):
+
+    count=0
+    for point in source.verts:
+
+#        newvert=NMesh.Vert(point.x,point.y,point.z)
+        newvert=vertex((point.x,point.y,point.z))
+        target.verts.append(newvert)
+        point.index = count
+        count += 1
+    
+    for edj in source.edges:
+
+
+#        f=NMesh.Face()
+        face = []
+
+#        f.v.append(target.verts[edj.a.index])
+#        f.v.append(target.verts[edj.b.index])
+        face.append([target.verts[edj.a.index],target.verts[edj.b.index]])
+#        target.faces.append(f)
+        target.faces.append(face)  #which is an edge?!
+
+def leveldraw():
+    
+    basegeodesic_259.docart()
+#    Blender.Redraw()
+
+def getselect():
+
+    global select

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-extensions-cvs mailing list