40093367 |
1 | #1 - create Box using short-cut |
2 | NewCommand D |
3 | AddDriver D Box; ## add box driver to driver table |
4 | set B1 [AddBox D 130 140 150]; ## add box |
5 | ComputeFun D $B1:1; ## compute box1 function |
6 | GetShape D $B1:1:2 Box1; ## check result |
7 | whatis Box1 |
8 | # referes to result NS |
9 | GetReference D $B1; ## check is reference set |
10 | |
11 | |
12 | #2 - create main sphere |
13 | AddDriver D Cyl Sph Attach XAttach PTxyz PTALine PRLine PMirr Cut Fuse Prism FulRevol SecRevol Fillet |
14 | NewCommand D |
15 | explode Box1 V |
16 | set SPnt1 [AttachShape D Box1_1 ${B1} ${B1} 0]; ## set attachment |
17 | erase Box1 |
18 | |
19 | set Sph0 [AddSphere D $SPnt1 250] |
20 | ComputeFun D $Sph0:1 |
21 | GetShape D $Sph0:1:2 Sp0 |
22 | |
23 | #3 create Sphere1 |
24 | NewCommand D |
25 | set Sph1 [AddSphere D $SPnt1 30] |
26 | ComputeFun D $Sph1:1 |
27 | GetShape D $Sph1:1:2 Sp1 |
28 | |
29 | NewCommand D |
30 | set FTr1 [PTranslateDXYZ D $Sph1 0 -251 0] |
31 | ComputeFun D $FTr1 |
32 | GetShape D $Sph1:2:2 Sp1 |
33 | |
34 | #4 create Sphere2 |
35 | NewCommand D |
36 | set Sph2 [AddSphere D $SPnt1 30] |
37 | ComputeFun D $Sph2:1 |
38 | GetShape D $Sph2:1:2 Sp2 |
39 | |
40 | set FTr2 [PTranslateDXYZ D $Sph2 0 251 0] |
41 | ComputeFun D $FTr2 |
42 | GetShape D $Sph2:2:2 Sp2 |
43 | |
44 | #5 create Sphere3 |
45 | NewCommand D |
46 | set Sph3 [AddSphere D $SPnt1 30] |
47 | ComputeFun D $Sph3:1 |
48 | GetShape D $Sph3:1:2 Sp3 |
49 | |
50 | explode Box1 E |
51 | set Sel3 [AttachShape D Box1_1 ${B1} ${B1} 0]; |
52 | set FR3 [PRotateRoundLine D $Sph3 $Sel3 120] |
53 | ComputeFun D $FR3 |
54 | GetShape D $FR3:2 Sp3 |
55 | |
56 | set FTr3 [PTranslateDXYZ D $Sph3 -251 0 0] |
57 | ComputeFun D $FTr3 |
58 | GetShape D $Sph3:3:2 Sp3 |
59 | |
60 | #6 create Sphere4 |
61 | NewCommand D |
62 | set Sph4 [AddSphere D $SPnt1 30] |
63 | ComputeFun D $Sph4:1 |
64 | GetShape D $Sph4:1:2 Sp4 |
65 | |
66 | set FTr4 [PTranslateDXYZ D $Sph4 251 -40 0] |
67 | ComputeFun D $FTr4 |
68 | GetShape D $Sph4:2:2 Sp4 |
69 | |
70 | #7 Cut spheres |
71 | set Cut1 [AddCut D $Sph0 $Sph1] |
72 | ComputeFun D $Cut1 |
73 | GetShape D $Cut1:2 Sp0 |
74 | |
75 | set Cut2 [AddCut D $Sph0 $Sph2] |
76 | ComputeFun D $Cut2 |
77 | GetShape D $Cut2:2 Sp0 |
78 | |
79 | set Cut3 [AddCut D $Sph0 $Sph3] |
80 | ComputeFun D $Cut3 |
81 | GetShape D $Cut3:2 Sp0 |
82 | |
83 | set Cut4 [AddCut D $Sph0 $Sph4] |
84 | ComputeFun D $Cut4 |
85 | GetShape D $Cut4:2 Sp0 |
86 | |
87 | |
88 | #5 test selection |
89 | NewCommand D |
90 | set SL [TestSingleSelection D $Sph0 0] |
91 | set SL2 [TestMultipleSelection D $Sph0 0] |
92 | |
93 | #6 modification |
94 | NewCommand D |
95 | BoxDZ D $B1 270 |
96 | |
97 | #7 recomputation |
98 | NewCommand D |
99 | InitLogBook D; ## to be initialized before any recomputation of impacted functions set (if attachments are presented) |
100 | ComputeFun D $B1:1 |
101 | ComputeFun D $SPnt1:1 |
102 | ComputeFun D $Sph0:1 |
103 | ComputeFun D $Sph1:1 |
104 | ComputeFun D $FTr1 |
105 | ComputeFun D $Sph2:1 |
106 | ComputeFun D $FTr2 |
107 | ComputeFun D $Sph3:1 |
108 | ComputeFun D $Sel3:1 |
109 | ComputeFun D $FR3 |
110 | ComputeFun D $FTr3 |
111 | ComputeFun D $Sph4:1 |
112 | ComputeFun D $FTr4 |
113 | ComputeFun D $Cut1 |
114 | ComputeFun D $Cut2 |
115 | ComputeFun D $Cut3 |
116 | ComputeFun D $Cut4 |
117 | erase |
118 | GetShape D $Cut4:2 Sp0 |
119 | |
120 | |
121 | #recomputation of entities of the TestSelection commands |
122 | SolveFlatFrom D $SL |
123 | NewCommand D |
124 | |