0029559: Samples - wrong copyright statement in FuncDemo
[occt.git] / samples / tcl / MBBGehauseRohteil.tcl
CommitLineData
ba3d7cdf 1# The following example constructs (however, not trying to follow the drawings
2# precisely) an airplane part called Gehause Rohteil from MBB Deutsche Aerospace.
3# In this example the planar geometry is combined together with cylindrical parts.
4# There are many ways to create a single mechanical workpiece like the following
5# one. Here we choose Booleans as a main tool for material cutting. Fillets
6# (presented in the original model) are not employed herein as we are focused
7# on BOPs only. However, Gehause Rohteil is a good model to test blendings as well.
8#
9# This model was used as a test part for comparing modeling systems in 1979 and
10# again in 1983. The tests were organized by Computer Aided Manufacturing
11# International (CAM-I).
12#
13#Category: Modeling
14#Title: MBB Gehause Rohteil (classic test for CAD modelling by CAM-I)
15
16pload MODELING XSDRAW
17
18# -----------------------------------------------------------------------------
19# Prepare base contour
20# -----------------------------------------------------------------------------
21
22point p1 0 0
23point p2 35 0
24point p3 39 4
25point p4 39 10
26point p5 35 13
27point p6 27 13
28point p7 27 10
29point p8 22 10
30point p9 20 8
31point p10 20 4
32point p11 11 4
33point p12 11 3
34point p13 5 3
35point p14 5 13
36point p15 0 13
37point p16 0 9
38point p17 4 9
39point p18 4 4
40point p19 0 4
41
42line l1 0 0 1 0; trim l1 l1 0 35
43line l2 39 4 0 1; trim l2 l2 0 6
44line l3 35 13 -1 0; trim l3 l3 0 8
45line l4 27 13 0 -1; trim l4 l4 0 3
46line l5 27 10 -1 0; trim l5 l5 0 5
47line l6 20 8 0 -1; trim l6 l6 0 4
48line l7 20 4 -1 0; trim l7 l7 0 9
49line l8 11 4 0 -1; trim l8 l8 0 1
50line l9 11 3 -1 0; trim l9 l9 0 6
51line l10 5 3 0 1; trim l10 l10 0 10
52line l11 5 13 -1 0; trim l11 l11 0 5
53line l12 0 13 0 -1; trim l12 l12 0 4
54line l13 0 9 1 0; trim l13 l13 0 4
55line l14 4 9 0 -1; trim l14 l14 0 5
56line l15 4 4 -1 0; trim l15 l15 0 4
57line l16 0 4 0 -1; trim l16 l16 0 4
58
59# We use Bezier curves here instead of circles. This does not make
60# a great sense since we are focused on a principle rather than
61# trying to follow the drawing precisely
622dbeziercurve c1 3 35 0 1 39 0 1 39 4 1
632dbeziercurve c2 3 39 10 1 39 13 1 35 13 1
642dbeziercurve c3 3 22 10 1 20 10 1 20 8 1
65
66# Circle for a big hole
67circle cbig 33 6.5 4.0
68
69# Create topology
70mkedge e1 l1
71mkedge e2 c1
72mkedge e3 l2
73mkedge e4 c2
74mkedge e5 l3
75mkedge e6 l4
76mkedge e7 l5
77mkedge e8 c3
78mkedge e9 l6
79mkedge e10 l7
80mkedge e11 l8
81mkedge e12 l9
82mkedge e13 l10
83mkedge e14 l11
84mkedge e15 l12
85mkedge e16 l13
86mkedge e17 l14
87mkedge e18 l15
88mkedge e19 l16
89wire wout e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12 e13 e14 e15 e16 e17 e18 e19
90mkedge ein1 cbig
91wire win1 ein1
92mkplane f wout
93mkplane f1 win1
94fixshape f f
95fixshape f1 f1
96bcut f f f1
97
98# -----------------------------------------------------------------------------
99# Make extrusion
100# -----------------------------------------------------------------------------
101
102prism p f 0 0 3
103
104# -----------------------------------------------------------------------------
105# Prepare a contour on top face
106# -----------------------------------------------------------------------------
107
108point p1 0 0
109point p2 28 0
110point p3 28 13
111point p4 27 13
112point p5 27 10
113point p6 22 10
114point p7 20 8
115point p8 20 4
116point p9 11 4
117point p10 11 3
118point p11 5 3
119point p12 5 13
120point p13 0 13
121line l1 0 0 1 0; trim l1 l1 0 28
122line l2 28 0 0 1; trim l2 l2 0 13
123line l3 28 13 -1 0; trim l3 l3 0 1
124line l4 27 13 0 -1; trim l4 l4 0 3
125line l5 27 10 -1 0; trim l5 l5 0 5
126line l6 20 8 0 -1; trim l6 l6 0 4
127line l7 20 4 -1 0; trim l7 l7 0 9
128line l8 11 4 0 -1; trim l8 l8 0 1
129line l9 11 3 -1 0; trim l9 l9 0 6
130line l10 5 3 0 1; trim l10 l10 0 10
131line l11 5 13 -1 0; trim l11 l11 0 5
132line l12 0 13 0 -1; trim l12 l12 0 13
1332dbeziercurve c3 3 22 10 1 20 10 1 20 8 1
134
135# Create topology on top face
136plane top_pln 0 0 3
137to3d l1 l1 top_pln
138to3d l2 l2 top_pln
139to3d l3 l3 top_pln
140to3d l4 l4 top_pln
141to3d l5 l5 top_pln
142to3d c3 c3 top_pln
143to3d l6 l6 top_pln
144to3d l7 l7 top_pln
145to3d l8 l8 top_pln
146to3d l9 l9 top_pln
147to3d l10 l10 top_pln
148to3d l11 l11 top_pln
149to3d l12 l12 top_pln
150mkedge e1 l1
151mkedge e2 l2
152mkedge e3 l3
153mkedge e4 l4
154mkedge e5 l5
155mkedge e6 c3
156mkedge e7 l6
157mkedge e8 l7
158mkedge e9 l8
159mkedge e10 l9
160mkedge e11 l10
161mkedge e12 l11
162mkedge e13 l12
163wire wout e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12 e13
164mkface ftop top_pln wout
165fixshape ftop ftop
166
167# -----------------------------------------------------------------------------
168# Make top extrusion
169# -----------------------------------------------------------------------------
170
171prism ptop ftop 0 0 1.5
172
173# -----------------------------------------------------------------------------
174# Fuse top and bottom parts and make features
175# -----------------------------------------------------------------------------
176
177# Fuse top and bottom
178bfuse p p ptop
179
180# Create a hole
181plane top_pln 0 0 10
182circle csmall 23 6.5 2.0
183to3d hole_top csmall top_pln
184plane bot_pln 0 0 -10
185to3d hole_bot csmall bot_pln
186mkedge ehole_top hole_top
187mkedge ehole_bot hole_bot
188wire whole_top ehole_top
189wire whole_bot ehole_bot
190thrusections tool 1 1 whole_top whole_bot
191bcut p p tool
192
193# Add extrusion around the hole
194plane top_pln 0 0 4.5
195circle csmall_outer 23 6.5 3.0
196circle csmall_inner 23 6.5 2.0
197to3d hole_top_outer csmall_outer top_pln
198to3d hole_top_inner csmall_inner top_pln
199mkedge e_hole_top_outer hole_top_outer
200mkedge e_hole_top_inner hole_top_inner
201wire w_hole_top_outer e_hole_top_outer
202wire w_hole_top_inner e_hole_top_inner
203mkface ftube_outer top_pln w_hole_top_outer
204mkface ftube_inner top_pln w_hole_top_inner
205fixshape ftube_outer ftube_outer
206fixshape ftube_inner ftube_inner
207prism ptube_outer ftube_outer 0 0 3
208prism ptube_inner ftube_inner 0 0 3
209bcut ptube ptube_outer ptube_inner
210bfuse p p ptube
211
212# Build elevation "teeths" near the big hole
213box t1 26 0 0 3 2.5 7
214box t2 26 13 0 3 -3 7
215bfuse p p t1
216bfuse p p t2
217
218# Build elevation "teeths" near the tail
219box t1 0 0 0 5 3 8
220box t2 0 13 0 5 -3 8
221bfuse p p t1
222bfuse p p t2
223
224# Remove some material from tail "teeths"
225box blend_box 0 -5 0 5 25 5
226trotate blend_box blend_box 0 0 0 0 1 0 -10
227ttranslate blend_box blend_box 2.5 0 2.25
228bcut p p blend_box
229
230# Remove some material from "teeths" near big hole
231box blend_box 0 -5 0 5 25 5
232trotate blend_box blend_box 0 0 0 0 1 0 -9
233ttranslate blend_box blend_box 14.5 0 1.5
234bcut p p blend_box
235
236# Hole at the tail
237ellipse tail_hole1 0 0 0.75 0.5
238plane base_pln 2 6.5 0
239to3d tail_hole_3d1 tail_hole1 base_pln
240mkedge e_tail_hole1 tail_hole_3d1
241wire w_tail_hole1 e_tail_hole1
242plane base_pln 2 6.5 20
243to3d tail_hole_3d2 tail_hole1 base_pln
244mkedge e_tail_hole2 tail_hole_3d2
245wire w_tail_hole2 e_tail_hole2
246thrusections tail_tube 1 1 w_tail_hole1 w_tail_hole2
247bcut p p tail_tube
248
249# Chamfer at tail
250box blend_box 0 3 0 5 7 5
251trotate blend_box blend_box 0 0 0 0 1 0 -5
252ttranslate blend_box blend_box 2 0 1.5
253bcut p p blend_box
254
255# -----------------------------------------------------------------------------
256# Extract final solid and simplify it
257# -----------------------------------------------------------------------------
258
259explode p So
260unifysamedom result p_1
261
262# Show result
263pload VISUALIZATION
264vinit Driver1/Viewer1/View1
265vsetcolorbg 200 200 255
266vdisplay result
267vfit
268vsetdispmode 1
269vshowfaceboundary result 1