1 # =================== OCAF ======================
4 # Testing purpose: Naming selection mechanism
6 # Test case: F6 (ShapeOrientation is not used)
7 # 1. Create 4 points: $Pnt1 - $Pnt4
8 # 2. Create closed line $Lin2
9 # 3. Create prism Pr ($Prism)
11 # 5. Translate box $B1 along XYZ
12 # 6. $Com1 = Common ($Prism, $B1)
13 # 7. Add cylinder $Cyl
14 # 8. Translate cylinder $Cyl along XYZ
15 # 9. Cut $Cut1 = Cut ($Prism, $Cyl)
16 # 10. Make selections for all sub-shapes
18 # 12. Recompute modeling functions
19 # 13. Recompute selections
20 # ===============================================
30 AddDriver D PntXYZ PntRLT Line3D Attach;
31 set Pnt1 [AddPoint D 0 0 0]; ## add point1
32 ComputeFun D $Pnt1:1; ## compute function
33 GetShape D $Pnt1:1:2 P1; ## check result
36 GetReference D $Pnt1; ## check is reference set
38 set Pnt2 [AddPoint D 0 200 0];
40 set Pnt3 [AddPoint D 200 200 0];
42 set Pnt4 [AddPoint D 200 0 0];
44 GetShape D $Pnt2:1:2 P2;
45 GetShape D $Pnt3:1:2 P3;
46 GetShape D $Pnt4:1:2 P4;
51 set Lin2 [ AddLine3D D 1 $Pnt1 $Pnt2 $Pnt3 $Pnt4]
53 GetShape D $Lin2:1:2 L1;
57 AddDriver D Prism Box PTxyz
58 set Prism [AddPrism D $Lin2 300 1]
60 GetShape D $Prism:1:2 Pr
61 GetReference D $Prism; ## check is reference set
65 set B1 [AddBox D 400 140 600];
67 GetShape D $B1:1:2 Box;
71 set FTr1 [PTranslateDXYZ D $B1 -100 -20 -100]
73 GetShape D $B1:2:2 Box
77 AddDriver D Comm Cut Fuse
78 set Com1 [AddCommon D $Prism $B1]
85 AddDriver D Attach Cyl
86 set Sel1 [AttachShape D Pr_6 ${Prism} ${Prism} 0]; ## set attachment
87 set Cyl [AddCyl D 70 515 ${Sel1}]
89 GetShape D $Cyl:1:2 CylS
93 set FTr1 [PTranslateDXYZ D $Cyl -100 200 170]
95 GetShape D $Cyl:2:2 CylS
97 #9 Cut Prism by Cylinder
98 set Cut1 [AddCut D $Prism $Cyl]
100 GetShape D $Cut1:2 Pr
105 set SL [TestSingleSelection D $Prism 0]
106 set SL2 [TestMultipleSelection D $Prism 0]
112 PntOffset D $Pnt1 20 25 skip
118 ComputeFun D $Prism:1
125 GetShape D $Cut1:2 Pr
128 #13 recomputation of entities of the TestSelection commands