efd4b232 |
1 | # =================== OCAF ====================== |
2 | # Naming |
3 | # |
4 | # Testing purpose: Naming selection mechanism |
5 | # |
6 | # Test case: F4 (ShapeOrientation is not used) |
7 | # 1. Create box $B2 |
8 | # 2. Create prism Pr1 ($Prism1) |
9 | # 3. Create prism Pr2 ($Prism2) |
10 | # 4. $FS1 = Fuse ($Prism1, $Prism2) |
11 | # 5. Make selections for all sub-shapes |
12 | # 6. Modify B2 |
13 | # 7. Recompute modeling functions |
14 | # 8. Recompute selections |
15 | # =============================================== |
16 | |
40093367 |
17 | #pload FULL |
40093367 |
18 | erase |
19 | Close D |
24de79c3 |
20 | |
40093367 |
21 | NewDocument D MDTV-Standard |
22 | |
23 | #Drivers' nick-names: |
24 | #Box|Sph|Cyl|Cut|Fuse|Prism|SecRevol|FulRevol|PTxyz|PTALine|PRLine|PMirr|Fillet|Attach|XAttach |
25 | # order of functions recomputation should be defined out of the tool (by end user) |
40093367 |
26 | AddDriver D Box Attach PTxyz PTALine PRLine PMirr Sph Prism FulRevol SecRevol |
efd4b232 |
27 | |
40093367 |
28 | #1 - create box using more flexible set of commands |
29 | NewCommand D |
30 | isos 12 |
31 | set B2 [AddObject D]; ## add object |
32 | set F2 [AddFunction D $B2 Box]; ## add function |
33 | BoxDX D $B2 190; ## set argumets of this function |
34 | BoxDY D $B2 290 |
35 | BoxDZ D $B2 390 |
36 | InitLogBook D; ## initialize (clean) internal maps of labels |
37 | ComputeFun D $F2; ## compute the function |
38 | GetShape D $F2:2 Box2; ## check result |
39 | fit |
40 | whatis Box2 |
41 | GetReference D $B2; ## referes to result NS |
42 | |
43 | |
44 | #2 Prism 1 |
45 | NewCommand D |
46 | explode Box2 F |
47 | set Bas1 [AttachShape D Box2_1 ${B2} ${B2} 0] |
48 | set Prism1 [AddPrism D $Bas1 300 0] |
49 | ComputeFun D $Prism1:1 |
50 | GetShape D $Prism1:1:2 Pr1 |
51 | |
52 | PrismHeight D $Prism1 500 |
53 | ComputeFun D $Prism1:1 |
54 | GetShape D $Prism1:1:2 Pr1 |
55 | fit |
56 | |
57 | |
58 | #3 Prism 2 |
59 | NewCommand D |
60 | explode Pr1 F |
61 | set Bas2 [AttachShape D Pr1_1 ${Prism1} ${Prism1} 0] |
62 | set Prism2 [AddPrism D $Bas2 500 0] |
63 | ComputeFun D $Prism2:1 |
64 | GetShape D $Prism2:1:2 Pr2 |
65 | |
66 | #4 => fuse |
67 | NewCommand D |
68 | AddDriver D Fuse |
69 | set FS1 [AddFuse D $Prism1 $Prism2] |
70 | ComputeFun D $FS1 |
71 | GetShape D $FS1:2 Pr1 |
72 | |
73 | |
74 | |
75 | #5 |
76 | NewCommand D |
77 | set SL [TestSingleSelection D $Prism1 0] |
78 | set SL2 [TestMultipleSelection D $Prism1 0] |
79 | # both have failed units!!! |
80 | |
efd4b232 |
81 | #6 |
40093367 |
82 | NewCommand D |
83 | BoxDZ D $B2 420 |
84 | |
efd4b232 |
85 | #7 order of recomputation |
40093367 |
86 | NewCommand D |
87 | InitLogBook D; ## to be initialized before any recomputation of impacted functions set (if attachments are presented) |
88 | ComputeFun D $F2; |
89 | ComputeFun D $Bas1:1 |
90 | ComputeFun D $Prism1:1 |
91 | ComputeFun D $Bas2:1 |
92 | ComputeFun D $Prism2:1 |
93 | ComputeFun D $FS1 |
94 | |
efd4b232 |
95 | |
96 | #8 |
40093367 |
97 | SolveFlatFrom D $SL |
98 | NewCommand D |