MBBGehauseRohteil.tcl 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  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. pload MODELING XSDRAW
  16. # -----------------------------------------------------------------------------
  17. # Prepare base contour
  18. # -----------------------------------------------------------------------------
  19. point p1 0 0
  20. point p2 35 0
  21. point p3 39 4
  22. point p4 39 10
  23. point p5 35 13
  24. point p6 27 13
  25. point p7 27 10
  26. point p8 22 10
  27. point p9 20 8
  28. point p10 20 4
  29. point p11 11 4
  30. point p12 11 3
  31. point p13 5 3
  32. point p14 5 13
  33. point p15 0 13
  34. point p16 0 9
  35. point p17 4 9
  36. point p18 4 4
  37. point p19 0 4
  38. line l1 0 0 1 0; trim l1 l1 0 35
  39. line l2 39 4 0 1; trim l2 l2 0 6
  40. line l3 35 13 -1 0; trim l3 l3 0 8
  41. line l4 27 13 0 -1; trim l4 l4 0 3
  42. line l5 27 10 -1 0; trim l5 l5 0 5
  43. line l6 20 8 0 -1; trim l6 l6 0 4
  44. line l7 20 4 -1 0; trim l7 l7 0 9
  45. line l8 11 4 0 -1; trim l8 l8 0 1
  46. line l9 11 3 -1 0; trim l9 l9 0 6
  47. line l10 5 3 0 1; trim l10 l10 0 10
  48. line l11 5 13 -1 0; trim l11 l11 0 5
  49. line l12 0 13 0 -1; trim l12 l12 0 4
  50. line l13 0 9 1 0; trim l13 l13 0 4
  51. line l14 4 9 0 -1; trim l14 l14 0 5
  52. line l15 4 4 -1 0; trim l15 l15 0 4
  53. line l16 0 4 0 -1; trim l16 l16 0 4
  54. # We use Bezier curves here instead of circles. This does not make
  55. # a great sense since we are focused on a principle rather than
  56. # trying to follow the drawing precisely
  57. 2dbeziercurve c1 3 35 0 1 39 0 1 39 4 1
  58. 2dbeziercurve c2 3 39 10 1 39 13 1 35 13 1
  59. 2dbeziercurve c3 3 22 10 1 20 10 1 20 8 1
  60. # Circle for a big hole
  61. circle cbig 33 6.5 4.0
  62. # Create topology
  63. mkedge e1 l1
  64. mkedge e2 c1
  65. mkedge e3 l2
  66. mkedge e4 c2
  67. mkedge e5 l3
  68. mkedge e6 l4
  69. mkedge e7 l5
  70. mkedge e8 c3
  71. mkedge e9 l6
  72. mkedge e10 l7
  73. mkedge e11 l8
  74. mkedge e12 l9
  75. mkedge e13 l10
  76. mkedge e14 l11
  77. mkedge e15 l12
  78. mkedge e16 l13
  79. mkedge e17 l14
  80. mkedge e18 l15
  81. mkedge e19 l16
  82. wire wout e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12 e13 e14 e15 e16 e17 e18 e19
  83. mkedge ein1 cbig
  84. wire win1 ein1
  85. mkplane f wout
  86. mkplane f1 win1
  87. fixshape f f
  88. fixshape f1 f1
  89. bcut f f f1
  90. # -----------------------------------------------------------------------------
  91. # Make extrusion
  92. # -----------------------------------------------------------------------------
  93. prism p f 0 0 3
  94. # -----------------------------------------------------------------------------
  95. # Prepare a contour on top face
  96. # -----------------------------------------------------------------------------
  97. point p1 0 0
  98. point p2 28 0
  99. point p3 28 13
  100. point p4 27 13
  101. point p5 27 10
  102. point p6 22 10
  103. point p7 20 8
  104. point p8 20 4
  105. point p9 11 4
  106. point p10 11 3
  107. point p11 5 3
  108. point p12 5 13
  109. point p13 0 13
  110. line l1 0 0 1 0; trim l1 l1 0 28
  111. line l2 28 0 0 1; trim l2 l2 0 13
  112. line l3 28 13 -1 0; trim l3 l3 0 1
  113. line l4 27 13 0 -1; trim l4 l4 0 3
  114. line l5 27 10 -1 0; trim l5 l5 0 5
  115. line l6 20 8 0 -1; trim l6 l6 0 4
  116. line l7 20 4 -1 0; trim l7 l7 0 9
  117. line l8 11 4 0 -1; trim l8 l8 0 1
  118. line l9 11 3 -1 0; trim l9 l9 0 6
  119. line l10 5 3 0 1; trim l10 l10 0 10
  120. line l11 5 13 -1 0; trim l11 l11 0 5
  121. line l12 0 13 0 -1; trim l12 l12 0 13
  122. 2dbeziercurve c3 3 22 10 1 20 10 1 20 8 1
  123. # Create topology on top face
  124. plane top_pln 0 0 3
  125. to3d l1 l1 top_pln
  126. to3d l2 l2 top_pln
  127. to3d l3 l3 top_pln
  128. to3d l4 l4 top_pln
  129. to3d l5 l5 top_pln
  130. to3d c3 c3 top_pln
  131. to3d l6 l6 top_pln
  132. to3d l7 l7 top_pln
  133. to3d l8 l8 top_pln
  134. to3d l9 l9 top_pln
  135. to3d l10 l10 top_pln
  136. to3d l11 l11 top_pln
  137. to3d l12 l12 top_pln
  138. mkedge e1 l1
  139. mkedge e2 l2
  140. mkedge e3 l3
  141. mkedge e4 l4
  142. mkedge e5 l5
  143. mkedge e6 c3
  144. mkedge e7 l6
  145. mkedge e8 l7
  146. mkedge e9 l8
  147. mkedge e10 l9
  148. mkedge e11 l10
  149. mkedge e12 l11
  150. mkedge e13 l12
  151. wire wout e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12 e13
  152. mkface ftop top_pln wout
  153. fixshape ftop ftop
  154. # -----------------------------------------------------------------------------
  155. # Make top extrusion
  156. # -----------------------------------------------------------------------------
  157. prism ptop ftop 0 0 1.5
  158. # -----------------------------------------------------------------------------
  159. # Fuse top and bottom parts and make features
  160. # -----------------------------------------------------------------------------
  161. # Fuse top and bottom
  162. bfuse p p ptop
  163. # Create a hole
  164. plane top_pln 0 0 10
  165. circle csmall 23 6.5 2.0
  166. to3d hole_top csmall top_pln
  167. plane bot_pln 0 0 -10
  168. to3d hole_bot csmall bot_pln
  169. mkedge ehole_top hole_top
  170. mkedge ehole_bot hole_bot
  171. wire whole_top ehole_top
  172. wire whole_bot ehole_bot
  173. thrusections tool 1 1 whole_top whole_bot
  174. bcut p p tool
  175. # Add extrusion around the hole
  176. plane top_pln 0 0 4.5
  177. circle csmall_outer 23 6.5 3.0
  178. circle csmall_inner 23 6.5 2.0
  179. to3d hole_top_outer csmall_outer top_pln
  180. to3d hole_top_inner csmall_inner top_pln
  181. mkedge e_hole_top_outer hole_top_outer
  182. mkedge e_hole_top_inner hole_top_inner
  183. wire w_hole_top_outer e_hole_top_outer
  184. wire w_hole_top_inner e_hole_top_inner
  185. mkface ftube_outer top_pln w_hole_top_outer
  186. mkface ftube_inner top_pln w_hole_top_inner
  187. fixshape ftube_outer ftube_outer
  188. fixshape ftube_inner ftube_inner
  189. prism ptube_outer ftube_outer 0 0 3
  190. prism ptube_inner ftube_inner 0 0 3
  191. bcut ptube ptube_outer ptube_inner
  192. bfuse p p ptube
  193. # Build elevation "teeths" near the big hole
  194. box t1 26 0 0 3 2.5 7
  195. box t2 26 13 0 3 -3 7
  196. bfuse p p t1
  197. bfuse p p t2
  198. # Build elevation "teeths" near the tail
  199. box t1 0 0 0 5 3 8
  200. box t2 0 13 0 5 -3 8
  201. bfuse p p t1
  202. bfuse p p t2
  203. # Remove some material from tail "teeths"
  204. box blend_box 0 -5 0 5 25 5
  205. trotate blend_box blend_box 0 0 0 0 1 0 -10
  206. ttranslate blend_box blend_box 2.5 0 2.25
  207. bcut p p blend_box
  208. # Remove some material from "teeths" near big hole
  209. box blend_box 0 -5 0 5 25 5
  210. trotate blend_box blend_box 0 0 0 0 1 0 -9
  211. ttranslate blend_box blend_box 14.5 0 1.5
  212. bcut p p blend_box
  213. # Hole at the tail
  214. ellipse tail_hole1 0 0 0.75 0.5
  215. plane base_pln 2 6.5 0
  216. to3d tail_hole_3d1 tail_hole1 base_pln
  217. mkedge e_tail_hole1 tail_hole_3d1
  218. wire w_tail_hole1 e_tail_hole1
  219. plane base_pln 2 6.5 20
  220. to3d tail_hole_3d2 tail_hole1 base_pln
  221. mkedge e_tail_hole2 tail_hole_3d2
  222. wire w_tail_hole2 e_tail_hole2
  223. thrusections tail_tube 1 1 w_tail_hole1 w_tail_hole2
  224. bcut p p tail_tube
  225. # Chamfer at tail
  226. box blend_box 0 3 0 5 7 5
  227. trotate blend_box blend_box 0 0 0 0 1 0 -5
  228. ttranslate blend_box blend_box 2 0 1.5
  229. bcut p p blend_box
  230. # -----------------------------------------------------------------------------
  231. # Extract final solid and simplify it
  232. # -----------------------------------------------------------------------------
  233. explode p So
  234. unifysamedom result p_1
  235. # Show result
  236. pload VISUALIZATION
  237. vinit Driver1/Viewer1/View1
  238. vbackground -color C8C8FF
  239. vdisplay -dispMode 1 result
  240. vfit
  241. vaspects result -setFaceBoundaryDraw 1