Clear [i];

(*rotaties*)
rot90[xy_]:=(({{Cos[(π/2)], -Sin[(π/2)]}, {Sin[(π/2)], Cos[(π/2)]}})).xy;
Rot90[xylist_]:=rot90 /@xylist;
ROT90[xylistlist_]:=Rot90 /@xylistlist;

(*Heesch type CC4C4*)
ptA = {5,5};
ptB = {0,10};
ptC = {0,0};
ptM = (ptC+ptB)/2;;

(* main lines for cutting *)
lineCA = {{0,0},{1,2}, {1.6,2.4}, {2.6,2.4}, {3.2,3} ,{3.2,3.4},{3,4},          {3.6,4.3},{3.7,5},{4.4,4.7}, {5,5}};
lineCM = {{0,0},{-0.2,2.2}, {-0.7,2.8}, {-1.6,3.1},{-2,3.9},{-1.5,5.1},{-0.8,5.4},{-0.4,5.4},{0,5}};
divide = {{3,4},{2.4,4.8},{1.48,4.9}}; 

(*elefant - gravure*)
enoseline1={{0,2},{0.75,1.85}};
enoseline2={{0.55,1.48},{0,1.6}};
enoseline3={{0,1.2},{0.4,1.1}};
eeye1={{0.85,2.4},{0.825,2.425},{0.8,2.45},{0.775,2.425},{0.75,2.4},{0.775,2.375},{0.8,2.35},{0.825,2.375},{0.85,2.4}};
eeye2={{0.1,2.6},{0.3,2.6}};
eyebrow = {{0.7,2.6},{0.85,2.62},{0.95,2.5}};
ear1 = {{-0.6,3.2},{-1.4,3.4},{-1.6,4},{-0.8,5},{0,4.4}};
ear2 = {{1.2,4.2}, {2,4.4},{2.8,3.6},{2.4,2.8},{2,2.8}};
(*dino gravure*)
been={{2.4,4.8},{2.8,5.8}};
stekel={{3.4,6.8},{4.3,6.4}};
mond={{0.05,9.4},{1.2,8.7},{1.2,8.2},{0.2,8}};
oog={{1.3,9},{1.35,9.05},{1.4,9.1},{1.35,9.15},{1.3,9.2},{1.25,9.15},{1.2,9.1},{1.25,9.05},{1.3,9}};
tand1={{1.2,8.45},{0.12,8.6}};
tand2={{0.4,9.15},{0.45,8.1}};
tand3 = {{0.8,8.9},{0.85,8.2}};

cutting = {lineCA, lineCM,divide};
gravure ={enoseline1, enoseline2,enoseline3,eeye1, eeye2, eyebrow,ear1, ear2, been, stekel,mond,oog,tand1,tand2,tand3};


(*Translations *)
transOC[xy_]:= xy + ptA;
TransOC[xylist_]:=transOC /@ xylist; 
TRANSOC[xylistlist_]:=TransOC /@ xylistlist;

transCO[xy_]:= xy - ptA;
TransCO[xylist_]:=transCO /@ xylist; 
TRANSCO[xylistlist_]:=TransCO /@ xylistlist;

trans1[xy_]:=xy+{10,0};
Trans1[xylist_]:=trans1 /@ xylist;
TRANS1[xylistlist_]:= Trans1 /@ xylistlist;

trans2[xy_]:=xy+{0,10};
Trans2[xylist_]:=trans2 /@ xylist;
TRANS2[xylistlist_]:= Trans2 /@ xylistlist;

(*figuur creation*)
ROT90B[xylistlist_]:=TRANSOC[ROT90[TRANSCO[xylistlist]]];
z=3;
Drawing1:= Table[Line[ Nest[TRANS2,Nest[TRANS1 ,Nest[ROT90B,gravure,i],j],k]],{i,0,3}, {j,0,z},{k,0,z}];
Drawing2:= Table[Line[ Nest[TRANS2,Nest[TRANS1 ,Nest[ROT90B,cutting,i],j],k]],{i,0,3}, {j,0,z},{k,0,z}];
G:=Graphics[{Black, Drawing1, Red, Drawing2}];
Show[G]
Export["Try1.eps",G]