1 # ============= OCAF ============================
4 # Testing purpose: Naming selection mechanism
6 # Test case: F1 (ShapeOrientation is not used)
9 # 2. Create cylinder $Cyl
10 # 3. Translate $Cyl along XYZ
11 # 4. $CS = Cut ($B2, $Cyl)
12 # 5. Create 4 points as attachments of box $B2
13 # 6. Create 4 spheres ($Sph1, $Sph2, $Sph9, $Sph11)
14 # 7. Rotate spheres $Sph1, $Sph2 around line
15 # 8. Fuse all spheres with box B2
16 # 9. Make selection for all sub-shapes
18 # 11. Recompute modeling functions
19 # 12. Recompute selections
20 # ===============================================
26 AddDriver D Box Cyl Sph Attach XAttach PTxyz PTALine PRLine PMirr Cut Fuse Prism FulRevol SecRevol Fillet
30 set B2 [AddObject D]; ## add object
31 set F2 [AddFunction D $B2 Box]; ## add function
32 BoxDX D $B2 190; ## set arguments of this function
35 InitLogBook D; ## initialize (clean) internal maps of labels
36 ComputeFun D $F2; ## compute the function
37 GetShape D $F2:2 Box2; ## check result
45 set Sel1 [AttachShape D Box2_1_1 ${B2} ${B2} 1]; ## set attachment
46 ## AddDriver D Attach Cyl
47 set Cyl [AddCyl D 50 515 ${Sel1}]
49 GetShape D $Cyl:1:2 CylS
53 set FTr1 [PTranslateDXYZ D $Cyl 100 0 0]
55 GetShape D $Cyl:2:2 CylS
59 set CS [AddCut D $B2 $Cyl]
66 #5 set attachments - vertexes
68 set SPnt1 [AttachShape D S_1 ${B2} ${B2} 0]; ## set attachment
69 set SPnt2 [AttachShape D S_2 ${B2} ${B2} 0]; ## set attachment
70 set SPnt9 [AttachShape D S_9 ${B2} ${B2} 0]; ## set attachment
71 set SPnt11 [AttachShape D S_11 ${B2} ${B2} 0]; ## set attachment
75 set Sph1 [AddSphere D $SPnt1 15]
77 GetShape D $Sph1:1:2 Sp1
79 set Sph2 [AddSphere D $SPnt2 15]
81 GetShape D $Sph2:1:2 Sp2
83 set Sph9 [AddSphere D $SPnt9 15]
85 GetShape D $Sph9:1:2 Sp9
87 set Sph11 [AddSphere D $SPnt11 15]
89 GetShape D $Sph11:1:2 Sp11
93 set Sel61 [AttachShape D Box2_1 ${B2} ${B2} 0];
94 set FR1 [PRotateRoundLine D $Sph1 $Sel61 120]
98 set Sel62 [AttachShape D Box2_1 ${B2} ${B2} 0];
99 set FR2 [PRotateRoundLine D $Sph2 $Sel62 120]
101 GetShape D $FR2:2 Sp2
104 set FS1 [AddFuse D $B2 $Sph1]
108 set FS2 [AddFuse D $B2 $Sph2]
113 set FS9 [AddFuse D $B2 $Sph9]
117 set FS11 [AddFuse D $B2 $Sph11]
123 set SL [TestSingleSelection D $B2 0]
124 set SL2 [TestMultipleSelection D $B2 0]
139 ComputeFun D $SPnt1:1
140 ComputeFun D $SPnt2:1
141 #ComputeFun D $SPnt5:1
142 #ComputeFun D $SPnt6:1
143 #ComputeFun D $SPnt7:1
144 ComputeFun D $SPnt9:1
145 ComputeFun D $SPnt11:1
146 #ComputeFun D $SPnt12:1
149 ComputeFun D $Sel61:1
151 ComputeFun D $Sel62:1
153 #ComputeFun D $Sph5:1 ## because 5,6,7,12 gives NOT VALID result
154 #ComputeFun D $Sph6:1
155 #ComputeFun D $Sph7:1
157 ComputeFun D $Sph11:1
158 #ComputeFun D $Sph12:1