0023523: In session DRAW it is impossible to close document having name already once...
[occt.git] / tests / caf / named_shape / E6
CommitLineData
efd4b232 1# =================== OCAF ======================
2# Naming
3#
4# Testing purpose: Naming selection mechanism
5#
6# Test case: E6 (ShapeOrientation is not used)
7# 1. Create box B1
8# 2. Create box B2
9# 3. Translate B1 along XYZ
10# 4. FS = B2 (B2, B1)
11# 5. Create cylinder Cyl
12# 6. CS = Cut (B1, Cyl)
13# 7. Make fillet
14# 8. Make selections for all sub-shapes
15# 9. Modify B2
16# 10. Recompute modeling functions
17# 11. Recompute selections
18# ===============================================
19
40093367 20#pload FULL
efd4b232 21
40093367 22erase
23Close D
24de79c3 24
40093367 25NewDocument D MDTV-Standard
26
27#1 - create Box using short-cut
28NewCommand D
29AddDriver D Box; ## add box driver to driver table
30set B1 [AddBox D 130 140 150]; ## add box
31ComputeFun D $B1:1; ## compute box1 function
32GetShape D $B1:1:2 Box1; ## check result
33whatis Box1
34# referes to result NS
35GetReference D $B1; ## check is reference set
36
37#2 - create box using more flexible set of commands
38NewCommand D
39set B2 [AddObject D]; ## add object
40set F2 [AddFunction D $B2 Box]; ## add function
41BoxDX D $B2 190; ## set argumets of this function
42BoxDY D $B2 290
43BoxDZ D $B2 390
44InitLogBook D; ## initialize (clean) internal maps of labels
45AddDriver D Box Attach Cyl
46ComputeFun D $F2; ## compute the function
47GetShape D $F2:2 Box2; ## check result
48whatis Box2
49GetReference D $B2; ## referes to result NS
50
51#3
52NewCommand D
53AddDriver D PTxyz PTALine PRLine
54set FTr1 [PTranslateDXYZ D $B1 110 130 270]
55ComputeFun D $FTr1; ## translation function recomputation
56GetShape D $FTr1:2 Box1; ## get modified result
57
58#4 => fuse
59AddDriver D Fuse
60set FS [AddFuse D $B2 $B1]
61ComputeFun D $FS
62GetShape D $FS:2 Box2
63
64#5
65NewCommand D
66explode Box2 F
67explode Box2_1 E
68set Sel1 [AttachShape D Box2_1_1 ${B2} ${B2} 0]; ## set attachment
69AddDriver D Attach Cyl
70set Cyl [AddCyl D 30 315 ${Sel1}]
71ComputeFun D $Cyl:1
72GetShape D $Cyl:1:2 S
73
74#6 => cut
75NewCommand D
76AddDriver D Cut
77set CS [AddCut D $B2 $Cyl]
78ComputeFun D $CS
79GetShape D $CS:2 S
80
81#7 => Fillet
82NewCommand D
83explode S F
84explode S_3 E
85set Sel2 [AttachShape D S_3_6 ${B2} ${B2} 0]; ## set attachment for using in Fillet
86AddDriver D Fillet
87set Fill [AddFillet D $B2 25 $Sel2 0]
88ComputeFun D $Fill
89GetShape D $Fill:2 S
90
91
92#8 test selection
93NewCommand D
94set SL [TestSingleSelection D $B2 0]
95set SL2 [TestMultipleSelection D $B2 0]
96
97#9 modification
98NewCommand D
99BoxDX D $B2 210
100
101#10 recomputation
102NewCommand D
103InitLogBook D; ## to be initialized before any recomputation of impacted functions set (if attachments are presented)
104ComputeFun D $F2;
105ComputeFun D $B1:1
106ComputeFun D $FTr1
107ComputeFun D $FS
108ComputeFun D $Sel1:1
109ComputeFun D $Cyl:1
110ComputeFun D $CS
111ComputeFun D $Sel2:1
112ComputeFun D $Fill
113GetShape D $Fill:2 S
114don S
115
efd4b232 116#11 recomputation of entities of the TestSelection commands
40093367 117SolveFlatFrom D $SL
118NewCommand D
119