ANC101.tcl 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. # The following example constructs ANC-101 object of CAM-I.
  2. #
  3. # This model was used as a test part for comparing modeling systems in 1979 and
  4. # again in 1983. The tests were organized by Computer Aided Manufacturing
  5. # International (CAM-I).
  6. #
  7. #Category: Modeling
  8. #Title: ANC101 (classic test for CAD modeling from CAM-I)
  9. pload MODELING
  10. set my_pi 3.1415926535897931
  11. set aModelHeight 178.25
  12. set aPlatformLength 426.25
  13. set aPlatformWidth 201.5
  14. set aPlatformHeight 58.9
  15. set aPrismLength 279
  16. set aPrismWidth 155
  17. set aPrismHeight [expr $aModelHeight - $aPlatformHeight]
  18. set aPrismXOffset [expr $aPlatformLength - $aPrismLength - 69.75]
  19. set aPrismYOffset [expr ($aPlatformWidth - $aPrismWidth)/2]
  20. #================================================================================
  21. # A base of the model
  22. box _platform $aPlatformLength $aPlatformWidth $aPlatformHeight
  23. # Make screw holes on the platform
  24. set aScrewHoleRadius [expr 26.2/2]
  25. set aScrewHoleOffset 31
  26. pcylinder _screwhole $aScrewHoleRadius $aPlatformHeight
  27. ttranslate _screwhole $aScrewHoleOffset $aScrewHoleOffset 0
  28. bcut _platform _platform _screwhole
  29. reset _screwhole
  30. ttranslate _screwhole [expr $aPlatformLength - $aScrewHoleOffset] $aScrewHoleOffset 0
  31. bcut _platform _platform _screwhole
  32. reset _screwhole
  33. ttranslate _screwhole [expr $aPlatformLength - $aScrewHoleOffset] [expr $aPlatformWidth - $aScrewHoleOffset] 0
  34. bcut _platform _platform _screwhole
  35. reset _screwhole
  36. ttranslate _screwhole $aScrewHoleOffset [expr $aPlatformWidth - $aScrewHoleOffset] 0
  37. bcut _platform _platform _screwhole
  38. reset _screwhole
  39. # Back side cave
  40. set aCaveLength 81.38
  41. set aCaveDepth 10
  42. set aCaveWidth 19.38
  43. set aBottomLevel [expr $aPlatformHeight/2 - $aCaveWidth/2]
  44. set aTopLevel [expr $aPlatformHeight/2 + $aCaveWidth/2]
  45. beziercurve t_bcurve 4 0 $aCaveLength $aBottomLevel 3 0 [expr $aCaveLength + $aCaveWidth/2] $aBottomLevel 6 0 [expr $aCaveLength + $aCaveWidth/2] $aTopLevel 6 0 $aCaveLength $aTopLevel 3
  46. vertex t_v1 0 $aCaveLength $aBottomLevel
  47. vertex t_v2 0 $aCaveLength $aTopLevel
  48. mkedge t_e1 t_bcurve
  49. edge t_e2 t_v1 t_v2
  50. wire t_w t_e1 t_e2
  51. mkplane t_f1 t_w
  52. prism t_s1 t_f1 $aCaveDepth 0 0
  53. box t_s2 0 0 $aBottomLevel $aCaveDepth $aCaveLength $aCaveWidth
  54. bfuse _backcave t_s1 t_s2
  55. bcut _platform _platform _backcave
  56. # Right side cave
  57. set aRCaveRadius 26.2
  58. set aRCaveDistToSection 15.5
  59. set aCurveParam [expr ($my_pi - acos($aRCaveDistToSection/$aRCaveRadius))]
  60. set aRCaveCenterX [expr $aPlatformLength - 162.75]
  61. set aRCaveCenterZ [expr $aPlatformHeight/2]
  62. circle t_circle $aRCaveCenterX 0 $aRCaveCenterZ 0 1 0 1 0 0 $aRCaveRadius
  63. trim t_curve t_circle -$aCurveParam $aCurveParam
  64. mkedge t_e1 t_curve
  65. cvalue t_curve -$aCurveParam t_x t_y t_z
  66. vertex t_v1 t_x t_y t_z
  67. cvalue t_curve $aCurveParam t_x t_y t_z
  68. vertex t_v2 t_x t_y t_z
  69. edge t_e2 t_v1 t_v2
  70. wire t_w t_e1 t_e2
  71. mkplane t_f t_w
  72. prism t_s t_f 0 $aCaveDepth 0
  73. bcut _platform _platform t_s
  74. # Caves on front side
  75. set aFCaveCirclesRadius 4.65
  76. set aFCaveBottomWidth 37.8
  77. set aFCaveHeight 38.75
  78. set aFCaveTopWidth 27
  79. set aFCaveSmallCircleRadius 9.3
  80. circle t_circle1 [expr $aFCaveTopWidth/2] [expr $aFCaveHeight/2] $aFCaveCirclesRadius
  81. circle t_circle2 [expr -$aFCaveTopWidth/2] [expr $aFCaveHeight/2] $aFCaveCirclesRadius
  82. circle t_circle3 [expr -$aFCaveBottomWidth/2] [expr -$aFCaveHeight/2] $aFCaveCirclesRadius
  83. circle t_circle4 [expr $aFCaveBottomWidth/2] [expr -$aFCaveHeight/2] $aFCaveCirclesRadius
  84. lintan t_l t_circle1 t_circle2
  85. trim t_side1 t_l_1 0 $aFCaveTopWidth
  86. lintan t_l t_circle2 t_circle3
  87. trim t_side2 t_l_1 0 39.058577803089555
  88. lintan t_l t_circle3 t_circle4
  89. trim t_side3 t_l_1 0 $aFCaveBottomWidth
  90. lintan t_l t_circle4 t_circle1
  91. trim t_side4 t_l_1 0 39.196587861700415
  92. trim t_circle1 t_circle1 0.15109758878146562 1.5707963267948966
  93. trim t_circle2 t_circle2 1.5707963267948966 3.0158086349284448
  94. trim t_circle3 t_circle3 3.0158086349284448 4.7123889803846897
  95. trim t_circle4 t_circle4 4.7123889803846897 0.15109758878146562
  96. plane t_plane 0 0 0 1 0 0 0 1 0
  97. to3d t_circle1 t_circle1 t_plane
  98. to3d t_circle2 t_circle2 t_plane
  99. to3d t_circle3 t_circle3 t_plane
  100. to3d t_circle4 t_circle4 t_plane
  101. to3d t_side1 t_side1 t_plane
  102. to3d t_side2 t_side2 t_plane
  103. to3d t_side3 t_side3 t_plane
  104. to3d t_side4 t_side4 t_plane
  105. mkedge t_e1 t_circle1
  106. mkedge t_e2 t_side1
  107. mkedge t_e3 t_circle2
  108. mkedge t_e4 t_side2
  109. mkedge t_e5 t_circle3
  110. mkedge t_e6 t_side3
  111. mkedge t_e7 t_circle4
  112. mkedge t_e8 t_side4
  113. wire t_w t_e1 t_e2 t_e3 t_e4 t_e5 t_e6 t_e7 t_e8
  114. mkplane t_f t_w
  115. prism t_s1 t_f -$aCaveDepth 0 0
  116. circle t_circle 0 [expr $aFCaveTopWidth/2 + $aFCaveBottomWidth/2] 0 1 0 0 $aFCaveSmallCircleRadius
  117. mkedge t_e t_circle
  118. wire t_w t_e
  119. mkplane t_f t_w
  120. prism t_s2 t_f [expr -$aCaveDepth/2] 0 0
  121. box t_s3 0 0 -$aFCaveSmallCircleRadius [expr -$aCaveDepth/2] [expr $aFCaveTopWidth/2 + $aFCaveBottomWidth/2] [expr $aFCaveSmallCircleRadius*2]
  122. # Compile elements
  123. bfuse t_s2 t_s2 t_s3
  124. bfuse _frontcave t_s1 t_s2
  125. unifysamedom _frontcave _frontcave
  126. # Cut this cave from the platform
  127. ttranslate _frontcave $aPlatformLength [expr $aPlatformWidth*2/3] [expr $aPlatformHeight/2]
  128. bcut _platform _platform _frontcave
  129. tmirror _frontcave $aPlatformLength [expr $aPlatformWidth/2] [expr $aPlatformHeight/2] 0 1 0
  130. bcut _platform _platform _frontcave
  131. #================================================================================
  132. # A wedge on the platform
  133. box t_box $aPrismXOffset $aPrismYOffset $aPlatformHeight $aPrismLength $aPrismWidth $aPrismHeight
  134. set aCutwedgeLength [expr $aPrismHeight/0.57735]
  135. wedge _cutwedge $aPlatformLength [expr $aPrismYOffset + $aPrismWidth] $aModelHeight 0 -1 0 -1 0 0 $aCutwedgeLength $aPrismHeight $aPrismWidth 0
  136. bcut _prism t_box _cutwedge
  137. # Make 9 small holes on a top side
  138. set aWedgeSmallHolesRadius 7.68
  139. set aWedgeSmallHolesOrbit 67.81
  140. set aWedgeHoleXPos [expr $aPrismXOffset + 77.5]
  141. set aWedgeHoleYPos [expr $aPrismYOffset + 77.5]
  142. plane t_plane $aWedgeHoleXPos $aWedgeHoleYPos [expr $aPlatformHeight + $aPrismHeight/2] 0 0 1 1 0 0
  143. pcylinder t_cyl t_plane $aWedgeSmallHolesRadius [expr $aPrismHeight/2]
  144. set i 2
  145. while {$i <= 10} {ttranslate t_cyl [expr $aWedgeSmallHolesOrbit*cos($i*$my_pi/6)] [expr $aWedgeSmallHolesOrbit*sin($i*$my_pi/6)] 0; bcut _prism _prism t_cyl; reset t_cyl; incr i}
  146. # Make a cylinder on a canted side
  147. set aWedgeCylinderRadius 38.75
  148. set aWedgeCylinderHeight 38.75
  149. set aWedgeCantedHeight [expr tan($my_pi/6)*($aCutwedgeLength - 69.75)]
  150. set aWedgeCylinderZPos [expr $aModelHeight - $aWedgeCantedHeight/2]
  151. plane t_plane [expr $aPrismXOffset + $aPrismLength*3/4] [expr $aPrismYOffset + $aPrismWidth/2] $aWedgeCylinderZPos cos($my_pi/3) 0 sin($my_pi/3) 0 1 0
  152. pcylinder t_cyl t_plane $aWedgeCylinderRadius $aWedgeCylinderHeight
  153. explode t_cyl e
  154. blend t_cyl t_cyl 3 t_cyl_1
  155. bfuse _prism _prism t_cyl
  156. unifysamedom _prism _prism
  157. # Make a hole in the cylinder on the wedge
  158. pcylinder t_cyl t_plane [expr $aWedgeCylinderRadius/2] 100
  159. ttranslate t_cyl [expr -60*cos($my_pi/3)] 0 [expr -60*sin($my_pi/3)]
  160. bcut _prism _prism t_cyl
  161. # Make a hole on a right side of the wedge
  162. plane t_plane [expr $aPlatformLength - 162.75] $aPrismYOffset [expr $aModelHeight - $aWedgeCantedHeight] 0 1 0 1 0 0
  163. pcylinder t_cyl t_plane 13.1 [expr $aPrismWidth/2]
  164. bcut _prism _prism t_cyl
  165. # Fuse the platform and the prism
  166. bfuse _model _platform _prism
  167. # Make a pass-through hole
  168. set aWedgeHoleInnerRadius 38.77
  169. set aWedgeHoleOuterRadius 58.13
  170. set aWedgeHoleBottomInnerRadius 50.38
  171. # Cylinders from bottom to top
  172. plane t_plane $aWedgeHoleXPos $aWedgeHoleYPos 0
  173. pcylinder t_cyl1 t_plane $aWedgeHoleOuterRadius 10
  174. pcylinder t_cyl2 t_plane $aWedgeHoleBottomInnerRadius 10
  175. pcylinder t_cyl3 t_plane $aWedgeHoleInnerRadius [expr $aModelHeight - 30]
  176. pcylinder t_cyl4 t_plane $aWedgeHoleOuterRadius 10
  177. ttranslate t_cyl2 0 0 10
  178. ttranslate t_cyl3 0 0 20
  179. ttranslate t_cyl4 0 0 [expr $aModelHeight - 10]
  180. bfuse _cutCylindricShape t_cyl1 t_cyl2
  181. bfuse _cutCylindricShape _cutCylindricShape t_cyl3
  182. bfuse _cutCylindricShape _cutCylindricShape t_cyl4
  183. bcut _model _model _cutCylindricShape
  184. # Add a block on left side
  185. circle t_circle1 0 0 38.75
  186. circle t_circle2 [expr 38.75 + 9.3] [expr -57.35 + 9.3] 9.3
  187. circle t_circle3 [expr -38.75 - 9.3] [expr -57.35 + 9.3] 9.3
  188. lintan t_l t_circle1 t_circle2
  189. trim t_line12 t_l_2 0 48.05
  190. lintan t_l t_circle2 t_circle3
  191. trim t_line23 t_l_3 0 96.1
  192. lintan t_l t_circle3 t_circle1
  193. trim t_line31 t_l_4 0 48.05
  194. trim t_circle1 t_circle1 0 $my_pi
  195. trim t_circle2 t_circle2 $my_pi 4.7123889803846897
  196. trim t_circle3 t_circle3 4.7123889803846897 6.2831853071795862
  197. reverse t_circle1
  198. plane t_plane [expr $aPrismXOffset + 77.5] [expr $aPrismYOffset + $aPrismWidth] [expr $aPlatformHeight + 57.35] 0 1 0 -1 0 0
  199. to3d t_circle1 t_circle1 t_plane
  200. to3d t_circle2 t_circle2 t_plane
  201. to3d t_circle3 t_circle3 t_plane
  202. to3d t_line12 t_line12 t_plane
  203. to3d t_line23 t_line23 t_plane
  204. to3d t_line31 t_line31 t_plane
  205. mkedge t_e1 t_circle1
  206. mkedge t_e2 t_line31
  207. mkedge t_e3 t_circle3
  208. mkedge t_e4 t_line23
  209. mkedge t_e5 t_circle2
  210. mkedge t_e6 t_line12
  211. wire t_w t_e1 t_e2 t_e3 t_e4 t_e5 t_e6
  212. mkplane t_f t_w
  213. prism t_s t_f 0 $aCaveDepth 0
  214. bfuse _model _model t_s
  215. # Make fillets
  216. explode _model e
  217. # Make a weld at joint edges of platform and wedge
  218. blend _model _model 2 _model_27
  219. blend _model _model 2 _model_28
  220. blend _model _model 2 _model_29
  221. blend _model _model 2 _model_30
  222. blend _model _model 2 _model_32
  223. # Cylinder on wedge
  224. blend result _model 2 _model_161
  225. # Show result
  226. pload VISUALIZATION
  227. vinit Driver1/Viewer1/View1
  228. vbackground -color C8C8FF
  229. vdisplay -dispMode 1 result
  230. vfit
  231. vaspects result -setFaceBoundaryDraw 1 -mostContinuity c2