1 # The following example constructs ANC-101 object of CAM-I.
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).
8 #Title: ANC101 (classic test for CAD modeling from CAM-I)
12 set my_pi 3.1415926535897931
13 set aModelHeight 178.25
14 set aPlatformLength 426.25
15 set aPlatformWidth 201.5
16 set aPlatformHeight 58.9
19 set aPrismHeight [expr $aModelHeight - $aPlatformHeight]
20 set aPrismXOffset [expr $aPlatformLength - $aPrismLength - 69.75]
21 set aPrismYOffset [expr ($aPlatformWidth - $aPrismWidth)/2]
23 #================================================================================
25 box _platform $aPlatformLength $aPlatformWidth $aPlatformHeight
27 # Make screw holes on the platform
28 set aScrewHoleRadius [expr 26.2/2]
29 set aScrewHoleOffset 31
30 pcylinder _screwhole $aScrewHoleRadius $aPlatformHeight
31 ttranslate _screwhole $aScrewHoleOffset $aScrewHoleOffset 0
32 bcut _platform _platform _screwhole
34 ttranslate _screwhole [expr $aPlatformLength - $aScrewHoleOffset] $aScrewHoleOffset 0
35 bcut _platform _platform _screwhole
37 ttranslate _screwhole [expr $aPlatformLength - $aScrewHoleOffset] [expr $aPlatformWidth - $aScrewHoleOffset] 0
38 bcut _platform _platform _screwhole
40 ttranslate _screwhole $aScrewHoleOffset [expr $aPlatformWidth - $aScrewHoleOffset] 0
41 bcut _platform _platform _screwhole
48 set aBottomLevel [expr $aPlatformHeight/2 - $aCaveWidth/2]
49 set aTopLevel [expr $aPlatformHeight/2 + $aCaveWidth/2]
50 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
51 vertex t_v1 0 $aCaveLength $aBottomLevel
52 vertex t_v2 0 $aCaveLength $aTopLevel
57 prism t_s1 t_f1 $aCaveDepth 0 0
58 box t_s2 0 0 $aBottomLevel $aCaveDepth $aCaveLength $aCaveWidth
59 bfuse _backcave t_s1 t_s2
60 bcut _platform _platform _backcave
64 set aRCaveDistToSection 15.5
65 set aCurveParam [expr ($my_pi - acos($aRCaveDistToSection/$aRCaveRadius))]
66 set aRCaveCenterX [expr $aPlatformLength - 162.75]
67 set aRCaveCenterZ [expr $aPlatformHeight/2]
68 circle t_circle $aRCaveCenterX 0 $aRCaveCenterZ 0 1 0 1 0 0 $aRCaveRadius
69 trim t_curve t_circle -$aCurveParam $aCurveParam
71 cvalue t_curve -$aCurveParam t_x t_y t_z
72 vertex t_v1 t_x t_y t_z
73 cvalue t_curve $aCurveParam t_x t_y t_z
74 vertex t_v2 t_x t_y t_z
78 prism t_s t_f 0 $aCaveDepth 0
79 bcut _platform _platform t_s
82 set aFCaveCirclesRadius 4.65
83 set aFCaveBottomWidth 37.8
84 set aFCaveHeight 38.75
86 set aFCaveSmallCircleRadius 9.3
87 circle t_circle1 [expr $aFCaveTopWidth/2] [expr $aFCaveHeight/2] $aFCaveCirclesRadius
88 circle t_circle2 [expr -$aFCaveTopWidth/2] [expr $aFCaveHeight/2] $aFCaveCirclesRadius
89 circle t_circle3 [expr -$aFCaveBottomWidth/2] [expr -$aFCaveHeight/2] $aFCaveCirclesRadius
90 circle t_circle4 [expr $aFCaveBottomWidth/2] [expr -$aFCaveHeight/2] $aFCaveCirclesRadius
92 lintan t_l t_circle1 t_circle2
93 trim t_side1 t_l_1 0 $aFCaveTopWidth
95 lintan t_l t_circle2 t_circle3
96 trim t_side2 t_l_1 0 39.058577803089555
98 lintan t_l t_circle3 t_circle4
99 trim t_side3 t_l_1 0 $aFCaveBottomWidth
101 lintan t_l t_circle4 t_circle1
102 trim t_side4 t_l_1 0 39.196587861700415
104 trim t_circle1 t_circle1 0.15109758878146562 1.5707963267948966
105 trim t_circle2 t_circle2 1.5707963267948966 3.0158086349284448
106 trim t_circle3 t_circle3 3.0158086349284448 4.7123889803846897
107 trim t_circle4 t_circle4 4.7123889803846897 0.15109758878146562
109 plane t_plane 0 0 0 1 0 0 0 1 0
111 to3d t_circle1 t_circle1 t_plane
112 to3d t_circle2 t_circle2 t_plane
113 to3d t_circle3 t_circle3 t_plane
114 to3d t_circle4 t_circle4 t_plane
115 to3d t_side1 t_side1 t_plane
116 to3d t_side2 t_side2 t_plane
117 to3d t_side3 t_side3 t_plane
118 to3d t_side4 t_side4 t_plane
120 mkedge t_e1 t_circle1
122 mkedge t_e3 t_circle2
124 mkedge t_e5 t_circle3
126 mkedge t_e7 t_circle4
129 wire t_w t_e1 t_e2 t_e3 t_e4 t_e5 t_e6 t_e7 t_e8
131 prism t_s1 t_f -$aCaveDepth 0 0
133 circle t_circle 0 [expr $aFCaveTopWidth/2 + $aFCaveBottomWidth/2] 0 1 0 0 $aFCaveSmallCircleRadius
137 prism t_s2 t_f [expr -$aCaveDepth/2] 0 0
139 box t_s3 0 0 -$aFCaveSmallCircleRadius [expr -$aCaveDepth/2] [expr $aFCaveTopWidth/2 + $aFCaveBottomWidth/2] [expr $aFCaveSmallCircleRadius*2]
143 bfuse _frontcave t_s1 t_s2
144 unifysamedom _frontcave _frontcave
146 # Cut this cave from the platform
147 ttranslate _frontcave $aPlatformLength [expr $aPlatformWidth*2/3] [expr $aPlatformHeight/2]
148 bcut _platform _platform _frontcave
150 tmirror _frontcave $aPlatformLength [expr $aPlatformWidth/2] [expr $aPlatformHeight/2] 0 1 0
151 bcut _platform _platform _frontcave
153 #================================================================================
154 # A wedge on the platform
155 box t_box $aPrismXOffset $aPrismYOffset $aPlatformHeight $aPrismLength $aPrismWidth $aPrismHeight
157 set aCutwedgeLength [expr $aPrismHeight/0.57735]
158 wedge _cutwedge $aPlatformLength [expr $aPrismYOffset + $aPrismWidth] $aModelHeight 0 -1 0 -1 0 0 $aCutwedgeLength $aPrismHeight $aPrismWidth 0
160 bcut _prism t_box _cutwedge
162 # Make 9 small holes on a top side
163 set aWedgeSmallHolesRadius 7.68
164 set aWedgeSmallHolesOrbit 67.81
165 set aWedgeHoleXPos [expr $aPrismXOffset + 77.5]
166 set aWedgeHoleYPos [expr $aPrismYOffset + 77.5]
168 plane t_plane $aWedgeHoleXPos $aWedgeHoleYPos [expr $aPlatformHeight + $aPrismHeight/2] 0 0 1 1 0 0
169 pcylinder t_cyl t_plane $aWedgeSmallHolesRadius [expr $aPrismHeight/2]
172 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}
174 # Make a cylinder on a canted side
175 set aWedgeCylinderRadius 38.75
176 set aWedgeCylinderHeight 38.75
177 set aWedgeCantedHeight [expr tan($my_pi/6)*($aCutwedgeLength - 69.75)]
178 set aWedgeCylinderZPos [expr $aModelHeight - $aWedgeCantedHeight/2]
179 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
180 pcylinder t_cyl t_plane $aWedgeCylinderRadius $aWedgeCylinderHeight
182 blend t_cyl t_cyl 3 t_cyl_1
183 bfuse _prism _prism t_cyl
184 unifysamedom _prism _prism
186 # Make a hole in the cylinder on the wedge
187 pcylinder t_cyl t_plane [expr $aWedgeCylinderRadius/2] 100
188 ttranslate t_cyl [expr -60*cos($my_pi/3)] 0 [expr -60*sin($my_pi/3)]
189 bcut _prism _prism t_cyl
191 # Make a hole on a right side of the wedge
192 plane t_plane [expr $aPlatformLength - 162.75] $aPrismYOffset [expr $aModelHeight - $aWedgeCantedHeight] 0 1 0 1 0 0
193 pcylinder t_cyl t_plane 13.1 [expr $aPrismWidth/2]
194 bcut _prism _prism t_cyl
196 # Fuse the platform and the prism
197 bfuse _model _platform _prism
199 # Make a pass-through hole
200 set aWedgeHoleInnerRadius 38.77
201 set aWedgeHoleOuterRadius 58.13
202 set aWedgeHoleBottomInnerRadius 50.38
204 # Cylinders from bottom to top
205 plane t_plane $aWedgeHoleXPos $aWedgeHoleYPos 0
206 pcylinder t_cyl1 t_plane $aWedgeHoleOuterRadius 10
207 pcylinder t_cyl2 t_plane $aWedgeHoleBottomInnerRadius 10
208 pcylinder t_cyl3 t_plane $aWedgeHoleInnerRadius [expr $aModelHeight - 30]
209 pcylinder t_cyl4 t_plane $aWedgeHoleOuterRadius 10
211 ttranslate t_cyl2 0 0 10
212 ttranslate t_cyl3 0 0 20
213 ttranslate t_cyl4 0 0 [expr $aModelHeight - 10]
215 bfuse _cutCylindricShape t_cyl1 t_cyl2
216 bfuse _cutCylindricShape _cutCylindricShape t_cyl3
217 bfuse _cutCylindricShape _cutCylindricShape t_cyl4
219 bcut _model _model _cutCylindricShape
221 # Add a block on left side
222 circle t_circle1 0 0 38.75
223 circle t_circle2 [expr 38.75 + 9.3] [expr -57.35 + 9.3] 9.3
224 circle t_circle3 [expr -38.75 - 9.3] [expr -57.35 + 9.3] 9.3
226 lintan t_l t_circle1 t_circle2
227 trim t_line12 t_l_2 0 48.05
229 lintan t_l t_circle2 t_circle3
230 trim t_line23 t_l_3 0 96.1
232 lintan t_l t_circle3 t_circle1
233 trim t_line31 t_l_4 0 48.05
235 trim t_circle1 t_circle1 0 $my_pi
236 trim t_circle2 t_circle2 $my_pi 4.7123889803846897
237 trim t_circle3 t_circle3 4.7123889803846897 6.2831853071795862
241 plane t_plane [expr $aPrismXOffset + 77.5] [expr $aPrismYOffset + $aPrismWidth] [expr $aPlatformHeight + 57.35] 0 1 0 -1 0 0
243 to3d t_circle1 t_circle1 t_plane
244 to3d t_circle2 t_circle2 t_plane
245 to3d t_circle3 t_circle3 t_plane
246 to3d t_line12 t_line12 t_plane
247 to3d t_line23 t_line23 t_plane
248 to3d t_line31 t_line31 t_plane
250 mkedge t_e1 t_circle1
252 mkedge t_e3 t_circle3
254 mkedge t_e5 t_circle2
257 wire t_w t_e1 t_e2 t_e3 t_e4 t_e5 t_e6
259 prism t_s t_f 0 $aCaveDepth 0
261 bfuse _model _model t_s
266 # Make a weld at joint edges of platform and wedge
267 blend _model _model 2 _model_26
268 blend _model _model 2 _model_27
269 blend _model _model 2 _model_28
270 blend _model _model 2 _model_29
271 blend _model _model 2 _model_31
274 blend result _model 2 _model_161
278 vinit Driver1/Viewer1/View1
279 vsetcolorbg 200 200 255
280 vdisplay -dispMode 1 result
282 vaspects result -setFaceBoundaryDraw 1 -mostContinuity c2