0023819: Naming failures
[occt.git] / tests / caf / named_shape / F2
1 # ============= OCAF ============================
2 # Naming
3 #
4 # Testing purpose: Naming selection mechanism 
5 #
6 # Test case: F2 (ShapeOrientation is not used)
7 #
8 # 1. Create Box $B1 (Box1)
9 # 2. Create sphere $Sph1
10 # 3. Create sphere $Sph2
11 # 4. Translate sphere $Sph2 along XYZ
12 # 5. Fuse spheres $FS1 = Fuse ($Sph1, $Sph2)
13 # 6. Make selection for all sub-shapes
14 # 7. Modify B1
15 # 8. Recompute modeling functions
16 # 9. Recompute selections
17 # ===============================================
18
19 #pload FULL
20 erase 
21 Close D 
22
23 NewDocument D MDTV-Standard
24 isos 12
25 #1 - create Box using short-cut
26 NewCommand D
27 AddDriver D Box;                        ## add box driver to driver table
28 set B1 [AddBox D 130 140 150];          ## add box 
29 ComputeFun D $B1:1;                     ## compute box1 function
30 GetShape D $B1:1:2 Box1;                ## check result
31 whatis Box1
32 # referes to result NS
33 GetReference D $B1;                     ## check is reference set 
34
35
36 #2 - create sphere1
37 AddDriver D Cyl Sph Attach XAttach PTxyz PTALine PRLine PMirr Cut Fuse Prism FulRevol SecRevol Fillet
38 NewCommand D
39 explode Box1 V
40 set SPnt1 [AttachShape D Box1_1 ${B1} ${B1} 0]; ## set attachment
41
42 set Sph1 [AddSphere D $SPnt1 250]
43 ComputeFun D $Sph1:1
44 GetShape D $Sph1:1:2 Sp1
45
46 #3
47 NewCommand D
48 set Sph2 [AddSphere D $SPnt1 30]
49 ComputeFun D $Sph2:1
50 GetShape D $Sph2:1:2 Sp2
51 erase Box1
52
53 #4
54 NewCommand D
55 set FTr2 [PTranslateDXYZ D $Sph2 0 -253 0]
56 ComputeFun D $FTr2
57 GetShape D $Sph2:2:2 Sp2
58
59
60 #5 Fuse spheres
61 NewCommand D
62 set FS1 [AddFuse D $Sph1 $Sph2]
63 ComputeFun D $FS1
64 GetShape D $FS1:2 Sp1
65
66 #6 test selection
67 NewCommand D
68 set SL [TestSingleSelection D $Sph1 0]
69 ## Wires defined as UNION  (seam edge of each sphere) fail ==> linked with degenerated edges problem
70 set SL2 [TestMultipleSelection D $Sph1 0]
71
72 #7 modification
73 NewCommand D
74 BoxDZ D $B1 270
75
76 #8 recomputation
77 NewCommand D
78 InitLogBook D;          ## to be initialized before any recomputation of impacted functions set (if attachments are presented)
79 ComputeFun D $B1:1
80 ComputeFun D $SPnt1:1
81 ComputeFun D $Sph1:1
82 ComputeFun D $Sph2:1
83
84 ComputeFun D $FTr2
85 ComputeFun D $FS1
86 erase
87 GetShape D $FS1:2 Sp1
88
89
90 #9 recomputation of entities of the TestSelection commands
91 SolveFlatFrom D $SL
92 NewCommand D
93