Bonsak Schieldrop

bonsak

About Me

Expertise
Generalist
Location
Norway

Connect

Recent Forum Posts

how can initialize an array of arrays in vex? Jan. 7, 2019, 2:56 a.m.

Not in vex put in python.
mydict = {}
mydict[0] = [1,2,3,4,5,6,7,8,9]
print mydict[0][0]
1
Or with a list of lists:
mylist = []
mylist.append([1,2,3,4,5,6,7,8,9])
print mylist[0][0]
1
Its still not true arrays though.

Regards
Bonsak

how can initialize an array of arrays in vex? Jan. 6, 2019, 6:39 a.m.

You could hack it by using a matrix data type as your inner array:
matrix outsidearray[];
matrix insidearray = set(0,1,2,3,4,5,6,7,8);

for(int i; i < 10; i++){
    append(outsidearray, insidearray);
}

//float component = getcomp(outsidearray[0],0,0);
printf('%g', outsidearray);

But you will not get array functionality in the inner array.

Regards
Bonsak

The SOP Geometry DOP pulls geometry from a SOP for use in a DOP simulation. - translate into English? Jan. 3, 2019, 5:20 p.m.