1 # =================== OCAF ======================
4 # Testing purpose: Naming selection mechanism
6 # Test case: F7 (test special cases of type migration)
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 4 selections (Select edges 8,9, 11+, 11)
19 # ===============================================
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
35 # referes to result NS
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;
50 set Lin2 [ AddLine3D D 1 $Pnt1 $Pnt2 $Pnt3 $Pnt4]
52 GetShape D $Lin2:1:2 L1;
56 AddDriver D Prism Box PTxyz
57 set Prism [AddPrism D $Lin2 300 1]
59 GetShape D $Prism:1:2 Pr
60 GetReference D $Prism; ## check is reference set
64 set B1 [AddBox D 400 140 600];
66 GetShape D $B1:1:2 Box;
70 set FTr1 [PTranslateDXYZ D $B1 -100 -20 -100]
72 GetShape D $B1:2:2 Box
76 AddDriver D Comm Cut Fuse
77 set Com1 [AddCommon D $Prism $B1]
84 AddDriver D Attach Cyl
85 set Sel1 [AttachShape D Pr_6 ${Prism} ${Prism} 0]; ## set attachment
86 set Cyl [AddCyl D 70 515 ${Sel1}]
88 GetShape D $Cyl:1:2 CylS
92 set FTr1 [PTranslateDXYZ D $Cyl -100 200 170]
94 GetShape D $Cyl:2:2 CylS
98 set Cut1 [AddCut D $Prism $Cyl]
100 GetShape D $Cut1:2 Pr
103 #10 Select edges 8,9, 11 (test special cases of type migration)
105 erase Pr_1 Pr_2 Pr_3 Pr_4 Pr_5 Pr_6 Pr_7 Pr_8 Pr_9 Pr_10 Pr_11 Pr_12 Pr_13 Pr_14 Pr_15 Pr_16 Pr_17
109 set Sel8 [AttachShape D Pr_8 ${Prism} ${Prism} 0]; ## should return Compound of two edges
110 set Sel9 [AttachShape D Pr_9 ${Prism} ${Prism} 1]; ## should return Compound of two edges
111 set Sel11 [AttachShape D Pr_11 ${Prism} ${Prism} 1];
112 set Sel12 [AttachShape D Pr_11 ${Prism} ${Prism} 0];
115 PntOffset D $Pnt1 40 25 skip
120 ComputeFun D $Prism:1
127 GetShape D $Cut1:2 Pr
131 ComputeFun D $Sel11:1
132 ComputeFun D $Sel12:1