3 #source DDataStd_TreeBrowser.tcl
7 NewDocument D MDTV-Standard
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)
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
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
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
29 InitLogBook D; ## initialize (clean) internal maps of labels
30 ComputeFun D $F2; ## compute the function
31 GetShape D $F2:2 Box2; ## check result
34 GetReference D $B2; ## referes to result NS
37 #2 Prism (after step #1)
39 set Sel1 [AttachShape D Box2_1 ${B2} ${B2} 0]
40 set Prism [AddPrism D $Sel1 300 0]
42 GetShape D $Prism:1:2 Pr
44 PrismHeight D $Prism 500
46 GetShape D $Prism:1:2 Pr
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]
57 GetShape D $FRev:1:2 R1
61 set FTr1 [PTranslateDXYZ D $FRev -250 0 0]
62 ComputeFun D $FTr1; ## function recomputation
63 GetShape D $FTr1:2 R1; ## get modified result
67 set FS1 [AddFuse D $Prism $FRev]
74 GetShape D $F2:2 Box2;
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]
81 GetShape D $SRev:1:2 R2
84 set FS2 [AddFuse D $B2 $SRev]
86 GetShape D $FS2:2 Box2
89 set FS3 [AddFuse D $B2 $Prism]
91 GetShape D $FS3:2 Box2
95 set SL [TestSingleSelection D $B2 0]
96 set SL2 [TestMultipleSelection D $B2 0]
97 # both have failed units!!!
102 #8 order of recomputation
104 InitLogBook D; ## to be initialized before any recomputation of impacted functions set (if attachments are presented)
107 ComputeFun D $Prism:1
108 ComputeFun D $SBas1:1
113 ComputeFun D $SBas2:1
118 GetShape D $FS3:2 Box2
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