1 # =================== OCAF ======================
4 # Testing purpose: Naming selection mechanism
6 # Test case: F5 (ShapeOrientation is not used)
7 # 1. Create 4 points: $Pnt1 - $Pnt4
8 # 2. Create closed line $Lin2
9 # 3. Create prism Pr ($Prism)
10 # 4. Create 2 prisms $Prism1, $Prism2
11 # 5. $FS1 = Fuse ($Prism1, $Prism2); $FS2 = Fuse ($Prism1, $Prism3)
12 # 6. Create sphere $Sph
13 # 7. Cut sphere $Cut1 = Cut ($Prism, $Sph)
14 # 8. Make selections for all sub-shapes
16 # 10. Recompute modeling functions
17 # 11. Recompute selections
18 # ===============================================
28 AddDriver D PntXYZ PntRLT Line3D Attach;
29 set Pnt1 [AddPoint D 0 0 0]; ## add point1
30 ComputeFun D $Pnt1:1; ## compute function
31 GetShape D $Pnt1:1:2 P1; ## check result
34 GetReference D $Pnt1; ## check is reference set
36 set Pnt2 [AddPoint D 0 200 0];
38 set Pnt3 [AddPoint D 200 200 0];
40 set Pnt4 [AddPoint D 200 0 0];
42 GetShape D $Pnt2:1:2 P2;
43 GetShape D $Pnt3:1:2 P3;
44 GetShape D $Pnt4:1:2 P4;
48 set Lin2 [ AddLine3D D 1 $Pnt1 $Pnt2 $Pnt3 $Pnt4]
50 GetShape D $Lin2:1:2 L1;
55 set Prism [AddPrism D $Lin2 300 0]
57 GetShape D $Prism:1:2 Pr
58 GetReference D $Prism; ## check is reference set
63 set Bas1 [AttachShape D Pr_1 ${Prism} ${Prism} 1]
64 set Bas2 [AttachShape D Pr_4 ${Prism} ${Prism} 1]
66 set Prism2 [AddPrism D $Bas1 300 0]
67 ComputeFun D $Prism2:1
68 GetShape D $Prism2:1:2 Pr2
71 set Prism3 [AddPrism D $Bas2 500 0]
72 ComputeFun D $Prism3:1
73 GetShape D $Prism3:1:2 Pr3
77 AddDriver D Fuse Sph Cut
78 set FS1 [AddFuse D $Prism $Prism2]
82 set FS2 [AddFuse D $Prism $Prism3]
87 set Sph [AddSphere D $Pnt3 150]
90 GetShape D $Sph:1:2 Sp
94 set Cut1 [AddCut D $Prism $Sph]
101 set SL [TestSingleSelection D $Prism 0]
102 set SL2 [TestMultipleSelection D $Prism 0]
107 PntOffset D $Pnt1 50 30 skip
113 ComputeFun D $Prism:1
116 ComputeFun D $Prism2:1
117 ComputeFun D $Prism3:1
123 GetShape D $Cut1:2 Pr
124 #GetShape D $Prism:1:2 Pr
125 #GetShape D $Prism2:1:2 Pr2
126 #GetShape D $Prism3:1:2 Pr3
128 #11 recomputation of entities of the TestSelection commands