630f9ab6437fa3f2987a7566d6203687125a2d42
[occt.git] / tests / caf / named_shape / E7
1 #pload FULL
2 #source dftree.tcl 
3 #source DDataStd_TreeBrowser.tcl
4 erase
5 Close D
6 unset D
7 NewDocument D MDTV-Standard
8
9 #Drivers' nick-names:
10 #Box|Sph|Cyl|Cut|Fuse|Prism|SecRevol|FulRevol|PTxyz|PTALine|PRLine|PMirr|Fillet|Attach|XAttach
11 # order of functions recomputation should be defined out of the tool (by end user)
12
13 #Commands of transformation:
14 #PTranslateDXYZ Doc ShapeEntry dx dy dz
15 #PTranslateAlongLine Doc ShapeEntry  Line off
16 #PRotateRoundLine Doc ShapeEntry Line Angle
17 #PMirror Doc ShapeEntry PlaneObj
18
19 ## Test of transformation functions
20 AddDriver D Box Attach PTxyz PTALine PRLine PMirr Sph Prism FulRevol SecRevol
21 #1 - create box using more flexible set of commands
22 NewCommand D
23 isos 12
24 set B2 [AddObject D];                   ## add object
25 set F2 [AddFunction D $B2 Box];         ## add function
26 BoxDX D $B2 190;                        ## set argumets of this function
27 BoxDY D $B2 290
28 BoxDZ D $B2 390
29 InitLogBook D;                          ## initialize (clean) internal maps of labels
30 ComputeFun D $F2;                       ## compute the function
31 GetShape D $F2:2 Box2;                  ## check result
32 fit
33 whatis Box2
34 GetReference D $B2;                     ## referes to result NS
35
36
37 #2 Prism  (after step #1)
38 explode Box2 F
39 set Sel1 [AttachShape D Box2_1 ${B2} ${B2} 0]
40 set Prism [AddPrism D $Sel1 300 0]
41 ComputeFun D $Prism:1
42 GetShape D $Prism:1:2 Pr
43
44 PrismHeight D $Prism 500
45 ComputeFun D $Prism:1
46 GetShape D $Prism:1:2 Pr
47 fit
48
49
50 #3 Revol Full
51 explode Box2 F
52 explode Box2_3 E
53 set SBas1 [AttachShape D Box2_3 ${B2} ${B2} 0]
54 set SAx1 [AttachShape D Box2_3_3 ${B2} ${B2} 0]
55 set FRev [AddRevol D $SBas1  $SAx1]
56 ComputeFun D $FRev:1
57 GetShape D $FRev:1:2 R1           
58
59 #5
60 NewCommand D
61 set FTr1 [PTranslateDXYZ D $FRev -250 0 0]
62 ComputeFun D $FTr1;                     ## function recomputation
63 GetShape D $FTr1:2 R1;          ## get modified result
64
65 #6 => fuse
66 AddDriver D Fuse
67 set FS1 [AddFuse D $Prism $FRev]
68 ComputeFun D $FS1
69 GetShape D $FS1:2 Pr
70
71
72
73 #7 Revol Sectioned
74 GetShape D $F2:2 Box2;
75 explode Box2 F
76 explode Box2_2 E
77 set SBas2 [AttachShape D Box2_2 ${B2} ${B2} 0]
78 set SAx2 [AttachShape D Box2_2_3 ${B2} ${B2} 0]
79 set SRev [AddRevol D $SBas2  $SAx2 120 0]
80 ComputeFun D $SRev:1
81 GetShape D $SRev:1:2 R2
82
83 #8
84 set FS2 [AddFuse D $B2 $SRev]
85 ComputeFun D $FS2
86 GetShape D $FS2:2 Box2
87
88 #9
89 set FS3 [AddFuse D $B2 $Prism]
90 ComputeFun D $FS3
91 GetShape D $FS3:2 Box2
92
93 #7
94 NewCommand D 
95 set SL [TestSingleSelection D $B2 0]
96 set SL2 [TestMultipleSelection D $B2 0]
97 # both have failed units!!!
98
99 NewCommand D
100 BoxDZ D $B2 420
101
102 #8 order of recomputation
103 NewCommand D
104 InitLogBook D;          ## to be initialized before any recomputation of impacted functions set (if attachments are presented)
105 ComputeFun D $F2;       
106 ComputeFun D $Sel1:1
107 ComputeFun D $Prism:1
108 ComputeFun D $SBas1:1
109 ComputeFun D $SAx1:1
110 ComputeFun D $FRev:1
111 ComputeFun D $FTr1
112 ComputeFun D $FS1
113 ComputeFun D $SBas2:1
114 ComputeFun D $SAx2:1
115 ComputeFun D $SRev:1
116 ComputeFun D $FS2
117 ComputeFun D $FS3
118 GetShape D $FS3:2 Box2
119
120
121 SolveFlatFrom D $SL
122 NewCommand D
123
124 #11 Sphere    
125 #explode Box2 V
126 #set SPnt1 [AttachShape D Box2_1 ${B2} ${B2}]
127 #set Sph1 [AddSphere D $SPnt1 30]
128 #ComputeFun D $Sph1:1
129 #GetShape D $Sph1:1:2 Sph