[colug-432] python arrays help

Vince Herried Vince at PlanetVince.com
Mon Dec 22 21:12:36 EST 2014


Thanks Matt.
your suggestion made blender happy.

I ended up using
    49          # create the vertices and edge loops for cosine
    50      for t in range (samples+1):
    51          x = sin(t) + 2*sin(2*t)
    52          y = cos(t) - 2*cos(2*t)
    53          z = -sin(3*t)
    54          #print("x=",x,"y=",y,"z=",z)
    55          v=[Vector(((x * scale_x), (y * scale_y), (z * scale_z)))]
    56          #print("length of v=",len(v))
    57          verts+=v
    58          if t>0:
    59                  edges+=[[t-1,t]]
    60


this sort of worked, well it created the vertices.
The edges it created,but not adjacent vertices are connected.
I have to try to figure out how they are referenced.
I added a print("tuple edges=",tuple(edges)) which generates:
tuple edges= ([0, 1], [1, 2], [2, 3], [3, 4],....



I tested a trivial sample where I deleted statments 58-60
and coded
edges=[[0,1]]
and it connected two vertices as if I had coded edges=[[0,5]]
studying blender python, i am.


Again thanks Matt.


More information about the colug-432 mailing list