-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMacro_SurfaceVolumeRetrievalBacking.geo
executable file
·182 lines (161 loc) · 4.93 KB
/
Macro_SurfaceVolumeRetrievalBacking.geo
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/*******************************************************************************************************************************
*
* Macro SurfaceVolumeRetrievalBacking
*
* Automatic retrieval of Surfaces and Volumes from the extruded (in +Y) backings for the purpose of defining Physical entities
*
*******************************************************************************************************************************/
// RETRIEVAL OF ALL SURFACES AT Y=extr.width FROM THE EXTRUDED BACKINGS, AS WELL AS THE GENERATED VOLUMES AND THE SURFACES AT THE BACKING 'ABUTMENTS'
// NOTES: * THIS MACRO FEEDS ORIGINALLY FROM MACRO Bridge3D3Span, HENCE ALL LIMITATIONS AND SPECIFICITIES NOTED THERE APPLY HERE AS WELL
Macro SurfaceVolumeRetrievalBacking
/*
IN: *args from previous macros
INOUT: V_BK[] = List of ALL Volumes forming the backings in the current extrusion
S_abtbk[] = List of Surfaces at the backing 'abutments' along the current extrusion
OUT: S_Yext[] = List of all Surfaces at Y>0 (with Y = width of extrusion)
(Reset and updated here with the backings contribution)
aux3 = Number of elements in 1 layer of each triangular part of
the backing
aux2bk = Number of elements in 1 layer of the central (rectangular)
part of the backing should it be present
+ other aux variables
*/
//------------------------------------------------------------------------------
// INITIALISE AUX LISTS
S_Yext[] = {}; // RESET AND UPDATED EVERY TIME THIS MACRO IS CALLED!
If (L_x2 == 0)
aux2bk = 0;
Else
aux2bk = (TL3-1)*(TL2-1);
EndIf
aux3 = (TL3/2)*(TL3-1);
add[] = {5};
For (1:aux3-2)
add[] = {add[], 6};
EndFor
For j In {2:TL3-1}
add[{ (j/2*(j-1))-1 }] = 5;
EndFor
add2[] = {0};
addsum = 0;
For j In {1:aux3-1}
addsum = addsum + add[j-1];
add2[] = {add2[], addsum};
EndFor
//------------------------------------------------------------------------------
// SIMULTANEOUS UPDATE OF S_Yext[] AND V_SK[]:
//------------------------------------------------------------------------------
// 1st EDGE BACKING
suma = 0;
sumv = 1;
For step In {TL3-1:1:-1}
S_Yext[] = {S_Yext[], extBK[suma]};
V_BK[] = {V_BK[], extBK[sumv]};
suma = suma+5;
sumv = sumv+5;
For (1:step-1)
S_Yext[] = {S_Yext[], extBK[suma]};
V_BK[] = {V_BK[], extBK[sumv]};
suma = suma+6;
sumv = sumv+6;
EndFor
EndFor
//------------------------------------------------------------------------------
// 1st FULL BACKING (1/3)
For j In {0:aux3-1}
S_Yext[] = {S_Yext[], extBK[suma+add2[j]]};
V_BK[] = {V_BK[], extBK[sumv+add2[j]]};
EndFor
// 1st FULL BACKING TRANSITION TO (2/3) OR (3/3)
suma = suma+add2[aux3-1]+5;
sumv = sumv+add2[aux3-1]+5;
// 1st FULL BACKING (2/3) IF PRESENT
If (L_x2 != 0)
For (1:aux2bk)
S_Yext[] = {S_Yext[], extBK[suma]};
V_BK[] = {V_BK[], extBK[sumv]};
suma = suma+6;
sumv = sumv+6;
EndFor
EndIf
// 1st FULL BACKING (3/3)
For step In {TL3-1:1:-1}
S_Yext[] = {S_Yext[], extBK[suma]};
V_BK[] = {V_BK[], extBK[sumv]};
suma = suma+5;
sumv = sumv+5;
For (1:step-1)
S_Yext[] = {S_Yext[], extBK[suma]};
V_BK[] = {V_BK[], extBK[sumv]};
suma = suma+6;
sumv = sumv+6;
EndFor
EndFor
//------------------------------------------------------------------------------
// 2nd FULL BACKING (1/3)
For j In {0:aux3-1}
S_Yext[] = {S_Yext[], extBK[suma+add2[j]]};
V_BK[] = {V_BK[], extBK[sumv+add2[j]]};
EndFor
// 2nd FULL BACKING TRANSITION TO (2/3) OR (3/3)
suma = suma+add2[aux3-1]+5;
sumv = sumv+add2[aux3-1]+5;
// 2nd FULL BACKING (2/3) IF PRESENT
If (L_x2 != 0)
For (1:aux2bk)
S_Yext[] = {S_Yext[], extBK[suma]};
V_BK[] = {V_BK[], extBK[sumv]};
suma = suma+6;
sumv = sumv+6;
EndFor
EndIf
// 2nd FULL BACKING (3/3)
For step In {TL3-1:1:-1}
S_Yext[] = {S_Yext[], extBK[suma]};
V_BK[] = {V_BK[], extBK[sumv]};
suma = suma+5;
sumv = sumv+5;
For (1:step-1)
S_Yext[] = {S_Yext[], extBK[suma]};
V_BK[] = {V_BK[], extBK[sumv]};
suma = suma+6;
sumv = sumv+6;
EndFor
EndFor
//------------------------------------------------------------------------------
// TRANSITION TO 2nd EDGE BACKING
auxsuma = suma; // << FOR LATER USE WITH S_abtbk[]
// 2nd EDGE BACKING
For step In {TL3-1:1:-1}
S_Yext[] = {S_Yext[], extBK[suma]};
V_BK[] = {V_BK[], extBK[sumv]};
suma = suma+5;
sumv = sumv+5;
For (1:step-1)
S_Yext[] = {S_Yext[], extBK[suma]};
V_BK[] = {V_BK[], extBK[sumv]};
suma = suma+6;
sumv = sumv+6;
EndFor
EndFor
//------------------------------------------------------------------------------
// UPDATE OF S_abtbk[]:
//------------------------------------------------------------------------------
// 'ABUTMENT' OF 1st ARCH
suma = 2;
S_abtbk[] = {S_abtbk[], extBK[suma]};
suma = suma+5;
For (1:TL3-2)
S_abtbk[] = {S_abtbk[], extBK[suma]};
suma = suma+6;
EndFor
// 'ABUTMENT' OF 3rd ARCH
suma = auxsuma+2;
S_abtbk[] = {S_abtbk[], extBK[suma]};
suma = suma+5;
For (1:TL3-2)
S_abtbk[] = {S_abtbk[], extBK[suma]};
suma = suma+6;
EndFor
//------------------------------------------------------------------------------
Return