def cubefrac(a,b,c,w,n,div):
i=0
liste=[[w/2,w/2,0], [w/2,-w/2,0], [-w/2,w/2,0], [-w/2,-w/2,0], [0,w/2,w/2], [0,w/2,-w/2], [0,-w/2,w/2], [0,-w/2,-w/2], [w/2,0,w/2], [w/2,0,-w/2], [-w/2,0,+w/2], [-w/2,0,-w/2]]
if n==0:
print""
else:
for i in range(len(liste)):
x, y, z =a+liste[i][0], b+liste[i][1], c+liste[i][2]
print "polyCube -w", w/div, "-h", w/div, "-d", w/div,"-sx 1 -sy 1 -sz 1 -ax 0 1 0 -cuv 4 -ch 1;"
print "move -r -os -wd", x, y, z,";"
cubefrac(x,y,z,w/div,n-1,div)
cubefrac(0,0,0,10.0,4,2.9198)
print "polyCube -w", 10, "-h", 10, "-d", 10,"-sx 1 -sy 1 -sz 1 -ax 0 1 0 -cuv 4 -ch 1;"
curve -d 1 -p 0 0 0 -p 1 0 0 -k 0 -k 1 ;
duplicate -rr;
move -r -os -wd 1 0 0 ;
rotate -r -ws 0 0 60 ;
duplicate -rr;
move -r -os -wd 1 0 0 ;
rotate -r -ws 0 0 60 ;
duplicate -rr;
move -r -os -wd 1 0 0 ;
rotate -r -ws 0 0 60 ;
duplicate -rr;
move -r -os -wd 1 0 0 ;
rotate -r -ws 0 0 60 ;
duplicate -rr;
move -r -os -wd 1 0 0 ;
rotate -r -ws 0 0 60 ;
duplicate -rr;
move -r -os -wd 1 0 0 ;
rotate -r -ws 0 0 60 ;
duplicate -rr;
move -r -os -wd 1 0 0 ;
rotate -r -ws 0 0 -120 ;
duplicate -rr;
move -r -os -wd 1 0 0 ;
rotate -r -ws 0 0 60 ;
duplicate -rr;
move -r -os -wd 1 0 0 ;
rotate -r -ws 0 0 -120 ;
duplicate -rr;
move -r -os -wd 1 0 0 ;
rotate -r -ws 0 0 60 ;
duplicate -rr;
move -r -os -wd 1 0 0 ;
rotate -r -ws 0 0 60 ;
select -r curve1 curve2 curve3 curve4 ;
group; xform -os -piv 0 0 0;
duplicate -rr;
move -r 3 0 0;
rotate -r -ws 0 0 60 ;
duplicate -rr; scale -r 1 -1 1;
rotate -r -ws 0 0 60 ;
move -r 3 0 0 ;
duplicate -rr; scale -r 1 1 1;
rotate -r -ws 0 0 60 ;
move -r 3 0 0 ;
select -r group1 group2 group3 group4 ;
group; xform -os -piv 0 0 0;
duplicate -rr;
move -r 9 0 0;
rotate -r -ws 0 0 60 ;
duplicate -rr; scale -r 1 -1 1;
rotate -r -ws 0 0 60 ;
move -r 9 0 0 ;
duplicate -rr; scale -r 1 1 1;
rotate -r -ws 0 0 60 ;
move -r 9 0 0 ;
select -r group5 group6 group7 group8 ;
group; xform -os -piv 0 0 0;
duplicate -rr;
move -r 27 0 0;
rotate -r -ws 0 0 60 ;
duplicate -rr; scale -r 1 -1 1;
rotate -r -ws 0 0 60 ;
move -r 27 0 0 ;
duplicate -rr; scale -r 1 1 1;
rotate -r -ws 0 0 60 ;
move -r 27 0 0 ;