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