Cleanup and adjustments for rev2

* Removed holes that make no sense anymore
* Made case shorter to avoid unsightly gap between screen and keyboard
* Added comments
This commit is contained in:
Roberto Alsina 2023-02-01 10:21:29 -03:00
parent 6eb3eba4f2
commit 4b0cf1cfa0
6 changed files with 152000 additions and 180823 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -14,7 +14,7 @@ kbd_angle = 5
# Size of the whole object # Size of the whole object
width = kbd_width + 2 * shell_t width = kbd_width + 2 * shell_t
height = 164 # Max bed size height = 159
thickness = 20 + shell_t # 20 inside thickness = 20 + shell_t # 20 inside
# Insert Positions # Insert Positions
@ -33,7 +33,9 @@ kbd_pillar_positions = [
] ]
# mounting holes # 2-level mounting pillars for the kbd
# Width of these need to be tweaked for
# each specific keyboard
kbd_pillars = ( kbd_pillars = (
cq.Sketch() cq.Sketch()
.push(kbd_pillar_positions) .push(kbd_pillar_positions)
@ -71,32 +73,8 @@ mounting_pillars = (
screw_holes = cq.Sketch().push(mounting_pillar_positions).circle(3, mode="a") screw_holes = cq.Sketch().push(mounting_pillar_positions).circle(3, mode="a")
# battery_holder = ( # Hole for the USB hub's exposed port
# cq.Sketch()
# .polygon(
# [(-67, 5), (0, 5), (0, -12), (-67, -12), (-67, 5)],
# mode="a",
# )
# .trapezoid(83, 83, 90, mode="a")
# .trapezoid(80, 80, 90, mode="s")
# .polygon(
# [(-67, 3), (0, 3), (0, -10), (-67, -10), (-67, 3)],
# mode="s",
# )
# # Cutout for the
# .polygon(
# [(-67, 30), (0, 30), (0, 12), (-67, 12), (-67, 30)],
# mode="s",
# )
# )
power_in = cq.Sketch().circle(5, mode="a")
usb_in = cq.Sketch().trapezoid(13, 5.5, 90, mode="a") usb_in = cq.Sketch().trapezoid(13, 5.5, 90, mode="a")
switch_in = cq.Sketch().trapezoid(13.5, 8.5, 90, mode="a")
# Motherboard mount
def model(): def model():
@ -110,41 +88,28 @@ def model():
.fillet(2) .fillet(2)
.faces(">Z") .faces(">Z")
.shell(-shell_t) .shell(-shell_t)
# Battery holder
# .workplaneFromTagged("mid_height")
# .center(-width / 2 + shell_t + 65, height / 2 - shell_t - 45)
# .placeSketch(battery_holder)
# .extrude(-height / 2)
# Power cable inlet
.faces("<X")
.workplane(centerOption="CenterOfBoundBox")
.center(-height / 2 + shell_t + 48.5, -3)
.placeSketch(power_in)
.cutBlind(-shell_t)
# USB inlet # USB inlet
.faces(">X") .faces(">X")
.workplane(centerOption="CenterOfBoundBox") .workplane(centerOption="CenterOfBoundBox")
# The position is arbitrary, based on the components
# available, keyboard height, cable length, etc.
.center(-height / 2 + shell_t + 60, -5) .center(-height / 2 + shell_t + 60, -5)
.placeSketch(usb_in) .placeSketch(usb_in)
.cutBlind(-shell_t) .cutBlind(-shell_t)
# Hole for power switch
.faces(">Y")
.workplane(centerOption="CenterOfBoundBox")
.center(0, 0)
.placeSketch(switch_in)
.cutBlind(-shell_t)
# Slanted mounting pillars on the kbd top # Slanted mounting pillars on the kbd top
.faces(">Z") .faces(">Z")
.workplane(centerOption="CenterOfBoundBox") .workplane(centerOption="CenterOfBoundBox")
# Top-left kbd corner inside the box # Top-left kbd corner inside the box
.center(-width / 2 + shell_t, kbd_height - height / 2 + shell_t) .center(-width / 2 + shell_t, kbd_height - height / 2 + shell_t)
.transformed(rotate=cq.Vector(kbd_angle, 0, 0)) .transformed(rotate=cq.Vector(kbd_angle, 0, 0))
# These two offsets push the keyboard "down" into the case
# and need to be adjusted per-keyboard
.tag("sloped") .tag("sloped")
.workplane(offset=-1.5) .workplane(offset=-2.5)
.placeSketch(kbd_pillars) .placeSketch(kbd_pillars)
.extrude(-1000) .extrude(-1000)
.workplaneFromTagged("sloped") .workplaneFromTagged("sloped")
.workplane(offset=-4.5) .workplane(offset=-5.5)
.placeSketch(kbd_lower_pillars) .placeSketch(kbd_lower_pillars)
.extrude(-1000) .extrude(-1000)
# Remove the excess extrusion # Remove the excess extrusion

File diff suppressed because it is too large Load Diff