-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPolygonize_Cellular.txt
More file actions
63 lines (56 loc) · 1.44 KB
/
Copy pathPolygonize_Cellular.txt
File metadata and controls
63 lines (56 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
vector $Pts_CRV[],$posV;
UnitMATRIX; SetGMATRIX;
matrix $MatrixC[4][4];
matrix $MatrixD[4][4];
$MatrixC= $MatrixGlobalA;
$MatrixD= $MatrixGlobalA;
float $theta =90;
int $i,$ii,$Case_N,$p,$Six_sides[];
$Six_sides={0,3,5,2,1,4};
//if side is 0
$Case_N =0;
vector $vecIndex[];
int $VecIndex[];
string $A_Zs[],$poly_face_Names[],$Allpoly_face[];
$A_Zs={"A","B","C","D","E","F"};
for( $ii = 0 ; $ii < 6 ; $ii++ ){
print ("$vecIndex = $"+$A_Zs[$ii]+"vecIndex;");
print ("\n");
eval("$vecIndex = $"+$A_Zs[$ii]+"vecIndex;");
eval("$VecIndex = $"+$A_Zs[$ii]+"VecIndex;");
// North South East West Up Down
// 0 3 5 2 1 4
///// X -x -z Z Y -y
PAUSE;
for( $i = 0 ; $i < 6 ; $i++ ){
$Case_N =$i;
switch($Case_N) {
case 0: zrotMATRIX(($theta*-1));
break;
case 1: zrotMATRIX(($theta));
break;
case 2: xrotMATRIX(($theta));
break;
case 3: xrotMATRIX(($theta*-1));
break;
case 4: print "No rotation"; print ("\n");
break;
case 5: xrotMATRIX(($theta*2.0));
break;
}
$posV=$SQUARE_PLANE[$Six_sides[$i]]*2.0;
Loc($posV);
PAUSE;
SetGMATRIX;
$MatrixD= $MatrixGlobalA;
$MatrixD[3][0]=$posV.x; $MatrixD[3][1]=$posV.y; $MatrixD[3][2]=$posV.z;
$Pts_CRV = MultPointMatrixArray($vecIndex, $MatrixC,$MatrixD);
$poly_face_Names=GeneratePoly($Pts_CRV,$VecIndex);
for( $p = 0 ; $p < `size($poly_face_Names)` ; $p++ ){
$Allpoly_face[`size($Allpoly_face)`]=$poly_face_Names[$p];
}
PAUSE;
UnitMATRIX; SetGMATRIX;
}
delete $Allpoly_face;
}