Adjusting testing cases for current state of OCCT
[occt.git] / tests / caf / named_shape / F3
CommitLineData
efd4b232 1# ============= OCAF ============================
2# Naming
3#
4# Testing purpose: Naming selection mechanism
5#
6# Test case: F3 (ShapeOrientation is not used)
7#
8# 1. Create Box $B1
9# 2. Create sphere $Sph0
10# 3. Create sphere $Sph1 and move it along XYZ
11# 4. Create sphere $Sph2 and move it along XYZ
12# 5. Create sphere $Sph3 and rotate it around line and move after along XYZ
13# 6. Create sphere $Sph4 and move it along XYZ
14# 7. Cut spheres: $Cut1 = Cut($Sph0, $Sph1)
15# $Cut2 = Cut($Sph0, $Sph2)
16# $Cut3 = Cut($Sph0, $Sph3)
17# $Cut4 = Cut($Sph0, $Sph4)
18# 8. Make selection for all sub-shapes
19# 9. Modify B2
20# 10. Recompute modeling functions
21# 11. Recompute selections
22# ===============================================
23
24
40093367 25#pload FULL
40093367 26erase
27Close D
24de79c3 28
40093367 29NewDocument D MDTV-Standard
30isos 12
31#1 - create Box using short-cut
32NewCommand D
33AddDriver D Box; ## add box driver to driver table
34set B1 [AddBox D 130 140 150]; ## add box
35ComputeFun D $B1:1; ## compute box1 function
36GetShape D $B1:1:2 Box1; ## check result
37whatis Box1
38# referes to result NS
39GetReference D $B1; ## check is reference set
40
41
efd4b232 42#2 - create main sphere Sp0
40093367 43AddDriver D Cyl Sph Attach XAttach PTxyz PTALine PRLine PMirr Cut Fuse Prism FulRevol SecRevol Fillet
44NewCommand D
45explode Box1 V
46set SPnt1 [AttachShape D Box1_1 ${B1} ${B1} 0]; ## set attachment
47erase Box1
48
49set Sph0 [AddSphere D $SPnt1 250]
50ComputeFun D $Sph0:1
51GetShape D $Sph0:1:2 Sp0
52
53#3 create Sphere1
54NewCommand D
55set Sph1 [AddSphere D $SPnt1 30]
56ComputeFun D $Sph1:1
57GetShape D $Sph1:1:2 Sp1
58
59NewCommand D
60set FTr1 [PTranslateDXYZ D $Sph1 0 -251 0]
61ComputeFun D $FTr1
62GetShape D $Sph1:2:2 Sp1
63
64#4 create Sphere2
65NewCommand D
66set Sph2 [AddSphere D $SPnt1 30]
67ComputeFun D $Sph2:1
68GetShape D $Sph2:1:2 Sp2
69
70set FTr2 [PTranslateDXYZ D $Sph2 0 251 0]
71ComputeFun D $FTr2
72GetShape D $Sph2:2:2 Sp2
73
74#5 create Sphere3
75NewCommand D
76set Sph3 [AddSphere D $SPnt1 30]
77ComputeFun D $Sph3:1
78GetShape D $Sph3:1:2 Sp3
79
80explode Box1 E
81set Sel3 [AttachShape D Box1_1 ${B1} ${B1} 0];
82set FR3 [PRotateRoundLine D $Sph3 $Sel3 120]
83ComputeFun D $FR3
84GetShape D $FR3:2 Sp3
85
86set FTr3 [PTranslateDXYZ D $Sph3 -251 0 0]
87ComputeFun D $FTr3
88GetShape D $Sph3:3:2 Sp3
89
90#6 create Sphere4
91NewCommand D
92set Sph4 [AddSphere D $SPnt1 30]
93ComputeFun D $Sph4:1
94GetShape D $Sph4:1:2 Sp4
95
96set FTr4 [PTranslateDXYZ D $Sph4 251 -40 0]
97ComputeFun D $FTr4
98GetShape D $Sph4:2:2 Sp4
99
100#7 Cut spheres
101set Cut1 [AddCut D $Sph0 $Sph1]
102ComputeFun D $Cut1
103GetShape D $Cut1:2 Sp0
104
105set Cut2 [AddCut D $Sph0 $Sph2]
106ComputeFun D $Cut2
107GetShape D $Cut2:2 Sp0
108
109set Cut3 [AddCut D $Sph0 $Sph3]
110ComputeFun D $Cut3
111GetShape D $Cut3:2 Sp0
112
113set Cut4 [AddCut D $Sph0 $Sph4]
114ComputeFun D $Cut4
115GetShape D $Cut4:2 Sp0
116
117
efd4b232 118#8 test selection
40093367 119NewCommand D
120set SL [TestSingleSelection D $Sph0 0]
121set SL2 [TestMultipleSelection D $Sph0 0]
122
efd4b232 123#9 modification
40093367 124NewCommand D
125BoxDZ D $B1 270
126
efd4b232 127#10 recomputation
40093367 128NewCommand D
129InitLogBook D; ## to be initialized before any recomputation of impacted functions set (if attachments are presented)
130ComputeFun D $B1:1
131ComputeFun D $SPnt1:1
132ComputeFun D $Sph0:1
133ComputeFun D $Sph1:1
134ComputeFun D $FTr1
135ComputeFun D $Sph2:1
136ComputeFun D $FTr2
137ComputeFun D $Sph3:1
138ComputeFun D $Sel3:1
139ComputeFun D $FR3
140ComputeFun D $FTr3
141ComputeFun D $Sph4:1
142ComputeFun D $FTr4
143ComputeFun D $Cut1
144ComputeFun D $Cut2
145ComputeFun D $Cut3
146ComputeFun D $Cut4
147erase
148GetShape D $Cut4:2 Sp0
149
150
efd4b232 151#11 recomputation of entities of the TestSelection commands
40093367 152SolveFlatFrom D $SL
153NewCommand D
154