0021762: Integration of new Boolean Operation algorithm to OCCT.
[occt.git] / tests / caf / named_shape / F7
CommitLineData
efd4b232 1# =================== OCAF ======================
2# Naming
3#
4# Testing purpose: Naming selection mechanism
5#
6# Test case: F7 (test special cases of type migration)
7# 1. Create 4 points: $Pnt1 - $Pnt4
8# 2. Create closed line $Lin2
9# 3. Create prism Pr ($Prism)
10# 4. Addbox $B1
11# 5. Translate box $B1 along XYZ
12# 6. $Com1 = Common ($Prism, $B1)
13# 7. Add cylinder $Cyl
14# 8. Translate cylinder $Cyl along XYZ
15# 9. Cut $Cut1 = Cut ($Prism, $Cyl)
16# 10. Make 4 selections (Select edges 8,9, 11+, 11)
17# 11. Modify $Pnt1
18# 12. Recompute
19# ===============================================
20
40093367 21#pload FULL
40093367 22erase
23Close D
24de79c3 24
40093367 25NewDocument D MDTV-Standard
26isos 12
efd4b232 27
40093367 28#1 - create 4 Pnts
29NewCommand D
30AddDriver D PntXYZ PntRLT Line3D Attach;
31set Pnt1 [AddPoint D 0 0 0]; ## add point1
32ComputeFun D $Pnt1:1; ## compute function
33GetShape D $Pnt1:1:2 P1; ## check result
34whatis P1
35# referes to result NS
36GetReference D $Pnt1; ## check is reference set
37
38set Pnt2 [AddPoint D 0 200 0];
39ComputeFun D $Pnt2:1;
40set Pnt3 [AddPoint D 200 200 0];
41ComputeFun D $Pnt3:1;
42set Pnt4 [AddPoint D 200 0 0];
43ComputeFun D $Pnt4:1;
44GetShape D $Pnt2:1:2 P2;
45GetShape D $Pnt3:1:2 P3;
46GetShape D $Pnt4:1:2 P4;
47
efd4b232 48#2 create closed Lin2
40093367 49NewCommand D
50set Lin2 [ AddLine3D D 1 $Pnt1 $Pnt2 $Pnt3 $Pnt4]
51ComputeFun D $Lin2:1;
52GetShape D $Lin2:1:2 L1;
53
efd4b232 54#3 Prism
40093367 55NewCommand D
56AddDriver D Prism Box PTxyz
57set Prism [AddPrism D $Lin2 300 0]
58ComputeFun D $Prism:1
59GetShape D $Prism:1:2 Pr
60GetReference D $Prism; ## check is reference set
61
efd4b232 62#4 Add Box
40093367 63NewCommand D
64set B1 [AddBox D 400 140 600];
65ComputeFun D $B1:1;
66GetShape D $B1:1:2 Box;
67
efd4b232 68#5 Translate Box1
40093367 69NewCommand D
70set FTr1 [PTranslateDXYZ D $B1 -100 -20 -100]
71ComputeFun D $FTr1
72GetShape D $B1:2:2 Box
73
efd4b232 74#6 add Common
40093367 75NewCommand D
76AddDriver D Comm Cut Fuse
77set Com1 [AddCommon D $Prism $B1]
78ComputeFun D $Com1
79GetShape D $Com1:2 Pr
80
efd4b232 81#7 Add Cylinder
40093367 82NewCommand D
83explode Pr E
84AddDriver D Attach Cyl
4e57c75e 85set Sel1 [AttachShape D Pr_6 ${Prism} ${Prism} 0]; ## set attachment
40093367 86set Cyl [AddCyl D 70 515 ${Sel1}]
87ComputeFun D $Cyl:1
88GetShape D $Cyl:1:2 CylS
89
efd4b232 90#8 Translate Cylinder
40093367 91NewCommand D
92set FTr1 [PTranslateDXYZ D $Cyl -100 200 170]
93ComputeFun D $FTr1
94GetShape D $Cyl:2:2 CylS
95
efd4b232 96#9 Cut
40093367 97NewCommand D
98set Cut1 [AddCut D $Prism $Cyl]
99ComputeFun D $Cut1
100GetShape D $Cut1:2 Pr
101don Pr
102
efd4b232 103#10 Select edges 8,9, 11 (test special cases of type migration)
40093367 104explode Pr E
105erase Pr_1 Pr_2 Pr_3 Pr_4 Pr_5 Pr_6 Pr_7 Pr_8 Pr_9 Pr_10 Pr_11 Pr_12 Pr_13 Pr_14 Pr_15 Pr_16 Pr_17
106display Pr_8 Pr_9
efd4b232 107## ==> 8,9
40093367 108NewCommand D
109set Sel8 [AttachShape D Pr_8 ${Prism} ${Prism} 0]; ## should return Compound of two edges
110set Sel9 [AttachShape D Pr_9 ${Prism} ${Prism} 1]; ## should return Compound of two edges
111set Sel11 [AttachShape D Pr_11 ${Prism} ${Prism} 1];
112set Sel12 [AttachShape D Pr_11 ${Prism} ${Prism} 0];
efd4b232 113
114#11 modify
40093367 115PntOffset D $Pnt1 40 25 skip
116
efd4b232 117#12 recompute
40093367 118ComputeFun D $Pnt1:1
119ComputeFun D $Lin2:1
120ComputeFun D $Prism:1
121ComputeFun D $Com1
122ComputeFun D $Sel1:1
123ComputeFun D $Cyl:1
124ComputeFun D $FTr1
125ComputeFun D $Cut1
126erase
127GetShape D $Cut1:2 Pr
128
129ComputeFun D $Sel8:1
130ComputeFun D $Sel9:1
131ComputeFun D $Sel11:1
132ComputeFun D $Sel12:1
133NewCommand D
134