efd4b232 |
1 | # =================== OCAF ====================== |
2 | # Naming |
3 | # |
4 | # Testing purpose: Naming selection mechanism |
5 | # |
6 | # Test case: E8 (ShapeOrientation is not used) |
7 | # 1. Create box B2 |
8 | # 2. Create sectioned revolution R1 ($SRev1) |
9 | # 3. Create sectioned revolution R2 ($SRev2) |
10 | # 4. Create sectioned revolution R3 ($SRev3) |
11 | # 5. ($FS1)R1 = Fuse (R1, R2) |
12 | # 6. ($FS2)R1 = Fuse (R1, R3) |
13 | # 7. Make selections for all sub-shapes |
14 | # 8. Modify B2 |
15 | # 9. Recompute modeling functions |
16 | # 10. Recompute selections |
17 | # =============================================== |
18 | |
40093367 |
19 | #pload FULL |
40093367 |
20 | erase |
21 | Close D |
24de79c3 |
22 | |
e837410d |
23 | NewDocument D BinOcaf |
40093367 |
24 | |
25 | #Drivers' nick-names: |
26 | #Box|Sph|Cyl|Cut|Fuse|Prism|SecRevol|FulRevol|PTxyz|PTALine|PRLine|PMirr|Fillet|Attach|XAttach |
27 | # order of functions recomputation should be defined out of the tool (by end user) |
28 | |
40093367 |
29 | ## Test of transformation functions |
30 | AddDriver D Box Attach PTxyz PTALine PRLine PMirr Sph Prism FulRevol SecRevol |
efd4b232 |
31 | |
40093367 |
32 | #1 - create box using more flexible set of commands |
33 | NewCommand D |
34 | isos 12 |
35 | set B2 [AddObject D]; ## add object |
36 | set F2 [AddFunction D $B2 Box]; ## add function |
37 | BoxDX D $B2 190; ## set argumets of this function |
38 | BoxDY D $B2 290 |
39 | BoxDZ D $B2 390 |
40 | InitLogBook D; ## initialize (clean) internal maps of labels |
41 | ComputeFun D $F2; ## compute the function |
42 | GetShape D $F2:2 Box2; ## check result |
43 | fit |
44 | whatis Box2 |
45 | GetReference D $B2; ## referes to result NS |
46 | |
47 | #2 Revol Sectioned |
48 | explode Box2 F |
49 | explode Box2_3 E |
50 | set SBas1 [AttachShape D Box2_3 ${B2} ${B2} 0] |
51 | set SAx1 [AttachShape D Box2_3_2 ${B2} ${B2} 0] |
52 | set SRev1 [AddRevol D $SBas1 $SAx1 120 0] |
53 | ComputeFun D $SRev1:1 |
54 | GetShape D $SRev1:1:2 R1 |
55 | don R1 |
56 | |
57 | |
58 | #3 |
59 | explode R1 F |
60 | explode R1_5 E |
61 | set SBas2 [AttachShape D R1_5 ${SRev1} ${SRev1} 0] |
62 | set SAx2 [AttachShape D R1_5_2 ${SRev1} ${SRev1} 0] |
63 | set SRev2 [AddRevol D $SBas2 $SAx2 120 0] |
64 | ComputeFun D $SRev2:1 |
65 | GetShape D $SRev2:1:2 R2 |
66 | |
67 | #4 |
68 | explode R2 F |
69 | explode R2_5 E |
70 | set SBas3 [AttachShape D R2_5 ${SRev2} ${SRev2} 0] |
71 | set SAx3 [AttachShape D R2_5_2 ${SRev2} ${SRev2} 0] |
72 | set SRev3 [AddRevol D $SBas3 $SAx3 120 0] |
73 | ComputeFun D $SRev3:1 |
74 | GetShape D $SRev3:1:2 R2 |
75 | |
efd4b232 |
76 | #5 |
40093367 |
77 | AddDriver D Fuse |
78 | set FS1 [AddFuse D $SRev1 $SRev2] |
79 | ComputeFun D $FS1 |
80 | GetShape D $FS1:2 R1 |
81 | |
efd4b232 |
82 | #6 |
40093367 |
83 | set FS2 [AddFuse D $SRev1 $SRev3] |
84 | ComputeFun D $FS2 |
85 | GetShape D $FS2:2 R1 |
86 | |
efd4b232 |
87 | #7 |
40093367 |
88 | NewCommand D |
89 | set SL [TestSingleSelection D $B2 0] |
90 | set SL2 [TestMultipleSelection D $B2 0] |
91 | |
efd4b232 |
92 | #8 |
40093367 |
93 | NewCommand D |
94 | BoxDZ D $B2 420 |
95 | |
efd4b232 |
96 | #9 order of recomputation |
40093367 |
97 | NewCommand D |
98 | InitLogBook D; ## to be initialized before any recomputation of impacted functions set (if attachments are presented) |
99 | ComputeFun D $F2; |
100 | ComputeFun D $SBas1:1 |
101 | ComputeFun D $SAx1:1 |
102 | ComputeFun D $SRev1:1 |
103 | ComputeFun D $SBas2:1 |
104 | ComputeFun D $SAx2:1 |
105 | ComputeFun D $SRev2:1 |
106 | ComputeFun D $SBas3:1 |
107 | ComputeFun D $SAx3:1 |
108 | ComputeFun D $SRev3:1 |
109 | ComputeFun D $FS1 |
110 | ComputeFun D $FS2 |
111 | GetShape D $FS2:2 R1 |
112 | |
efd4b232 |
113 | #10 |
40093367 |
114 | SolveFlatFrom D $SL |
115 | NewCommand D |
116 | |