1 # ============= OCAF ============================
4 # Testing purpose: Naming selection mechanism
6 # Test case: F3 (ShapeOrientation is not used)
9 # 2. Create sphere $Sph0
10 # 3. Create sphere $Sph1 and move it along XYZ
11 # 4. Create sphere $Sph2 and move it along XYZ
12 # 5. Create sphere $Sph3 and rotate it around line and move after along XYZ
13 # 6. Create sphere $Sph4 and move it along XYZ
14 # 7. Cut spheres: $Cut1 = Cut($Sph0, $Sph1)
15 # $Cut2 = Cut($Sph0, $Sph2)
16 # $Cut3 = Cut($Sph0, $Sph3)
17 # $Cut4 = Cut($Sph0, $Sph4)
18 # 8. Make selection for all sub-shapes
20 # 10. Recompute modeling functions
21 # 11. Recompute selections
22 # ===============================================
29 NewDocument D MDTV-Standard
31 #1 - create Box using short-cut
33 AddDriver D Box; ## add box driver to driver table
34 set B1 [AddBox D 130 140 150]; ## add box
35 ComputeFun D $B1:1; ## compute box1 function
36 GetShape D $B1:1:2 Box1; ## check result
38 # referes to result NS
39 GetReference D $B1; ## check is reference set
42 #2 - create main sphere Sp0
43 AddDriver D Cyl Sph Attach XAttach PTxyz PTALine PRLine PMirr Cut Fuse Prism FulRevol SecRevol Fillet
46 set SPnt1 [AttachShape D Box1_1 ${B1} ${B1} 0]; ## set attachment
49 set Sph0 [AddSphere D $SPnt1 250]
51 GetShape D $Sph0:1:2 Sp0
55 set Sph1 [AddSphere D $SPnt1 30]
57 GetShape D $Sph1:1:2 Sp1
60 set FTr1 [PTranslateDXYZ D $Sph1 0 -251 0]
62 GetShape D $Sph1:2:2 Sp1
66 set Sph2 [AddSphere D $SPnt1 30]
68 GetShape D $Sph2:1:2 Sp2
70 set FTr2 [PTranslateDXYZ D $Sph2 0 251 0]
72 GetShape D $Sph2:2:2 Sp2
76 set Sph3 [AddSphere D $SPnt1 30]
78 GetShape D $Sph3:1:2 Sp3
81 set Sel3 [AttachShape D Box1_1 ${B1} ${B1} 0];
82 set FR3 [PRotateRoundLine D $Sph3 $Sel3 120]
86 set FTr3 [PTranslateDXYZ D $Sph3 -251 0 0]
88 GetShape D $Sph3:3:2 Sp3
92 set Sph4 [AddSphere D $SPnt1 30]
94 GetShape D $Sph4:1:2 Sp4
96 set FTr4 [PTranslateDXYZ D $Sph4 251 -40 0]
98 GetShape D $Sph4:2:2 Sp4
101 set Cut1 [AddCut D $Sph0 $Sph1]
103 GetShape D $Cut1:2 Sp0
105 set Cut2 [AddCut D $Sph0 $Sph2]
107 GetShape D $Cut2:2 Sp0
109 set Cut3 [AddCut D $Sph0 $Sph3]
111 GetShape D $Cut3:2 Sp0
113 set Cut4 [AddCut D $Sph0 $Sph4]
115 GetShape D $Cut4:2 Sp0
120 set SL [TestSingleSelection D $Sph0 0]
121 set SL2 [TestMultipleSelection D $Sph0 0]
129 InitLogBook D; ## to be initialized before any recomputation of impacted functions set (if attachments are presented)
131 ComputeFun D $SPnt1:1
148 GetShape D $Cut4:2 Sp0
151 #11 recomputation of entities of the TestSelection commands