03392dd2 |
1 | # This script creates a model described at |
2 | # http://www.caddd.org/2010/04/opencascade-challenge.html |
ab91ab6f |
3 | #Category: Modeling |
4 | #Title: CAD shape |
03392dd2 |
5 | |
6 | pload MODELING VISUALIZATION |
7 | |
8 | # make base |
9 | box b0 0 0 0 12 7 6 |
10 | explode b0 e |
11 | blend b01 b0 1 b0_8 |
12 | blend b02 b01 1 b0_6 |
13 | |
14 | # make cut at bottom |
15 | box b1 3 -1 0 2 9 1.5 |
16 | bcut b2 b02 b1 |
17 | explode b2 e |
18 | blend b3 b2 1 b2_27 |
19 | blend b4 b3 1 b2_30 |
20 | |
21 | # make central cut |
22 | box h1 3 -1 2.5 2 9 0.5 |
23 | box h2 3 -1 3 2 9 2 |
24 | plane p 4 -1 3 0 1 0 |
25 | pcylinder c p 1 9 |
26 | bcommon h3 h2 c |
27 | bcut b5 b4 h1 |
28 | bcut b6 b5 h3 |
29 | |
30 | # make side cut |
31 | box b7 9 -1 1 2 9 4 |
32 | explode b7 e |
33 | blend b71 b7 1 b7_6 |
34 | blend b72 b71 1 b7_8 |
35 | bcut b8 b6 b72 |
36 | |
37 | # make box for inner cylindrical cut |
38 | box bc1 -1 0 2 9 1 4 |
39 | box bc2 2 -1 2 4 3 3 |
40 | bcut bc3 bc1 bc2 |
41 | explode bc3 e |
42 | blend bc4 bc3 1 bc3_20 |
43 | blend bc5 bc4 1 bc3_23 |
44 | blend bc6 bc5 1.99 bc3_21 |
45 | blend bc7 bc6 1.99 bc3_22 |
46 | |
47 | # make inner cylindrical cut |
48 | explode bc7 f |
49 | revol r bc7_1 -1 0 6 1 0 0 100 |
50 | bcut b9 b8 r |
51 | |
52 | # make outer cylindrical cut |
53 | plane p2 -1 0 6 1 0 0 |
54 | pcylinder c2 p2 6 15 |
55 | bcommon res b9 c2 |
56 | |
57 | # show result |
58 | donly res |
a347ef35 |
59 | trotate res 0 0 0 0 0 1 90 |
03392dd2 |
60 | vinit |
61 | vdisplay res |
62 | vsetdispmode 1 |
a347ef35 |
63 | vshowfaceboundary res 1 255 255 255 |
03392dd2 |
64 | vfit |