1
0
mirror of git://projects.qi-hardware.com/ben-counterweight.git synced 2025-01-14 18:31:07 +02:00

Improved the mold for better yield.

- cw.py: added another air escape for remaining corner with occasional air
  pockets
- cw.py: inlets terminate in a cylinder, to allow for piece tolerances (the
  real piece I use is in fact a bit smaller than I tell HeeksCAD, so that
  HeeksCAD flattens the entire surface)
- cw.py: commented the parameters for inlets and escapes
This commit is contained in:
Werner Almesberger 2010-08-06 20:34:49 -03:00
parent 16b7cc9562
commit e910ea067e

29
cw.py
View File

@ -28,10 +28,26 @@ y_axis = 16.0
off_x = -15+18
off_y = -46+5
#
# Radius for lead inlets and air escapes
#
channel_radius = 1 # mm
inlet_radius = 7
#
# Inlets have a large opening on the outside: first a cylinder of radius
# "inlet_radius" and depth "inlet_streight", then a cone to the channel radius.
# The cone's height is variable. At the end, there is a channel of length
# "shaft". The goals are to have a wide opening to make it easy to pour the
# metal, and to create a buffer for thermal energy.
#
inlet_radius = 6.5
inlet_straight = 3
shaft = 3
ymax_piece = 50
#
# This maximum y dimension of the piece from which the mold is machined
#
ymax_piece = 45
total_mass = 0
total_torque = 0
@ -106,10 +122,14 @@ def channel(sk, x, y, r0, r1):
else:
cad.cylinder(x, y, 0, r0, shaft)
cyl = cad.getlastobj()
cad.cone(x, y, shaft, r0, r1, ymax_piece-y-shaft)
cad.cone(x, y, shaft, r0, r1, ymax_piece-y-shaft-inlet_straight)
cone = cad.getlastobj()
cad.fuse(cyl, cone)
obj = cad.getlastobj()
cad.cylinder(x, y, ymax_piece-inlet_straight-y, r1, inlet_straight)
cyl = cad.getlastobj()
cad.fuse(obj, cyl)
obj = cad.getlastobj()
cad.rotate(obj, x, y, 0, 1, 0, 0, -math.pi/2)
cad.cut(sk, obj)
return cad.getlastobj()
@ -241,7 +261,7 @@ make_base()
if __name__ != "__main__":
cad.translate(group, -15, -46, -5)
cad.translate(group, 18, 5, 0)
sk = do_rect_cad(0, 0, 0, 120, 45, 0)
sk = do_rect_cad(0, 0, 0, 120, ymax_piece, 0)
cad.extrude(sk, -10)
sk = cad.getlastobj()
cad.cut(sk, group)
@ -252,6 +272,7 @@ if __name__ != "__main__":
sk = escape(sk, 100-channel_radius, 69)
sk = escape(sk, 60.5-channel_radius, 65)
sk = escape(sk, 62.5+channel_radius, 65)
sk = escape(sk, 82.5-channel_radius, 65)
sk = inlet(sk, 50, 65)
print >>sys.stderr, "total mass =", total_mass, "g"