1 # =================== OCAF ======================
4 # Testing purpose: Naming selection mechanism
6 # Test case: E7 (ShapeOrientation is not used)
8 # 2. Create prism Pr ($Prism)
9 # 3. Create full revolution R1
10 # 4. Translate R1 along XYZ
11 # 5. FS = Fuse (Pr, R1)
12 # 6. Create sectioned revolution R2
13 # 7. FS2 = Fuse (B2, R2)
14 # 8. FS3 = Fuse (B2, Prism)
15 # 9. Make selections for all sub-shapes
17 # 11. Recompute modeling functions
18 # 12. Recompute selections
19 # ===============================================
28 #Box|Sph|Cyl|Cut|Fuse|Prism|SecRevol|FulRevol|PTxyz|PTALine|PRLine|PMirr|Fillet|Attach|XAttach
29 # order of functions recomputation should be defined out of the tool (by end user)
30 ## Test of transformation functions
31 AddDriver D Box Attach PTxyz PTALine PRLine PMirr Sph Prism FulRevol SecRevol
33 #1 - create box using more flexible set of commands
36 set B2 [AddObject D]; ## add object
37 set F2 [AddFunction D $B2 Box]; ## add function
38 BoxDX D $B2 190; ## set argumets of this function
41 InitLogBook D; ## initialize (clean) internal maps of labels
42 ComputeFun D $F2; ## compute the function
43 GetShape D $F2:2 Box2; ## check result
46 GetReference D $B2; ## referes to result NS
49 #2 Prism (after step #1)
51 set Sel1 [AttachShape D Box2_1 ${B2} ${B2} 0]
52 set Prism [AddPrism D $Sel1 300 0]
54 GetShape D $Prism:1:2 Pr
56 PrismHeight D $Prism 500
58 GetShape D $Prism:1:2 Pr
65 set SBas1 [AttachShape D Box2_3 ${B2} ${B2} 0]
66 set SAx1 [AttachShape D Box2_3_3 ${B2} ${B2} 0]
67 set FRev [AddRevol D $SBas1 $SAx1]
69 GetShape D $FRev:1:2 R1
73 set FTr1 [PTranslateDXYZ D $FRev -250 0 0]
74 ComputeFun D $FTr1; ## function recomputation
75 GetShape D $FTr1:2 R1; ## get modified result
79 set FS1 [AddFuse D $Prism $FRev]
86 GetShape D $F2:2 Box2;
89 set SBas2 [AttachShape D Box2_2 ${B2} ${B2} 0]
90 set SAx2 [AttachShape D Box2_2_3 ${B2} ${B2} 0]
91 set SRev [AddRevol D $SBas2 $SAx2 120 0]
93 GetShape D $SRev:1:2 R2
96 set FS2 [AddFuse D $B2 $SRev]
98 GetShape D $FS2:2 Box2
101 set FS3 [AddFuse D $B2 $Prism]
103 GetShape D $FS3:2 Box2
107 set SL [TestSingleSelection D $B2 0]
108 set SL2 [TestMultipleSelection D $B2 0]
109 # both have failed units!!!
115 #11 order of recomputation
117 InitLogBook D; ## to be initialized before any recomputation of impacted functions set (if attachments are presented)
120 ComputeFun D $Prism:1
121 ComputeFun D $SBas1:1
126 ComputeFun D $SBas2:1
131 GetShape D $FS3:2 Box2