0031939: Coding - correction of spelling errors in comments [part 7]
[occt.git] / tests / caf / named_shape / E9
1 # ============= OCAF ============================
2 # Naming
3 #
4 # Testing purpose: Naming selection mechanism 
5 #
6 # Test case: E9 (ShapeOrientation is not used)
7 #
8 # 1. Create Box B1
9 # 2. Create 4 spheres ($Sph1 - $Sph4)
10 # 3. Rotate all spheres around line
11 # 4. Fuse all spheres with box B1
12 # 5. Make selection for all sub-shapes
13 # 6. Modify B1
14 # 7. Recompute modeling functions
15 # 8. Recompute selections
16 # ===============================================
17
18 erase 
19 Close D 
20
21 NewDocument D BinOcaf
22 isos 12
23
24 #1 - create Box using short-cut
25 NewCommand D
26 AddDriver D Box;                        ## add box driver to driver table
27 set B1 [AddBox D 130 140 150];          ## add box 
28 ComputeFun D $B1:1;                     ## compute box1 function
29 GetShape D $B1:1:2 Box1;                ## check result
30 whatis Box1
31 # refers to result NS
32 GetReference D $B1;                     ## check is reference set 
33
34
35 #2 - create 4 spheres
36 AddDriver D Cyl Sph Attach XAttach PTxyz PTALine PRLine PMirr Cut Fuse Prism FulRevol SecRevol Fillet
37 NewCommand D
38 explode Box1 V
39 set SPnt1 [AttachShape D Box1_1 ${B1} ${B1} 0]; ## set attachment
40 set SPnt2 [AttachShape D Box1_2 ${B1} ${B1} 0]; ## set attachment
41 set SPnt3 [AttachShape D Box1_3 ${B1} ${B1} 0]; ## set attachment
42 set SPnt4 [AttachShape D Box1_4 ${B1} ${B1} 0]; ## set attachment
43
44 set Sph1 [AddSphere D $SPnt1 25]
45 ComputeFun D $Sph1:1
46 GetShape D $Sph1:1:2 Sp1
47
48 set Sph2 [AddSphere D $SPnt2 25]
49 ComputeFun D $Sph2:1
50 GetShape D $Sph2:1:2 Sp2
51
52 set Sph3 [AddSphere D $SPnt3 25]
53 ComputeFun D $Sph3:1
54 GetShape D $Sph3:1:2 Sp3
55
56 set Sph4 [AddSphere D $SPnt4 25]
57 ComputeFun D $Sph4:1
58 GetShape D $Sph4:1:2 Sp4
59 NewCommand D
60
61 #3 Rotate spheres
62 explode Box1 E
63 set Sel1 [AttachShape D Box1_1 ${B1} ${B1} 0];
64 set FR1 [PRotateRoundLine D $Sph1 $Sel1 120]
65 ComputeFun D $FR1 
66 GetShape D $FR1:2 Sp1
67
68 set Sel2 [AttachShape D Box1_1 ${B1} ${B1} 0];
69 set FR2 [PRotateRoundLine D $Sph2 $Sel2 120]
70 ComputeFun D $FR2
71 GetShape D $FR2:2 Sp2
72
73 set Sel3 [AttachShape D Box1_3 ${B1} ${B1} 0];
74 set FR3 [PRotateRoundLine D $Sph3 $Sel3 120]
75 ComputeFun D $FR3
76 GetShape D $FR3:2 Sp3
77
78 set Sel4 [AttachShape D Box1_3 ${B1} ${B1} 0];
79 set FR4 [PRotateRoundLine D $Sph4 $Sel4 120]
80 ComputeFun D $FR4
81 GetShape D $FR4:2 Sp4
82 NewCommand D
83
84 #4 Fuse spheres
85 set FS1 [AddFuse D $B1 $Sph1]
86 ComputeFun D $FS1
87 GetShape D $FS1:2 Box1
88
89 set FS2 [AddFuse D $B1 $Sph2]
90 ComputeFun D $FS2
91 GetShape D $FS2:2 Box1
92
93 set FS3 [AddFuse D $B1 $Sph3]
94 ComputeFun D $FS3
95 GetShape D $FS3:2 Box1
96
97 set FS4 [AddFuse D $B1 $Sph4]
98 ComputeFun D $FS4
99 GetShape D $FS4:2 Box1
100
101
102 #5 test selection
103 NewCommand D
104 set SL [TestSingleSelection D $B1 0]
105 set SL2 [TestMultipleSelection D $B1 0]
106
107 #6 modification
108 NewCommand D
109 BoxDX D $B1 210
110 BoxDZ D $B1 270
111
112 #7 recomputation
113 NewCommand D
114 InitLogBook D;          ## to be initialized before any recomputation of impacted functions set (if attachments are presented)
115 ComputeFun D $B1:1
116 ComputeFun D $SPnt1:1
117 ComputeFun D $SPnt2:1
118 ComputeFun D $SPnt3:1
119 ComputeFun D $SPnt4:1
120 ComputeFun D $Sph1:1
121 ComputeFun D $Sph2:1
122 ComputeFun D $Sph3:1
123 ComputeFun D $Sph4:1
124 ComputeFun D $Sel1:1
125 ComputeFun D $Sel2:1
126 ComputeFun D $Sel3:1
127 ComputeFun D $Sel4:1
128 ComputeFun D $FR1 
129 ComputeFun D $FR2
130 ComputeFun D $FR3
131 ComputeFun D $FR4
132 ComputeFun D $FS1
133 ComputeFun D $FS2
134 ComputeFun D $FS3
135 ComputeFun D $FS4
136 erase
137 GetShape D $FS4:2 Box1
138
139
140 #8 recomputation of entities of the TestSelection commands
141 SolveFlatFrom D $SL
142 NewCommand D
143