40093367 |
1 | #Drivers' nick-names: |
2 | #Box|Sph|Cyl|Cut|Fuse|Prism|Revol|PTxyz|PTALine|PRLine|PMirr|Fillet|Attach|XAttach |
3 | # order of functions recomputation should be defined out of the tool (by end user) |
4 | |
5 | #Commands of transformation: |
6 | #PTranslateDXYZ Doc ShapeEntry dx dy dz |
7 | #PTranslateAlongLine Doc ShapeEntry Line off |
8 | #PRotateRoundLine Doc ShapeEntry Line Angle |
9 | #PMirror Doc ShapeEntry PlaneObj |
10 | |
11 | ## Test of transformation functions |
12 | AddDriver D Box Attach PTxyz PTALine PRLine PMirr Sph |
13 | #1 - create box using more flexible set of commands |
14 | NewCommand D |
15 | set B2 [AddObject D]; ## add object |
16 | set F2 [AddFunction D $B2 Box]; ## add function |
7b5e532f |
17 | BoxDX D $B2 190; ## set arguments of this function |
40093367 |
18 | BoxDY D $B2 290 |
19 | BoxDZ D $B2 390 |
20 | InitLogBook D; ## initialize (clean) internal maps of labels |
21 | ComputeFun D $F2; ## compute the function |
22 | GetShape D $F2:2 Box2; ## check result |
23 | whatis Box2 |
7b5e532f |
24 | GetReference D $B2; ## refers to result NS |
40093367 |
25 | |
26 | |
27 | #2 |
28 | NewCommand D |
29 | set FTr1 [PTranslateDXYZ D $B2 150 40 90] |
30 | ComputeFun D $FTr1; ## function recomputation |
31 | GetShape D $FTr1:2 Box2; ## get modified result |
32 | |
33 | #3 |
34 | NewCommand D |
35 | explode Box2 F |
36 | explode Box2_1 E |
37 | set Sel1 [AttachShape D Box2_1_1 ${B2} ${B2} 1]; ## set attachment |
38 | set FTr2 [PTranslateAlongLine D $B2 $Sel1 210] |
39 | ComputeFun D $FTr2 |
40 | GetShape D $FTr2:2 Box3 |
41 | |
42 | #4 |
43 | NewCommand D |
44 | explode Box3 F |
45 | explode Box3_1 E |
46 | set Sel4 [AttachShape D Box3_1_3 ${B2} ${B2} 1]; |
47 | set FR1 [PRotateRoundLine D $B2 $Sel4 120] |
48 | ComputeFun D $FR1 |
49 | GetShape D $FR1:2 Box4 |
50 | |
51 | #5 |
52 | NewCommand D |
53 | explode Box4 F |
54 | set Sel5 [AttachShape D Box4_3 ${B2} ${B2} 1]; |
55 | set FM [PMirror D $B2 $Sel5] |
56 | ComputeFun D $FM |
57 | GetShape D $FM:2 Box5 |
58 | |
59 | #6 |
60 | NewCommand D |
61 | explode Box5 F |
62 | explode Box5_1 E |
63 | set Sel6 [AttachShape D Box5_1_3 ${B2} ${B2} 1]; |
64 | AddDriver D Fillet |
65 | set Fill [AddFillet D $B2 25 $Sel6 0] |
66 | ComputeFun D $Fill |
67 | GetShape D $Fill:2 SF |
68 | |
69 | #7 |
70 | NewCommand D |
71 | set SL [TestSingleSelection D $B2 1] |
72 | set SL2 [TestMultipleSelection D $B2 0] |
73 | |
74 | #7 modification |
75 | NewCommand D |
76 | BoxDX D $B2 290 |
77 | |
78 | #8 order of recomputation |
79 | NewCommand D |
80 | InitLogBook D; ## to be initialized before any recomputation of impacted functions set (if attachments are presented) |
81 | ComputeFun D $F2; |
82 | ComputeFun D $FTr1; |
83 | ComputeFun D $Sel1:1 |
84 | ComputeFun D $FTr2 |
85 | ComputeFun D $Sel4:1 |
86 | ComputeFun D $FR1 |
87 | ComputeFun D $Sel5:1 |
88 | ComputeFun D $FM |
89 | ComputeFun D $Sel6:1 |
90 | ComputeFun D $Fill |
91 | GetShape D $Fill:2 SF-new |
92 | |
93 | SolveFlatFrom D $SL |
94 | |
95 | NewCommand D |