File: E7

package info (click to toggle)
oce 0.18.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 301,548 kB
  • sloc: cpp: 1,190,609; ansic: 67,225; sh: 11,630; tcl: 7,954; cs: 5,221; python: 2,867; java: 1,522; makefile: 342; xml: 292; perl: 37
file content (136 lines) | stat: -rw-r--r-- 3,191 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# =================== OCAF ======================
# Naming
#
# Testing purpose: Naming selection mechanism 
#
# Test case: E7 (ShapeOrientation is not  used)
# 1. Create box B2
# 2. Create prism Pr ($Prism)
# 3. Create full revolution R1
# 4. Translate R1 along XYZ
# 5. FS = Fuse (Pr, R1)
# 6. Create sectioned revolution R2
# 7. FS2 = Fuse (B2, R2)
# 8. FS3 = Fuse (B2, Prism)
# 9. Make  selections for all sub-shapes
# 10. Modify B2
# 11. Recompute modeling functions
# 12. Recompute selections
# ===============================================

#pload FULL
erase
Close D

NewDocument D MDTV-Standard

#Drivers' nick-names:
#Box|Sph|Cyl|Cut|Fuse|Prism|SecRevol|FulRevol|PTxyz|PTALine|PRLine|PMirr|Fillet|Attach|XAttach
# order of functions recomputation should be defined out of the tool (by end user)
## Test of transformation functions
AddDriver D Box Attach PTxyz PTALine PRLine PMirr Sph Prism FulRevol SecRevol

#1 - create box using more flexible set of commands
NewCommand D
isos 12
set B2 [AddObject D];			## add object
set F2 [AddFunction D $B2 Box];		## add function
BoxDX D $B2 190;			## set argumets of this function
BoxDY D $B2 290
BoxDZ D $B2 390
InitLogBook D;				## initialize (clean) internal maps of labels
ComputeFun D $F2;			## compute the function
GetShape D $F2:2 Box2;			## check result
fit
whatis Box2
GetReference D $B2;			## referes to result NS


#2 Prism  (after step #1)
explode Box2 F
set Sel1 [AttachShape D Box2_1 ${B2} ${B2} 0]
set Prism [AddPrism D $Sel1 300 0]
ComputeFun D $Prism:1
GetShape D $Prism:1:2 Pr

PrismHeight D $Prism 500
ComputeFun D $Prism:1
GetShape D $Prism:1:2 Pr
fit


#3 Revol Full
explode Box2 F
explode Box2_3 E
set SBas1 [AttachShape D Box2_3 ${B2} ${B2} 0]
set SAx1 [AttachShape D Box2_3_3 ${B2} ${B2} 0]
set FRev [AddRevol D $SBas1  $SAx1]
ComputeFun D $FRev:1
GetShape D $FRev:1:2 R1           

#4
NewCommand D
set FTr1 [PTranslateDXYZ D $FRev -250 0 0]
ComputeFun D $FTr1;                     ## function recomputation
GetShape D $FTr1:2 R1;	        ## get modified result

#5 => fuse
AddDriver D Fuse
set FS1 [AddFuse D $Prism $FRev]
ComputeFun D $FS1
GetShape D $FS1:2 Pr



#6 Revol Sectioned
GetShape D $F2:2 Box2;
explode Box2 F
explode Box2_2 E
set SBas2 [AttachShape D Box2_2 ${B2} ${B2} 0]
set SAx2 [AttachShape D Box2_2_3 ${B2} ${B2} 0]
set SRev [AddRevol D $SBas2  $SAx2 120 0]
ComputeFun D $SRev:1
GetShape D $SRev:1:2 R2

#7
set FS2 [AddFuse D $B2 $SRev]
ComputeFun D $FS2
GetShape D $FS2:2 Box2

#8
set FS3 [AddFuse D $B2 $Prism]
ComputeFun D $FS3
GetShape D $FS3:2 Box2

#9
NewCommand D 
set SL [TestSingleSelection D $B2 0]
set SL2 [TestMultipleSelection D $B2 0]
# both have failed units!!!

#10
NewCommand D
BoxDZ D $B2 420

#11 order of recomputation
NewCommand D
InitLogBook D;		## to be initialized before any recomputation of impacted functions set (if attachments are presented)
ComputeFun D $F2;	
ComputeFun D $Sel1:1
ComputeFun D $Prism:1
ComputeFun D $SBas1:1
ComputeFun D $SAx1:1
ComputeFun D $FRev:1
ComputeFun D $FTr1
ComputeFun D $FS1
ComputeFun D $SBas2:1
ComputeFun D $SAx2:1
ComputeFun D $SRev:1
ComputeFun D $FS2
ComputeFun D $FS3
GetShape D $FS3:2 Box2

#12
SolveFlatFrom D $SL
NewCommand D