-
Notifications
You must be signed in to change notification settings - Fork 0
/
top-cable-guide.py
99 lines (78 loc) · 3.29 KB
/
top-cable-guide.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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"})