Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
import queryabolt
import cadquery as cq
# This is to protect the camera cable from the sharp edges of the top of the
# extrusion and guide it on the right path towards the Pi.
class Workplane(queryabolt.WorkplaneMixin, cq.Workplane):
pass
press_fit = 0
tight_fit = 0.1
fit = 0.2
# Chamfer
c = 0.5
# Thickness. Not load-bearing by any means.
t = 2.4
v_slot_hold_h = 5
v_slot_d = 20
v_slot_slot_w = 6
v_slot_d_fit = v_slot_d + press_fit
v_slot_bolt = "M4"
# We need to move it past the housing to avoid getting it tangled in fingers.
worm_bearing_holder_l = 27
housing_l = 42.1382 # both generated by `gearbox.scad`
slider_t = 4 # minimal v-slot wall thickness
knob_d = 42 # semi-arbirtrary, based on clearance
housing_with_knob_l = housing_l - worm_bearing_holder_l / 2 + knob_d / 2 + fit
w = v_slot_d_fit + 2 * t
l = housing_with_knob_l + w + (slider_t - t)
guide_h = w / 4
rail_h = guide_h * 1.75
t_h = v_slot_hold_h + t + rail_h
def guide():
guide_w = w / 8
# Make the v-slot mount, fillet edges ribbon will pass through.
vslotMount = cq.Workplane().box(w, w, v_slot_hold_h + t)
vslotMount = vslotMount.faces("-Z").shell(-t, kind = "intersection")
vslotMount = vslotMount.faces(">>Y").workplane().rect(w, v_slot_hold_h + t).extrude(l - w)
# vslotMount = vslotMount.edges("#Y and >Z").fillet(1)
# Make the top guide.
vslotMount.faces("+Z").workplane(centerOption="CenterOfBoundBox").tag("top")
vslotMount = vslotMount.workplaneFromTagged("top").rect(w, l).extrude(guide_h)
vslotMount = vslotMount.edges(">Z and |X").fillet(guide_h * 0.75)
vslotMount = vslotMount.workplaneFromTagged("top").pushPoints([(-(w - guide_w) / 2, 0), ((w - guide_w) / 2, 0)]).rect(guide_w, l).extrude(rail_h)
vslotMount = vslotMount.edges(">Z").fillet(1)
# And clearance for the rack. In the non v-slot portion, it can be used to route
# illumination wiring.
vslotMount = vslotMount.faces("<Y").workplane().center(0, -v_slot_hold_h / 2 - t).rect(v_slot_slot_w, v_slot_hold_h).cutThruAll()
e_o = -l / 2 + w
e_d = housing_l
# To facilitate illumination routing here, make a hole allowing the cable to join
# the camera cable.
p_d = 4
vslotMount = vslotMount.faces(">Z").workplane(centerOption="CenterOfBoundBox").move(0, e_o + p_d / 2).rect(v_slot_slot_w, p_d).cutThruAll()
# For optional zip ties.
vslotMount = (vslotMount.faces(">X").workplane(centerOption="CenterOfBoundBox")
.pushPoints([(e_o + e_d / 2, 0), (e_o + e_d * 3/4, 0), (-l / 2 + w / 2, 0)])
.slot2D(3, 1.5, 0).cutThruAll()
)
return vslotMount
# If you find the cable slipping out of the guide, the zip tie slots, or the clip are for you:
def clip(fit = 0):
clip = cq.Workplane("XZ")
w_fit = (w + fit) / 2
h = t_h + fit
clip_t = t * 3 / 4
pts = [
(w_fit - clip_t, 0),
(w_fit - clip_t, -clip_t),
(w_fit, -clip_t),
(w_fit + t, 0),
(w_fit + t, h + t),
(0, h + t),
(0, h),
(w_fit, h),
(w_fit, 0),
(w_fit - clip_t, -0),
]
return clip.polyline(pts).mirrorY().extrude(t)
show_object(guide(), {"name":"top-cable-guide"})
show_object(clip(fit).translate((0, 0, -(v_slot_hold_h + t + tight_fit) / 2)), {"name":"top-cable-clip"})
7f4e6f21cThis file is pinned to the selected release. Download the original to open it in your design tool.