5 Patch = (
int **)calloc(49,
sizeof(
int));
7 Patch[i] = (
int *)calloc(4*4,
sizeof(
int));
9 Patch[np][0 ] = 1;Patch[np][1 ] = 1;Patch[np][2 ] = 1;Patch[np][3 ] = 1;
10 Patch[np][4 ] = 1;Patch[np][5 ] = 1;Patch[np][6 ] = 1;Patch[np][7 ] = 1;
11 Patch[np][8 ] = 1;Patch[np][9 ] = 1;Patch[np][10] = 1;Patch[np][11] = 1;
12 Patch[np][12] = 1;Patch[np][13] = 1;Patch[np][14] = 1;Patch[np][15] = 1;
14 Mat->
Transform(Patch[np],Patch[0],4,OP_INVERT);
16 Patch[np][0 ] = 0;Patch[np][1 ] = 0;Patch[np][2 ] = 1;Patch[np][3 ] = 1;
17 Patch[np][4 ] = 0;Patch[np][5 ] = 0;Patch[np][6 ] = 1;Patch[np][7 ] = 1;
18 Patch[np][8 ] = 0;Patch[np][9 ] = 0;Patch[np][10] = 1;Patch[np][11] = 1;
19 Patch[np][12] = 0;Patch[np][13] = 0;Patch[np][14] = 1;Patch[np][15] = 1;
21 Mat->
Transform(Patch[np],Patch[2],4,OP_INVERT);
23 Mat->
Transform(Patch[np],Patch[2],4,OP_ROT_90);
25 Mat->
Transform(Patch[np],Patch[13],4,OP_INVERT);
27 Patch[np][0 ] = 1;Patch[np][1 ] = 1;Patch[np][2 ] = 1;Patch[np][3 ] = 0;
28 Patch[np][4 ] = 1;Patch[np][5 ] = 1;Patch[np][6 ] = 1;Patch[np][7 ] = 0;
29 Patch[np][8 ] = 1;Patch[np][9 ] = 1;Patch[np][10] = 1;Patch[np][11] = 0;
30 Patch[np][12] = 1;Patch[np][13] = 1;Patch[np][14] = 1;Patch[np][15] = 0;
32 Mat->
Transform(Patch[np],Patch[3],4,OP_MIRROR);
34 Mat->
Transform(Patch[np],Patch[3],4,OP_INVERT);
36 Mat->
Transform(Patch[np],Patch[6],4,OP_MIRROR);
38 Mat->
Transform(Patch[np],Patch[3],4,OP_ROT_90);
40 Mat->
Transform(Patch[np],Patch[8],4,OP_ROT_180);
42 Mat->
Transform(Patch[np],Patch[9],4,OP_INVERT);
44 Mat->
Transform(Patch[np],Patch[8],4,OP_INVERT);
46 Patch[np][0 ] = 0;Patch[np][1 ] = 0;Patch[np][2 ] = 0;Patch[np][3 ] = 0;
47 Patch[np][4 ] = 0;Patch[np][5 ] = 0;Patch[np][6 ] = 1;Patch[np][7 ] = 1;
48 Patch[np][8 ] = 1;Patch[np][9 ] = 1;Patch[np][10] = 1;Patch[np][11] = 1;
49 Patch[np][12] = 1;Patch[np][13] = 1;Patch[np][14] = 1;Patch[np][15] = 1;
51 Mat->
Transform(Patch[np],Patch[14],4,OP_MIRROR);
53 Mat->
Transform(Patch[np],Patch[16],4,OP_INVERT);
55 Mat->
Transform(Patch[np],Patch[14],4,OP_INVERT);
57 Mat->
Transform(Patch[np],Patch[21],4,OP_ROT_180);
59 Mat->
Transform(Patch[np],Patch[17],4,OP_MIRROR);
61 Mat->
Transform(Patch[np],Patch[20],4,OP_INVERT);
63 Mat->
Transform(Patch[np],Patch[18],4,OP_MIRROR);
65 Patch[np][0 ] = 0;Patch[np][1 ] = 1;Patch[np][2 ] = 1;Patch[np][3 ] = 0;
66 Patch[np][4 ] = 0;Patch[np][5 ] = 1;Patch[np][6 ] = 1;Patch[np][7 ] = 0;
67 Patch[np][8 ] = 0;Patch[np][9 ] = 1;Patch[np][10] = 1;Patch[np][11] = 0;
68 Patch[np][12] = 0;Patch[np][13] = 1;Patch[np][14] = 1;Patch[np][15] = 0;
70 Mat->
Transform(Patch[np],Patch[15],4,OP_INVERT);
72 Mat->
Transform(Patch[np],Patch[23],4,OP_ROT_90);
74 Mat->
Transform(Patch[np],Patch[15],4,OP_ROT_90);
76 Patch[np][0 ] = 1;Patch[np][1 ] = 0;Patch[np][2 ] = 1;Patch[np][3 ] = 1;
77 Patch[np][4 ] = 1;Patch[np][5 ] = 0;Patch[np][6 ] = 1;Patch[np][7 ] = 1;
78 Patch[np][8 ] = 1;Patch[np][9 ] = 0;Patch[np][10] = 1;Patch[np][11] = 1;
79 Patch[np][12] = 1;Patch[np][13] = 0;Patch[np][14] = 1;Patch[np][15] = 1;
81 Mat->
Transform(Patch[np],Patch[24],4,OP_MIRROR);
83 Mat->
Transform(Patch[np],Patch[24],4,OP_INVERT);
85 Mat->
Transform(Patch[np],Patch[26],4,OP_MIRROR);
87 Mat->
Transform(Patch[np],Patch[24],4,OP_ROT_90);
89 Mat->
Transform(Patch[np],Patch[28],4,OP_ROT_180);
91 Mat->
Transform(Patch[np],Patch[29],4,OP_INVERT);
93 Mat->
Transform(Patch[np],Patch[30],4,OP_ROT_180);
95 Patch[np][0 ] = 0;Patch[np][1 ] = 0;Patch[np][2 ] = 1;Patch[np][3 ] = 1;
96 Patch[np][4 ] = 0;Patch[np][5 ] = 0;Patch[np][6 ] = 1;Patch[np][7 ] = 1;
97 Patch[np][8 ] = 0;Patch[np][9 ] = 1;Patch[np][10] = 1;Patch[np][11] = 0;
98 Patch[np][12] = 0;Patch[np][13] = 1;Patch[np][14] = 1;Patch[np][15] = 0;
100 Patch[np][0 ] = 0;Patch[np][1 ] = 0;Patch[np][2 ] = 1;Patch[np][3 ] = 0;
101 Patch[np][4 ] = 0;Patch[np][5 ] = 0;Patch[np][6 ] = 1;Patch[np][7 ] = 0;
102 Patch[np][8 ] = 0;Patch[np][9 ] = 1;Patch[np][10] = 1;Patch[np][11] = 0;
103 Patch[np][12] = 0;Patch[np][13] = 1;Patch[np][14] = 1;Patch[np][15] = 0;
105 Patch[np][0 ] = 0;Patch[np][1 ] = 0;Patch[np][2 ] = 1;Patch[np][3 ] = 1;
106 Patch[np][4 ] = 0;Patch[np][5 ] = 1;Patch[np][6 ] = 1;Patch[np][7 ] = 0;
107 Patch[np][8 ] = 1;Patch[np][9 ] = 1;Patch[np][10] = 0;Patch[np][11] = 0;
108 Patch[np][12] = 1;Patch[np][13] = 0;Patch[np][14] = 0;Patch[np][15] = 0;
110 Mat->
Transform(Patch[np],Patch[36],4,OP_ROT_180);
112 Mat->
Transform(Patch[np],Patch[37],4,OP_INVERT);
114 Mat->
Transform(Patch[np],Patch[37],4,OP_ROT_90);
116 Mat->
Transform(Patch[np],Patch[36],4,OP_ROT_90);
118 Mat->
Transform(Patch[np],Patch[42],4,OP_INVERT);
120 Patch[np][0 ] = 1;Patch[np][1 ] = 1;Patch[np][2 ] = 0;Patch[np][3 ] = 0;
121 Patch[np][4 ] = 1;Patch[np][5 ] = 0;Patch[np][6 ] = 0;Patch[np][7 ] = 1;
122 Patch[np][8 ] = 0;Patch[np][9 ] = 0;Patch[np][10] = 1;Patch[np][11] = 1;
123 Patch[np][12] = 0;Patch[np][13] = 0;Patch[np][14] = 1;Patch[np][15] = 1;
125 Patch[np][0 ] = 0;Patch[np][1 ] = 0;Patch[np][2 ] = 1;Patch[np][3 ] = 1;
126 Patch[np][4 ] = 0;Patch[np][5 ] = 1;Patch[np][6 ] = 1;Patch[np][7 ] = 0;
127 Patch[np][8 ] = 0;Patch[np][9 ] = 1;Patch[np][10] = 1;Patch[np][11] = 0;
128 Patch[np][12] = 1;Patch[np][13] = 1;Patch[np][14] = 0;Patch[np][15] = 0;
130 Mat->
Transform(Patch[np],Patch[41],4,OP_MIRROR);
132 Mat->
Transform(Patch[np],Patch[44],4,OP_INVERT);
134 Patch[np][0 ] = 1;Patch[np][1 ] = 0;Patch[np][2 ] = 0;Patch[np][3 ] = 1;
135 Patch[np][4 ] = 1;Patch[np][5 ] = 1;Patch[np][6 ] = 1;Patch[np][7 ] = 1;
136 Patch[np][8 ] = 0;Patch[np][9 ] = 0;Patch[np][10] = 1;Patch[np][11] = 1;
137 Patch[np][12] = 0;Patch[np][13] = 0;Patch[np][14] = 0;Patch[np][15] = 0;
139 Patch[np][0 ] = 1;Patch[np][1 ] = 1;Patch[np][2 ] = 1;Patch[np][3 ] = 1;
140 Patch[np][4 ] = 0;Patch[np][5 ] = 0;Patch[np][6 ] = 0;Patch[np][7 ] = 0;
141 Patch[np][8 ] = 1;Patch[np][9 ] = 1;Patch[np][10] = 1;Patch[np][11] = 1;
142 Patch[np][12] = 0;Patch[np][13] = 0;Patch[np][14] = 0;Patch[np][15] = 0;
144 Mat->
Transform(Patch[np],Patch[47],4,OP_INVERT);
146 FILE *Ciccia = fopen(
"Patches.xvl",
"w");
147 double Spaz = 1./46.;
150 fprintf(Ciccia,
"#l(1. 1. 1.) v[46]");
151 for(
int j=0;j<7;j++){
152 for(
int r=0;r<4;r++){
153 for(
int i=0;i<7;i++){
154 for(
int c=0;c<4;c++){
155 fprintf(Ciccia,
"{x(%lf %lf %lf) ",Riga,Col,0.);
156 double Colore = Patch[7*j+i][r*4+c] == 0 ? 0. : 1.0;
157 fprintf(Ciccia,
"v(%lf %lf %lf) }\n",Colore,Colore,Colore);
int Transform(int *Out, int *In, int NEdge, int operation)
Boh.