0023523: In session DRAW it is impossible to close document having name already once...
[occt.git] / tests / caf / named_shape / F5
CommitLineData
efd4b232 1# =================== OCAF ======================
2# Naming
3#
4# Testing purpose: Naming selection mechanism
5#
6# Test case: F5 (ShapeOrientation is not used)
7# 1. Create 4 points: $Pnt1 - $Pnt4
8# 2. Create closed line $Lin2
9# 3. Create prism Pr ($Prism)
10# 4. Create 2 prisms $Prism1, $Prism2
11# 5. $FS1 = Fuse ($Prism1, $Prism2); $FS2 = Fuse ($Prism1, $Prism3)
12# 6. Create sphere $Sph
13# 7. Cut sphere $Cut1 = Cut ($Prism, $Sph)
14# 8. Make selections for all sub-shapes
15# 9. Modify $Pnt1
16# 10. Recompute modeling functions
17# 11. Recompute selections
18# ===============================================
19
40093367 20#pload FULL
40093367 21erase
22Close D
24de79c3 23
40093367 24NewDocument D MDTV-Standard
25isos 12
efd4b232 26
40093367 27#1 - create 4 Pnts
28NewCommand D
29AddDriver D PntXYZ PntRLT Line3D Attach;
30set Pnt1 [AddPoint D 0 0 0]; ## add point1
31ComputeFun D $Pnt1:1; ## compute function
32GetShape D $Pnt1:1:2 P1; ## check result
33whatis P1
34# referes to result NS
35GetReference D $Pnt1; ## check is reference set
36
37set Pnt2 [AddPoint D 0 200 0];
38ComputeFun D $Pnt2:1;
39set Pnt3 [AddPoint D 200 200 0];
40ComputeFun D $Pnt3:1;
41set Pnt4 [AddPoint D 200 0 0];
42ComputeFun D $Pnt4:1;
43GetShape D $Pnt2:1:2 P2;
44GetShape D $Pnt3:1:2 P3;
45GetShape D $Pnt4:1:2 P4;
46
efd4b232 47#2 create closed Lin2
40093367 48NewCommand D
49set Lin2 [ AddLine3D D 1 $Pnt1 $Pnt2 $Pnt3 $Pnt4]
50ComputeFun D $Lin2:1;
51GetShape D $Lin2:1:2 L1;
52
efd4b232 53#3 Prism
40093367 54NewCommand D
55AddDriver D Prism
56set Prism [AddPrism D $Lin2 300 0]
57ComputeFun D $Prism:1
58GetShape D $Prism:1:2 Pr
59GetReference D $Prism; ## check is reference set
60
efd4b232 61#4 create two prisms
40093367 62NewCommand D
63explode Pr F
64set Bas1 [AttachShape D Pr_1 ${Prism} ${Prism} 1]
65set Bas2 [AttachShape D Pr_4 ${Prism} ${Prism} 1]
66
67set Prism2 [AddPrism D $Bas1 300 0]
68ComputeFun D $Prism2:1
69GetShape D $Prism2:1:2 Pr2
70
71
72set Prism3 [AddPrism D $Bas2 500 0]
73ComputeFun D $Prism3:1
74GetShape D $Prism3:1:2 Pr3
75
efd4b232 76#5 => fuse
40093367 77NewCommand D
78AddDriver D Fuse Sph Cut
79set FS1 [AddFuse D $Prism $Prism2]
80ComputeFun D $FS1
81GetShape D $FS1:2 Pr
82
83set FS2 [AddFuse D $Prism $Prism3]
84ComputeFun D $FS2
85GetShape D $FS2:2 Pr
86
efd4b232 87#6
40093367 88set Sph [AddSphere D $Pnt3 150]
89NewCommand D
90ComputeFun D $Sph:1
91GetShape D $Sph:1:2 Sp
92
93#7 Cut sphere
94NewCommand D
95set Cut1 [AddCut D $Prism $Sph]
96ComputeFun D $Cut1
97GetShape D $Cut1:2 Pr
98don Pr
99
100#8 test selection
101NewCommand D
102set SL [TestSingleSelection D $Prism 0]
103set SL2 [TestMultipleSelection D $Prism 0]
104
105
106
107#9 modify
108PntOffset D $Pnt1 50 30 skip
109
110#10 recompute
111NewCommand D
112ComputeFun D $Pnt1:1
113ComputeFun D $Lin2:1
114ComputeFun D $Prism:1
115ComputeFun D $Bas1:1
116ComputeFun D $Bas2:1
117ComputeFun D $Prism2:1
118ComputeFun D $Prism3:1
119ComputeFun D $FS1
120ComputeFun D $FS2
121ComputeFun D $Sph:1
122ComputeFun D $Cut1
123erase
124GetShape D $Cut1:2 Pr
125#GetShape D $Prism:1:2 Pr
126#GetShape D $Prism2:1:2 Pr2
127#GetShape D $Prism3:1:2 Pr3
128
efd4b232 129#11 recomputation of entities of the TestSelection commands
40093367 130SolveFlatFrom D $SL
131NewCommand D
132