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