File: F3

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 (154 lines) | stat: -rw-r--r-- 3,494 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# ============= OCAF ============================
# Naming
#
# Testing purpose: Naming selection mechanism 
#
# Test case: F3 (ShapeOrientation is not used)
#
# 1.  Create Box $B1
# 2.  Create sphere $Sph0
# 3.  Create sphere $Sph1 and move it along XYZ
# 4.  Create sphere $Sph2 and move it along XYZ
# 5.  Create sphere $Sph3 and rotate it around line and move after  along XYZ
# 6.  Create sphere $Sph4 and move it along XYZ
# 7.  Cut spheres: $Cut1 = Cut($Sph0, $Sph1)
# 		   $Cut2 = Cut($Sph0, $Sph2)
#		   $Cut3 = Cut($Sph0, $Sph3)
#		   $Cut4 = Cut($Sph0, $Sph4)
# 8.  Make selection for all sub-shapes
# 9.  Modify B2
# 10. Recompute modeling functions
# 11. Recompute selections
# ===============================================


#pload FULL
erase 
Close D 

NewDocument D MDTV-Standard
isos 12
#1 - create Box using short-cut
NewCommand D
AddDriver D Box;			## add box driver to driver table
set B1 [AddBox D 130 140 150];		## add box 
ComputeFun D $B1:1;			## compute box1 function
GetShape D $B1:1:2 Box1;		## check result
whatis Box1
# referes to result NS
GetReference D $B1;			## check is reference set 


#2 - create main sphere Sp0
AddDriver D Cyl Sph Attach XAttach PTxyz PTALine PRLine PMirr Cut Fuse Prism FulRevol SecRevol Fillet
NewCommand D
explode Box1 V
set SPnt1 [AttachShape D Box1_1 ${B1} ${B1} 0]; ## set attachment
erase Box1

set Sph0 [AddSphere D $SPnt1 250]
ComputeFun D $Sph0:1
GetShape D $Sph0:1:2 Sp0

#3 create Sphere1
NewCommand D
set Sph1 [AddSphere D $SPnt1 30]
ComputeFun D $Sph1:1
GetShape D $Sph1:1:2 Sp1

NewCommand D
set FTr1 [PTranslateDXYZ D $Sph1 0 -251 0]
ComputeFun D $FTr1
GetShape D $Sph1:2:2 Sp1

#4 create Sphere2
NewCommand D
set Sph2 [AddSphere D $SPnt1 30]
ComputeFun D $Sph2:1
GetShape D $Sph2:1:2 Sp2

set FTr2 [PTranslateDXYZ D $Sph2 0 251 0]
ComputeFun D $FTr2
GetShape D $Sph2:2:2 Sp2

#5 create Sphere3
NewCommand D
set Sph3 [AddSphere D $SPnt1 30]
ComputeFun D $Sph3:1
GetShape D $Sph3:1:2 Sp3

explode Box1 E
set Sel3 [AttachShape D Box1_1 ${B1} ${B1} 0];
set FR3 [PRotateRoundLine D $Sph3 $Sel3 120]
ComputeFun D $FR3
GetShape D $FR3:2 Sp3

set FTr3 [PTranslateDXYZ D $Sph3 -251 0 0]
ComputeFun D $FTr3
GetShape D $Sph3:3:2 Sp3      

#6 create Sphere4
NewCommand D
set Sph4 [AddSphere D $SPnt1 30]
ComputeFun D $Sph4:1
GetShape D $Sph4:1:2 Sp4

set FTr4 [PTranslateDXYZ D $Sph4  251 -40 0]
ComputeFun D $FTr4
GetShape D $Sph4:2:2 Sp4 

#7 Cut spheres
set Cut1 [AddCut D $Sph0 $Sph1]
ComputeFun D $Cut1
GetShape D $Cut1:2 Sp0

set Cut2 [AddCut D $Sph0 $Sph2]
ComputeFun D $Cut2
GetShape D $Cut2:2 Sp0

set Cut3 [AddCut D $Sph0 $Sph3]
ComputeFun D $Cut3
GetShape D $Cut3:2 Sp0

set Cut4 [AddCut D $Sph0 $Sph4]
ComputeFun D $Cut4
GetShape D $Cut4:2 Sp0


#8 test selection
NewCommand D
set SL  [TestSingleSelection   D $Sph0 0]
set SL2 [TestMultipleSelection D $Sph0 0]

#9 modification
NewCommand D
BoxDZ D $B1 270

#10 recomputation
NewCommand D
InitLogBook D;		## to be initialized before any recomputation of impacted functions set (if attachments are presented)
ComputeFun D $B1:1
ComputeFun D $SPnt1:1
ComputeFun D $Sph0:1
ComputeFun D $Sph1:1
ComputeFun D $FTr1
ComputeFun D $Sph2:1
ComputeFun D $FTr2
ComputeFun D $Sph3:1
ComputeFun D $Sel3:1
ComputeFun D $FR3
ComputeFun D $FTr3
ComputeFun D $Sph4:1
ComputeFun D $FTr4
ComputeFun D $Cut1
ComputeFun D $Cut2
ComputeFun D $Cut3
ComputeFun D $Cut4
erase
GetShape D $Cut4:2 Sp0


#11 recomputation of entities of the TestSelection commands
SolveFlatFrom D $SL
NewCommand D