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 # ===============================================
29 AddDriver D PntXYZ PntRLT Line3D Attach;
30 set Pnt1 [AddPoint D 0 0 0]; ## add point1
31 ComputeFun D $Pnt1:1; ## compute function
32 GetShape D $Pnt1:1:2 P1; ## check result
35 GetReference D $Pnt1; ## check is reference set
37 set Pnt2 [AddPoint D 0 200 0];
39 set Pnt3 [AddPoint D 200 200 0];
41 set Pnt4 [AddPoint D 200 0 0];
43 GetShape D $Pnt2:1:2 P2;
44 GetShape D $Pnt3:1:2 P3;
45 GetShape D $Pnt4:1:2 P4;
49 set Lin2 [ AddLine3D D 1 $Pnt1 $Pnt2 $Pnt3 $Pnt4]
51 GetShape D $Lin2:1:2 L1;
55 AddDriver D Prism Box PTxyz
56 set Prism [AddPrism D $Lin2 300 1]
58 GetShape D $Prism:1:2 Pr
59 GetReference D $Prism; ## check is reference set
63 set B1 [AddBox D 400 140 600];
65 GetShape D $B1:1:2 Box;
69 set FTr1 [PTranslateDXYZ D $B1 -100 -20 -100]
71 GetShape D $B1:2:2 Box
75 AddDriver D Comm Cut Fuse
76 set Com1 [AddCommon D $Prism $B1]
83 AddDriver D Attach Cyl
84 set Sel1 [AttachShape D Pr_6 ${Prism} ${Prism} 0]; ## set attachment
85 set Cyl [AddCyl D 70 515 ${Sel1}]
87 GetShape D $Cyl:1:2 CylS
91 set FTr1 [PTranslateDXYZ D $Cyl -100 200 170]
93 GetShape D $Cyl:2:2 CylS
97 set Cut1 [AddCut D $Prism $Cyl]
102 #10 Select edges 8,9, 11 (test special cases of type migration)
104 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
108 set Sel8 [AttachShape D Pr_8 ${Prism} ${Prism} 0]; ## should return Compound of two edges
109 set Sel9 [AttachShape D Pr_9 ${Prism} ${Prism} 1]; ## should return Compound of two edges
110 set Sel11 [AttachShape D Pr_11 ${Prism} ${Prism} 1];
111 set Sel12 [AttachShape D Pr_11 ${Prism} ${Prism} 0];
114 PntOffset D $Pnt1 40 25 skip
119 ComputeFun D $Prism:1
126 GetShape D $Cut1:2 Pr
130 ComputeFun D $Sel11:1
131 ComputeFun D $Sel12:1