Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
robot.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_geom
3/// Drawing a famous Korean robot, TaekwonV, using ROOT geometry class.
4///
5/// Reviewed by Sunman Kim (sunman98@hanmail.net)
6/// Supervisor: Prof. Inkyu Park (icpark@physics.uos.ac.kr)
7///
8/// How to run: `.x robot.C` in ROOT terminal, then use OpenGL
9///
10/// This macro was created for the evaluation of Computational Physics course in 2006.
11/// We thank to Prof. Inkyu Park for his special lecture on ROOT and to all of ROOT team
12///
13/// \image html geom_robot.png width=500px
14/// \macro_code
15///
16/// \author Jin Hui Hwang, Dept. of Physics, Univ. of Seoul
17
18#include "TGeoManager.h"
19
20void robot()
21{
22
23 TGeoManager *Robot = new TGeoManager("Robot", "This is Taegwon V");
24
25 TGeoMaterial *vacuum = new TGeoMaterial("vacuum", 0, 0, 0);
26 TGeoMaterial *Fe = new TGeoMaterial("Fe", 55.845, 26, 7.87);
27
28 TGeoMedium *Air = new TGeoMedium("Vacuum", 0, vacuum);
29 TGeoMedium *Iron = new TGeoMedium("Iron", 1, Fe);
30
31 // create volume
32
33 TGeoVolume *top = Robot->MakeBox("top", Air, 1000, 1000, 1000);
34 Robot->SetTopVolume(top);
35 Robot->SetTopVisible(false);
36 // If you want to see the boundary, please input the number, 1 instead of 0.
37 // Like this, geom->SetTopVisible(1);
38
39 // head
40 TGeoVolume *Band = Robot->MakeEltu("Band", Iron, 20, 20, 2.5);
41 Band->SetLineColor(12);
42 Band->SetFillColor(12);
43 TGeoVolume *Band_b = Robot->MakeSphere("Band_b", Iron, 0, 2, 0, 180, 180, 360);
44 Band_b->SetLineColor(2);
45 Band_b->SetFillColor(2);
46 TGeoVolume *Head = Robot->MakeSphere("Head", Iron, 0, 19, 0, 180, 180, 360);
47 Head->SetLineColor(17);
48 Head->SetFillColor(17);
49 TGeoVolume *Horn = Robot->MakeSphere("Horn", Iron, 0, 10, 60, 180, 240, 300);
50
51 // drawing head
52 top->AddNodeOverlap(Band, 1, new TGeoTranslation(0, 0, 90));
53 float Phi = 3.14;
54 int N = 10;
55
56 for (int i = 0; i <= N; i++) {
57 top->AddNodeOverlap(Band_b, 1,
58 new TGeoCombiTrans(sin(2 * Phi / N * i) * 19, -cos(2 * Phi / N * i) * 19, 90,
59 new TGeoRotation("R1", -90 + (360 / N * i), -90, 90)));
60 }
61 top->AddNodeOverlap(Head, 1, new TGeoCombiTrans(0, 0, 87.5, new TGeoRotation("R2", 0, -90, 0)));
62
63 char name[50];
64 float pcs = 30;
65 for (int i = 1; i < pcs; i++) {
66 sprintf(name, "Horn%d", i);
67 Horn = Robot->MakeSphere(name, Iron, 10 - 10 / pcs * i, 10, 180 - (120 / pcs) * i, 180 - ((120 / pcs) * (i - 1)),
68 240, 300);
69 Horn->SetLineColor(2);
70 Horn->SetFillColor(2);
71 top->AddNodeOverlap(Horn, 1, new TGeoCombiTrans(0, 8, 102, new TGeoRotation("R2", 0, 140, 0)));
72 top->AddNodeOverlap(Horn, 1, new TGeoCombiTrans(0, -8, 102, new TGeoRotation("R2", 180, 140, 0)));
73 }
74
75 // face
76 TGeoVolume *Migan = Robot->MakeGtra("Migan", Iron, 3, 0, 0, 0, 3, 2, 11, 0, 3, 3, 11, 0);
77 Migan->SetLineColor(17);
78 Migan->SetFillColor(17);
79 TGeoVolume *Ko = Robot->MakeGtra("Ko", Iron, 7, 0, 0, 0, 3, 1, 5, 0, 3, 2, 5, 0);
80 Ko->SetLineColor(17);
81 Ko->SetFillColor(17);
82 TGeoVolume *Ko_m = Robot->MakeBox("Ko_m", Iron, 2, 8, 4);
83 Ko_m->SetLineColor(17);
84 Ko_m->SetFillColor(17);
85 TGeoVolume *Bol_1 = Robot->MakeBox("Bol_1", Iron, 7, 5.5, 7);
86 Bol_1->SetLineColor(17);
87 Bol_1->SetFillColor(17);
88 TGeoVolume *Bol_2 = Robot->MakeGtra("Bol_2", Iron, 1, 0, 0, 0, 7, 0, 9, 0, 7, 0, 9, 0);
89 Bol_2->SetLineColor(17);
90 Bol_2->SetFillColor(17);
91 TGeoVolume *Noon = Robot->MakeBox("Noon", Iron, 1, 10, 5);
92 Noon->SetLineColor(12);
93 Noon->SetFillColor(12);
94 TGeoVolume *Tuck = Robot->MakeBox("Tuck", Iron, 2, 10, 5.5);
95 Tuck->SetLineColor(2);
96 Tuck->SetFillColor(2);
97 TGeoVolume *Tuck_1 = Robot->MakeBox("Tuck_1", Iron, 2, 9, 1);
98 Tuck_1->SetLineColor(2);
99 Tuck_1->SetFillColor(2);
100 TGeoVolume *Tuck_2 = Robot->MakeBox("Tuck_2", Iron, 3, 1, 14);
101 Tuck_2->SetLineColor(2);
102 Tuck_2->SetFillColor(2);
103 TGeoVolume *Tuck_j = Robot->MakeSphere("Tuck_j", Iron, 0, 3.5, 0, 180, 0, 360);
104 Tuck_j->SetLineColor(5);
105 Tuck_j->SetFillColor(5);
106 TGeoVolume *Ear = Robot->MakeCons("Ear", Iron, 1, 0, 3, 0, 3, 0, 360);
107 Ear->SetLineColor(5);
108 Ear->SetFillColor(5);
109 TGeoVolume *Ear_2 = Robot->MakeCone("Ear_2", Iron, 5, 0, 0, 0, 3);
110 Ear_2->SetLineColor(5);
111 Ear_2->SetFillColor(5);
112
113 // drawing face
114 top->AddNodeOverlap(Migan, 1, new TGeoCombiTrans(-15, 0, 88, new TGeoRotation("R2", -90, 40, 0)));
115 top->AddNodeOverlap(Ko, 1, new TGeoCombiTrans(-15, 0, 76.5, new TGeoRotation("R2", -90, -20, 0)));
116 top->AddNodeOverlap(Ko_m, 1, new TGeoTranslation(-9, 0, 68));
117 top->AddNodeOverlap(Bol_1, 1, new TGeoCombiTrans(-7, 2, 76, new TGeoRotation("R2", -30, -10, 0)));
118 top->AddNodeOverlap(Bol_1, 1, new TGeoCombiTrans(-7, -2, 76, new TGeoRotation("R2", 30, 10, 0)));
119 top->AddNodeOverlap(Bol_2, 1, new TGeoCombiTrans(-6.5, -10.5, 76, new TGeoRotation("R2", -15, -90, -30)));
120 top->AddNodeOverlap(Bol_2, 1, new TGeoCombiTrans(-4, -12.5, 82.5, new TGeoRotation("R2", -20, -90, -95)));
121 top->AddNodeOverlap(Bol_2, 1, new TGeoCombiTrans(-7.5, 10.5, 76, new TGeoRotation("R2", 20, -90, -30)));
122 top->AddNodeOverlap(Bol_2, 1, new TGeoCombiTrans(-4, 12.5, 82.5, new TGeoRotation("R2", 20, -90, -95)));
123 top->AddNodeOverlap(Noon, 1, new TGeoCombiTrans(-5, -7, 86, new TGeoRotation("R2", 60, 0, 0)));
124 top->AddNodeOverlap(Noon, 1, new TGeoCombiTrans(-5, 7, 86, new TGeoRotation("R2", -60, 0, 0)));
125 top->AddNodeOverlap(Tuck, 1, new TGeoTranslation(-12, 0, 62.5));
126 for (int i = 0; i < 10; i++) {
127 top->AddNodeOverlap(Tuck_1, 1, new TGeoCombiTrans(-4.2, 11, 61 + i, new TGeoRotation("R2", 90, -20, 20)));
128 top->AddNodeOverlap(Tuck_1, 1, new TGeoCombiTrans(-4.2, -11, 61 + i, new TGeoRotation("R2", 90, -20, -20)));
129 }
130 top->AddNodeOverlap(Tuck_2, 1, new TGeoTranslation(2, -15.1, 76));
131 top->AddNodeOverlap(Tuck_2, 1, new TGeoTranslation(2, 15.1, 76));
132 top->AddNodeOverlap(Tuck_j, 1, new TGeoTranslation(-13, 0, 62.5));
133 top->AddNodeOverlap(Ear, 1, new TGeoCombiTrans(2, -16.5, 80, new TGeoRotation("R2", 0, -90, 0)));
134 top->AddNodeOverlap(Ear, 1, new TGeoCombiTrans(2, 16.5, 80, new TGeoRotation("R2", 0, 90, 0)));
135 top->AddNodeOverlap(Ear_2, 1, new TGeoCombiTrans(2, -20, 80, new TGeoRotation("R2", 0, -90, 0)));
136 top->AddNodeOverlap(Ear_2, 1, new TGeoCombiTrans(2, 20, 80, new TGeoRotation("R2", 0, 90, 0)));
137
138 for (int i = 1; i < 28; i += 1) {
139 float a = i * 0.2;
140 TGeoVolume *Hear = Robot->MakeCons("Hear", Iron, 3, 13 + a, 16 + a, 13 + a, 16 + a, -60 - a, 60 + a);
141 if (i < 27) {
142 Hear->SetLineColor(12);
143 Hear->SetFillColor(12);
144 } else {
145 Hear->SetLineColor(2);
146 Hear->SetFillColor(2);
147 }
148 top->AddNodeOverlap(Hear, 1, new TGeoTranslation(0, 0, 89 - i));
149 }
150 for (int i = 1; i < 28; i += 1) {
151 float a = i * 0.2;
152 TGeoVolume *Hear = Robot->MakeCons("Hear", Iron, 3, 13 + a, 16 + a, 13 + a, 16 + a, -70 - a, -60 - a);
153 Hear->SetLineColor(2);
154 Hear->SetFillColor(2);
155 top->AddNodeOverlap(Hear, 1, new TGeoTranslation(0, 0, 89 - i));
156 }
157 for (int i = 1; i < 28; i += 1) {
158 float a = i * 0.2;
159 TGeoVolume *Hear = Robot->MakeCons("Hear", Iron, 3, 13 + a, 16 + a, 13 + a, 16 + a, 60 + a, 70 + a);
160 Hear->SetLineColor(2);
161 Hear->SetFillColor(2);
162 top->AddNodeOverlap(Hear, 1, new TGeoTranslation(0, 0, 89 - i));
163 }
164
165 // neck
166 TGeoVolume *Mock = Robot->MakeTrd2("Mock", Iron, 1, 1, 7, 6.5, 20);
167 Mock->SetLineColor(17);
168 Mock->SetFillColor(17);
169 TGeoVolume *Mock_1 = Robot->MakeTrd2("Mock_1", Iron, 1, 1, 6, 5, 20);
170 Mock_1->SetLineColor(17);
171 Mock_1->SetFillColor(17);
172 TGeoVolume *Mock_s = Robot->MakeTrd2("Mock_s", Iron, 1, 1, 5, 4.5, 20);
173 Mock_s->SetLineColor(17);
174 Mock_s->SetFillColor(17);
175
176 // drawing neck
177 top->AddNodeOverlap(Mock, 1, new TGeoCombiTrans(-5, 4.7, 50, new TGeoRotation("R2", -30, 0, -10)));
178 top->AddNodeOverlap(Mock, 1, new TGeoCombiTrans(-5, -4.7, 50, new TGeoRotation("R2", 30, 0, 10)));
179 top->AddNodeOverlap(Mock_1, 1, new TGeoCombiTrans(11, -4, 50, new TGeoRotation("R2", 130, -8, 10)));
180 top->AddNodeOverlap(Mock_1, 1, new TGeoCombiTrans(11, 4, 50, new TGeoRotation("R2", -130, 8, -10)));
181 top->AddNodeOverlap(Mock_s, 1, new TGeoCombiTrans(2.5, 9, 50, new TGeoRotation("R2", 90, 0, 0)));
182 top->AddNodeOverlap(Mock_s, 1, new TGeoCombiTrans(2.5, -9, 50, new TGeoRotation("R2", 90, 0, 0)));
183
184 // chest
185 TGeoVolume *Gasem = Robot->MakeBox("Gasem", Iron, 16, 50, 20);
186 Gasem->SetLineColor(12);
187 Gasem->SetFillColor(12);
188 TGeoVolume *Gasem_b1 = Robot->MakeSphere("Gasem_b1", Iron, 0, 15, 0, 180, 0, 360);
189 Gasem_b1->SetLineColor(12);
190 Gasem_b1->SetFillColor(12);
191 TGeoVolume *Gasem_b2 = Robot->MakeSphere("Gasem_b2", Iron, 0, 13, 0, 180, 0, 360);
192 Gasem_b2->SetLineColor(12);
193 Gasem_b2->SetFillColor(12);
194 TGeoVolume *Gasem_1 = Robot->MakeEltu("Gasem_1", Iron, 13, 13, 20);
195 Gasem_1->SetLineColor(12);
196 Gasem_1->SetFillColor(12);
197 TGeoVolume *Gasem_2 = Robot->MakeEltu("Gasem_2", Iron, 13, 13, 19);
198 Gasem_2->SetLineColor(12);
199 Gasem_2->SetFillColor(12);
200 TGeoVolume *Gasem_3 = Robot->MakeCone("Gasem_3", Iron, 19, 0, 13, 0, 15);
201 Gasem_3->SetLineColor(12);
202 Gasem_3->SetFillColor(12);
203 TGeoVolume *Gasem_4 = Robot->MakeEltu("Gasem_4", Iron, 15, 15, 16);
204 Gasem_4->SetLineColor(12);
205 Gasem_4->SetFillColor(12);
206 TGeoVolume *Gasem_5 = Robot->MakeEltu("Gasem_5", Iron, 13, 13, 16);
207 Gasem_5->SetLineColor(12);
208 Gasem_5->SetFillColor(12);
209 TGeoVolume *Gasem_m1 = Robot->MakeBox("Gasem_m1", Iron, 19, 19, 5);
210 Gasem_m1->SetLineColor(12);
211 Gasem_m1->SetFillColor(12);
212 TGeoVolume *Gasem_m2 = Robot->MakeTrd2("Gasem_m2", Iron, 13, 15, 2, 2, 19);
213 Gasem_m2->SetLineColor(12);
214 Gasem_m2->SetFillColor(12);
215 TGeoVolume *V = Robot->MakeTrd2("V", Iron, 2, 2, 22, 30, 4);
216 V->SetLineColor(2);
217 V->SetFillColor(2);
218 TGeoVolume *V_m = Robot->MakeBox("V_m", Iron, 2, 7, 1);
219 V_m->SetLineColor(2);
220 V_m->SetFillColor(2);
221
222 // drawing chest
223 top->AddNodeOverlap(Gasem, 1, new TGeoTranslation(4, 0, 19));
224 top->AddNodeOverlap(Gasem_b1, 1, new TGeoTranslation(-12, 50, 35));
225 top->AddNodeOverlap(Gasem_b1, 1, new TGeoTranslation(-12, -50, 35));
226 top->AddNodeOverlap(Gasem_b1, 1, new TGeoTranslation(20, 50, 35));
227 top->AddNodeOverlap(Gasem_b1, 1, new TGeoTranslation(20, -50, 35));
228 top->AddNodeOverlap(Gasem_b2, 1, new TGeoTranslation(-12, 50, -5));
229 top->AddNodeOverlap(Gasem_b2, 1, new TGeoTranslation(-12, -50, -5));
230 top->AddNodeOverlap(Gasem_b2, 1, new TGeoTranslation(20, 50, -5));
231 top->AddNodeOverlap(Gasem_b2, 1, new TGeoTranslation(20, -50, -5));
232 top->AddNodeOverlap(Gasem_b2, 1, new TGeoTranslation(20, 10, -5));
233 top->AddNodeOverlap(Gasem_b2, 1, new TGeoTranslation(20, -10, -5));
234 top->AddNodeOverlap(Gasem_b2, 1, new TGeoTranslation(-12, 10, -5));
235 top->AddNodeOverlap(Gasem_b2, 1, new TGeoTranslation(-12, -10, -5));
236 top->AddNodeOverlap(Gasem_b2, 1, new TGeoTranslation(20, 10, 35));
237 top->AddNodeOverlap(Gasem_b2, 1, new TGeoTranslation(20, -10, 35));
238 top->AddNodeOverlap(Gasem_b2, 1, new TGeoTranslation(-12, 10, 35));
239 top->AddNodeOverlap(Gasem_b2, 1, new TGeoTranslation(-12, -10, 35));
240 top->AddNodeOverlap(Gasem_1, 1, new TGeoCombiTrans(20, 31, -5, new TGeoRotation("R2", 0, 90, 0)));
241 top->AddNodeOverlap(Gasem_1, 1, new TGeoCombiTrans(20, -31, -5, new TGeoRotation("R2", 0, 90, 0)));
242 top->AddNodeOverlap(Gasem_1, 1, new TGeoCombiTrans(-12, 31, -5, new TGeoRotation("R2", 0, 90, 0)));
243 top->AddNodeOverlap(Gasem_1, 1, new TGeoCombiTrans(-12, -31, -5, new TGeoRotation("R2", 0, 90, 0)));
244 top->AddNodeOverlap(Gasem_2, 1, new TGeoCombiTrans(20, 10, 13, new TGeoRotation("R2", 0, 0, 0)));
245 top->AddNodeOverlap(Gasem_2, 1, new TGeoCombiTrans(20, -10, 13, new TGeoRotation("R2", 0, 0, 0)));
246 top->AddNodeOverlap(Gasem_2, 1, new TGeoCombiTrans(-12, 10, 13, new TGeoRotation("R2", 0, 0, 0)));
247 top->AddNodeOverlap(Gasem_2, 1, new TGeoCombiTrans(-12, -10, 13, new TGeoRotation("R2", 0, 0, 0)));
248 top->AddNodeOverlap(Gasem_3, 1, new TGeoCombiTrans(-12, 50, 16, new TGeoRotation("R2", 0, 0, 0)));
249 top->AddNodeOverlap(Gasem_3, 1, new TGeoCombiTrans(-12, -50, 16, new TGeoRotation("R2", 0, 0, 0)));
250 top->AddNodeOverlap(Gasem_3, 1, new TGeoCombiTrans(20, 50, 16, new TGeoRotation("R2", 0, 0, 0)));
251 top->AddNodeOverlap(Gasem_3, 1, new TGeoCombiTrans(20, -50, 16, new TGeoRotation("R2", 0, 0, 0)));
252 top->AddNodeOverlap(Gasem_3, 1, new TGeoCombiTrans(-12, 31, 35, new TGeoRotation("R2", 0, -90, 0)));
253 top->AddNodeOverlap(Gasem_3, 1, new TGeoCombiTrans(-12, -31, 35, new TGeoRotation("R2", 0, 90, 0)));
254 top->AddNodeOverlap(Gasem_3, 1, new TGeoCombiTrans(20, 31, 35, new TGeoRotation("R2", 0, -90, 0)));
255 top->AddNodeOverlap(Gasem_3, 1, new TGeoCombiTrans(20, -31, 35, new TGeoRotation("R2", 0, 90, 0)));
256 top->AddNodeOverlap(Gasem_4, 1, new TGeoCombiTrans(4, -50, 35, new TGeoRotation("R2", 90, 90, 0)));
257 top->AddNodeOverlap(Gasem_4, 1, new TGeoCombiTrans(4, 50, 35, new TGeoRotation("R2", 90, 90, 0)));
258 top->AddNodeOverlap(Gasem_5, 1, new TGeoCombiTrans(4, -50, -5, new TGeoRotation("R2", 90, 90, 0)));
259 top->AddNodeOverlap(Gasem_5, 1, new TGeoCombiTrans(4, 50, -5, new TGeoRotation("R2", 90, 90, 0)));
260 top->AddNodeOverlap(Gasem_m1, 1, new TGeoCombiTrans(-22, 30, 16, new TGeoRotation("R2", 90, 88, 0)));
261 top->AddNodeOverlap(Gasem_m1, 1, new TGeoCombiTrans(-22, -30, 16, new TGeoRotation("R2", 90, 88, 0)));
262 top->AddNodeOverlap(Gasem_m1, 1, new TGeoCombiTrans(29, 30, 16, new TGeoRotation("R2", 90, 92, 0)));
263 top->AddNodeOverlap(Gasem_m1, 1, new TGeoCombiTrans(29, -30, 16, new TGeoRotation("R2", 90, 92, 0)));
264 top->AddNodeOverlap(Gasem_m2, 1, new TGeoCombiTrans(2, -62, 16, new TGeoRotation("R2", 0, 3, 0)));
265 top->AddNodeOverlap(Gasem_m2, 1, new TGeoCombiTrans(2, 62, 16, new TGeoRotation("R2", 0, -3, 0)));
266 top->AddNodeOverlap(Gasem_m2, 1, new TGeoCombiTrans(2, -30, 47.5, new TGeoRotation("R2", 0, 87, 0)));
267 top->AddNodeOverlap(Gasem_m2, 1, new TGeoCombiTrans(2, 30, 47.5, new TGeoRotation("R2", 0, -87, 0)));
268 top->AddNodeOverlap(Gasem_m2, 1, new TGeoCombiTrans(2, -30, -16, new TGeoRotation("R2", 0, 90, 0)));
269 top->AddNodeOverlap(Gasem_m2, 1, new TGeoCombiTrans(2, 30, -16, new TGeoRotation("R2", 0, -90, 0)));
270 top->AddNodeOverlap(V, 1, new TGeoCombiTrans(-30, 18.3, 16, new TGeoRotation("R2", 0, -135, 0)));
271 top->AddNodeOverlap(V, 1, new TGeoCombiTrans(-30, -18.3, 16, new TGeoRotation("R2", 0, 135, 0)));
272 top->AddNodeOverlap(V_m, 1, new TGeoTranslation(-30, -37, 35));
273 top->AddNodeOverlap(V_m, 1, new TGeoTranslation(-30, 37, 35));
274
275 // abdomen
276 TGeoVolume *Bea = Robot->MakeEltu("Bea", Iron, 20, 37, 25);
277 Bea->SetLineColor(17);
278 Bea->SetFillColor(17);
279 TGeoVolume *Bea_d = Robot->MakeEltu("Bea_d", Iron, 21, 36, 5);
280 Bea_d->SetLineColor(12);
281 Bea_d->SetFillColor(12);
282 TGeoVolume *Beakop = Robot->MakeEltu("Beakop", Iron, 15, 25, 5);
283 Beakop->SetLineColor(10);
284 Beakop->SetFillColor(10);
285
286 // drawing abdomen
287 top->AddNodeOverlap(Bea, 1, new TGeoTranslation(3, 0, -30));
288 top->AddNodeOverlap(Bea_d, 1, new TGeoTranslation(3, 0, -10));
289 top->AddNodeOverlap(Beakop, 1, new TGeoCombiTrans(-12.1, 0, -50, new TGeoRotation("R2", 90, 90, 0)));
290
291 // Gungdi
292 TGeoVolume *Gungdi = Robot->MakeEltu("Gungdi", Iron, 25, 50, 18);
293 Gungdi->SetLineColor(12);
294 Gungdi->SetFillColor(12);
295 TGeoVolume *Gungdi_d = Robot->MakeEltu("Gungdi_d", Iron, 5, 5, 5);
296 Gungdi_d->SetLineColor(2);
297 Gungdi_d->SetFillColor(2);
298
299 // drawing Gungdi
300 top->AddNodeOverlap(Gungdi, 1, new TGeoTranslation(3, 0, -70));
301 for (int i = 0; i < 30; i++) {
302 TGeoVolume *Gungdi_j = Robot->MakeEltu("Gungdi_j", Iron, 24 - 0.2 * i, 49 - 0.5 * i, 1);
303 Gungdi_j->SetLineColor(12);
304 Gungdi_j->SetFillColor(12);
305 top->AddNodeOverlap(Gungdi_j, 1, new TGeoTranslation(3, 0, -51 + 0.5 * i));
306 }
307 for (int i = 0; i < 40; i++) {
308 if (i < 16) {
309 TGeoVolume *Gungdi_h = Robot->MakeEltu("Gungdi_h", Iron, 24 - 0.1 * i, 49 - 0.3 * i, 1);
310 Gungdi_h->SetLineColor(12);
311 Gungdi_h->SetFillColor(12);
312 top->AddNodeOverlap(Gungdi_h, 1, new TGeoTranslation(3, 0, -88 - 0.5 * i));
313 } else {
314 TGeoVolume *Gungdi_h = Robot->MakeEltu("Gungdi_h", Iron, 27 - 0.3 * i, 52 - 0.5 * i, 1);
315 Gungdi_h->SetLineColor(12);
316 Gungdi_h->SetFillColor(12);
317 top->AddNodeOverlap(Gungdi_h, 1, new TGeoTranslation(3, 0, -89 - 0.5 * i));
318 }
319 }
320 top->AddNodeOverlap(Gungdi_d, 1, new TGeoCombiTrans(3, -45, -62, new TGeoRotation("R2", 0, 90, 0)));
321 top->AddNodeOverlap(Gungdi_d, 1, new TGeoCombiTrans(3, -45, -78, new TGeoRotation("R2", 0, 90, 0)));
322 top->AddNodeOverlap(Gungdi_d, 1, new TGeoCombiTrans(3, 45, -62, new TGeoRotation("R2", 0, 90, 0)));
323 top->AddNodeOverlap(Gungdi_d, 1, new TGeoCombiTrans(3, 45, -78, new TGeoRotation("R2", 0, 90, 0)));
324
325 // feet
326 TGeoVolume *Jang = Robot->MakeEltu("Jang", Iron, 18, 18, 50);
327 Jang->SetLineColor(17);
328 Jang->SetFillColor(17);
329 TGeoVolume *Jong = Robot->MakeEltu("Jong", Iron, 22, 22, 50);
330 Jong->SetLineColor(12);
331 Jong->SetFillColor(12);
332 TGeoVolume *Bal = Robot->MakeSphere("Bal", Iron, 0, 22, 0, 180, 180, 360);
333 Bal->SetLineColor(12);
334 Bal->SetFillColor(12);
335
336 // drawing Dary
337 top->AddNodeOverlap(Jang, 1, new TGeoCombiTrans(3, -25, -120, new TGeoRotation("R2", 0, 0, 0)));
338 top->AddNodeOverlap(Jang, 1, new TGeoCombiTrans(3, 25, -120, new TGeoRotation("R2", 0, 0, 0)));
339 top->AddNodeOverlap(Jong, 1, new TGeoCombiTrans(3, -25, -220, new TGeoRotation("R2", 0, 0, 0)));
340 top->AddNodeOverlap(Jong, 1, new TGeoCombiTrans(3, 25, -220, new TGeoRotation("R2", 0, 0, 0)));
341 for (int i = 0; i < 30; i++) {
342 TGeoVolume *Mu = Robot->MakeCons("Mu", Iron, 1, 0, 22.1, 0, 22.1, 120 + 2 * i, -120 - 2 * i);
343 Mu->SetLineColor(4);
344 Mu->SetFillColor(4);
345 top->AddNodeOverlap(Mu, 1, new TGeoTranslation(3, -25, -171 - i));
346 top->AddNodeOverlap(Mu, 1, new TGeoTranslation(3, 25, -171 - i));
347 }
348 top->AddNodeOverlap(Bal, 1, new TGeoCombiTrans(-10, -25, -270, new TGeoRotation("R2", 270, -90, 0)));
349 top->AddNodeOverlap(Bal, 1, new TGeoCombiTrans(-10, 25, -270, new TGeoRotation("R2", 270, -90, 0)));
350
351 // arms
352 TGeoVolume *S = Robot->MakeSphere("S", Iron, 0, 25, 0, 180, 180, 360);
353 S->SetLineColor(17);
354 S->SetFillColor(17);
355 TGeoVolume *S_1 = Robot->MakeSphere("S_1", Iron, 0, 15, 0, 180, 0, 360);
356 S_1->SetLineColor(17);
357 S_1->SetFillColor(17);
358 TGeoVolume *Pal = Robot->MakeEltu("Pal", Iron, 15, 15, 30);
359 Pal->SetLineColor(17);
360 Pal->SetFillColor(17);
361 TGeoVolume *Fal = Robot->MakeEltu("Fal", Iron, 17, 17, 30);
362 Fal->SetLineColor(4);
363 Fal->SetFillColor(4);
364 TGeoVolume *Bbul = Robot->MakeCone("Bbul", Iron, 8, 0, 0, 0, 5);
365 Bbul->SetLineColor(17);
366 Bbul->SetFillColor(17);
367
368 // drawing arms
369 top->AddNodeOverlap(S, 1, new TGeoCombiTrans(3, 73, 30, new TGeoRotation("R2", 0, -30, 0)));
370 top->AddNodeOverlap(S, 1, new TGeoCombiTrans(3, -73, 30, new TGeoRotation("R2", 0, 210, 0)));
371 top->AddNodeOverlap(S_1, 1, new TGeoCombiTrans(3, -73, 27, new TGeoRotation("R2", 0, 0, 0)));
372 top->AddNodeOverlap(S_1, 1, new TGeoCombiTrans(3, 73, 27, new TGeoRotation("R2", 0, 0, 0)));
373 top->AddNodeOverlap(Pal, 1, new TGeoCombiTrans(3, -73, -5, new TGeoRotation("R2", 0, 0, 0)));
374 top->AddNodeOverlap(Pal, 1, new TGeoCombiTrans(3, 73, -5, new TGeoRotation("R2", 0, 0, 0)));
375 top->AddNodeOverlap(Fal, 1, new TGeoCombiTrans(3, -73, -60, new TGeoRotation("R2", 0, 0, 0)));
376 top->AddNodeOverlap(Fal, 1, new TGeoCombiTrans(3, 73, -60, new TGeoRotation("R2", 0, 0, 0)));
377 top->AddNodeOverlap(Bbul, 1, new TGeoCombiTrans(3, -97, -72, new TGeoRotation("R2", 0, -90, 0)));
378 top->AddNodeOverlap(Bbul, 1, new TGeoCombiTrans(3, -97, -48, new TGeoRotation("R2", 0, -90, 0)));
379 top->AddNodeOverlap(Bbul, 1, new TGeoCombiTrans(3, 97, -72, new TGeoRotation("R2", 0, 90, 0)));
380 top->AddNodeOverlap(Bbul, 1, new TGeoCombiTrans(3, 97, -48, new TGeoRotation("R2", 0, 90, 0)));
381
382 // hands
383 TGeoVolume *Son_d = Robot->MakeBox("Son_d", Iron, 15, 15, 7);
384 Son_d->SetLineColor(4);
385 Son_d->SetFillColor(4);
386 TGeoVolume *Son_g = Robot->MakeBox("Son_g", Iron, 4, 10, 4);
387 Son_g->SetLineColor(4);
388 Son_g->SetFillColor(4);
389 TGeoVolume *Son_g1 = Robot->MakeBox("Son_g1", Iron, 6, 6, 6);
390 Son_g1->SetLineColor(4);
391 Son_g1->SetFillColor(4);
392 TGeoVolume *Son_g2 = Robot->MakeBox("Son_g2", Iron, 8, 3, 3);
393 Son_g2->SetLineColor(4);
394 Son_g2->SetFillColor(4);
395 TGeoVolume *Last_b = Robot->MakeCone("Last_b", Iron, 10, 0, 0, 0, 4);
396 Last_b->SetLineColor(17);
397 Last_b->SetFillColor(17);
398 TGeoVolume *Last = Robot->MakeSphere("Last", Iron, 0, 3, 0, 180, 0, 360);
399 Last->SetLineColor(2);
400 Last->SetFillColor(2);
401
402 // drawing hands
403 top->AddNodeOverlap(Son_d, 1, new TGeoCombiTrans(3, -80, -105, new TGeoRotation("R2", 0, 90, 0)));
404 for (int i = 0; i < 4; i++) {
405 top->AddNodeOverlap(Son_g, 1, new TGeoCombiTrans(-6 + 6 * i, -72, -118, new TGeoRotation("R2", 0, -10, 0)));
406 }
407 for (int i = 0; i < 4; i++) {
408 top->AddNodeOverlap(Son_g, 1, new TGeoCombiTrans(-6 + 6 * i, -67, -113, new TGeoRotation("R2", 0, 110, 0)));
409 }
410 top->AddNodeOverlap(Son_g1, 1, new TGeoCombiTrans(-5, -70, -98, new TGeoRotation("R2", 0, 0, 0)));
411 top->AddNodeOverlap(Son_g2, 1, new TGeoCombiTrans(-5, -65, -102, new TGeoRotation("R2", 0, 60, 0)));
412 top->AddNodeOverlap(Son_d, 1, new TGeoCombiTrans(3, 80, -105, new TGeoRotation("R2", 0, 90, 0)));
413 for (int i = 0; i < 4; i++) {
414 top->AddNodeOverlap(Son_g, 1, new TGeoCombiTrans(-6 + 6 * i, 72, -118, new TGeoRotation("R2", 0, 10, 0)));
415 }
416 for (int i = 0; i < 4; i++) {
417 top->AddNodeOverlap(Son_g, 1, new TGeoCombiTrans(-6 + 6 * i, 67, -113, new TGeoRotation("R2", 0, 70, 0)));
418 }
419 top->AddNodeOverlap(Son_g1, 1, new TGeoCombiTrans(-5, 70, -98, new TGeoRotation("R2", 0, 0, 0)));
420 top->AddNodeOverlap(Son_g2, 1, new TGeoCombiTrans(-5, 65, -102, new TGeoRotation("R2", 0, 60, 0)));
421 top->AddNodeOverlap(Last_b, 1, new TGeoCombiTrans(3, -88, -103, new TGeoRotation("R2", 0, 180, 0)));
422 top->AddNodeOverlap(Last_b, 1, new TGeoCombiTrans(12, -88, -103, new TGeoRotation("R2", 0, 180, 0)));
423 top->AddNodeOverlap(Last_b, 1, new TGeoCombiTrans(-7, -88, -103, new TGeoRotation("R2", 0, 180, 0)));
424 top->AddNodeOverlap(Last_b, 1, new TGeoCombiTrans(3, 88, -103, new TGeoRotation("R2", 0, 180, 0)));
425 top->AddNodeOverlap(Last_b, 1, new TGeoCombiTrans(12, 88, -103, new TGeoRotation("R2", 0, 180, 0)));
426 top->AddNodeOverlap(Last_b, 1, new TGeoCombiTrans(-7, 88, -103, new TGeoRotation("R2", 0, 180, 0)));
427 top->AddNodeOverlap(Last, 1, new TGeoCombiTrans(3, -88, -112, new TGeoRotation("R2", 0, 180, 0)));
428 top->AddNodeOverlap(Last, 1, new TGeoCombiTrans(12, -88, -112, new TGeoRotation("R2", 0, 180, 0)));
429 top->AddNodeOverlap(Last, 1, new TGeoCombiTrans(-7, -88, -112, new TGeoRotation("R2", 0, 180, 0)));
430 top->AddNodeOverlap(Last, 1, new TGeoCombiTrans(3, 88, -112, new TGeoRotation("R2", 0, 180, 0)));
431 top->AddNodeOverlap(Last, 1, new TGeoCombiTrans(12, 88, -112, new TGeoRotation("R2", 0, 180, 0)));
432 top->AddNodeOverlap(Last, 1, new TGeoCombiTrans(-7, 88, -112, new TGeoRotation("R2", 0, 180, 0)));
433
434 for (int i = 1; i < 20; i += 1) {
435 if (i < 7) {
436 TGeoVolume *Effect =
437 Robot->MakeCons("Effect", Iron, 3, 20 / sin(i), 21 / sin(i), 20 / sin(i), 21 / sin(i), 0, 70);
438 Effect->SetLineColor(9);
439 Effect->SetFillColor(9);
440 top->AddNodeOverlap(Effect, 1, new TGeoTranslation(3, 0, -280));
441 }
442 if (6 < i && i < 10) {
443 TGeoVolume *Effect =
444 Robot->MakeCons("Effect", Iron, 5, 20 / sin(i), 21 / sin(i), 20 / sin(i), 21 / sin(i), 50, 120);
445 Effect->SetLineColor(38);
446 Effect->SetFillColor(38);
447 top->AddNodeOverlap(Effect, 1, new TGeoTranslation(3, 0, -280));
448 }
449 if (9 < i && i < 20) {
450 TGeoVolume *Effect =
451 Robot->MakeCons("Effect", Iron, 4, 20 / sin(i), 21 / sin(i), 20 / sin(i), 21 / sin(i), 200, 330);
452 Effect->SetLineColor(33);
453 Effect->SetFillColor(33);
454 top->AddNodeOverlap(Effect, 1, new TGeoTranslation(3, 0, -280));
455 }
456 }
457
458 // close geometry
459 top->SetVisibility(false);
460 Robot->CloseGeometry();
461
462 // in GL viewer
463 top->Draw("ogl");
464}
#define a(i)
Definition RSha256.hxx:99
#define N
char name[80]
Definition TGX11.cxx:110
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition TAttFill.h:37
Class describing rotation + translation.
Definition TGeoMatrix.h:317
The manager class for any TGeo geometry.
Definition TGeoManager.h:44
TGeoVolume * MakeCone(const char *name, TGeoMedium *medium, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
Make in one step a volume pointing to a cone shape with given medium.
TGeoVolume * MakeCons(const char *name, TGeoMedium *medium, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2)
Make in one step a volume pointing to a cone segment shape with given medium.
void CloseGeometry(Option_t *option="d")
Closing geometry implies checking the geometry validity, fixing shapes with negative parameters (run-...
TGeoVolume * MakeTrd2(const char *name, TGeoMedium *medium, Double_t dx1, Double_t dx2, Double_t dy1, Double_t dy2, Double_t dz)
Make in one step a volume pointing to a TGeoTrd2 shape with given medium.
TGeoVolume * MakeGtra(const char *name, TGeoMedium *medium, Double_t dz, Double_t theta, Double_t phi, Double_t twist, Double_t h1, Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2, Double_t tl2, Double_t alpha2)
Make in one step a volume pointing to a twisted trapezoid shape with given medium.
TGeoVolume * MakeBox(const char *name, TGeoMedium *medium, Double_t dx, Double_t dy, Double_t dz)
Make in one step a volume pointing to a box shape with given medium.
TGeoVolume * MakeSphere(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t themin=0, Double_t themax=180, Double_t phimin=0, Double_t phimax=360)
Make in one step a volume pointing to a sphere shape with given medium.
void SetTopVolume(TGeoVolume *vol)
Set the top volume and corresponding node as starting point of the geometry.
void SetTopVisible(Bool_t vis=kTRUE)
make top volume visible on screen
TGeoVolume * MakeEltu(const char *name, TGeoMedium *medium, Double_t a, Double_t b, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
Base class describing materials.
Media are used to store properties related to tracking and which are useful only when using geometry ...
Definition TGeoMedium.h:23
Class describing rotations.
Definition TGeoMatrix.h:168
Class describing translations.
Definition TGeoMatrix.h:116
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:43
void SetVisibility(Bool_t vis=kTRUE) override
set visibility of this volume
void Draw(Option_t *option="") override
draw top volume according to option
virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
Add a TGeoNode to the list of nodes.
void SetLineColor(Color_t lcolor) override
Set the line color.
RVec< PromoteType< T > > cos(const RVec< T > &v)
Definition RVec.hxx:1852
RVec< PromoteType< T > > sin(const RVec< T > &v)
Definition RVec.hxx:1851
RooArgSet S(Args_t &&... args)
Definition RooArgSet.h:195