Skip to content

Commit

Permalink
Add some slots to make it easier to remove the PCB from the case
Browse files Browse the repository at this point in the history
  • Loading branch information
bschwind committed Sep 15, 2024
1 parent 801070c commit e70dba3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions examples/src/keyboard_case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,24 @@ fn case_feet() -> Shape {
.into()
}

const PUSH_SLOT_LOCATIONS: &[DVec2] = &[
DVec2::new(PCB_LEFT + 58.0, PCB_BOTTOM + 8.0),
DVec2::new(PCB_RIGHT - 58.0, PCB_BOTTOM + 8.0),
];

// A slot to help remove the PCB by pushing through the bottom of the case.
fn push_slot(center: DVec2) -> Shape {
let mut cutout_workplane = Workplane::xy();
cutout_workplane.set_translation(dvec3(center.x, center.y, CASE_FLOOR_Z));

cutout_workplane
.rect(10.0, 3.0)
.fillet(1.0)
.to_face()
.extrude(dvec3(0.0, 0.0, -CASE_WALL_THICKNESS))
.into()
}

pub fn shape() -> Shape {
let inner_box = case_inner_box();
let top_shelf = pcb_top_shelf();
Expand Down Expand Up @@ -398,6 +416,11 @@ pub fn shape() -> Shape {
case = case.drill_hole(pos, dir, PINHOLE_BUTTON_RADIUS);
}

for slot_center in PUSH_SLOT_LOCATIONS {
let slot = push_slot(*slot_center);
case = case.subtract(&slot).into();
}

// For exporting to smaller 3D printers
// let corner_1 = DVec3::new(CASE_LEFT, CASE_BOTTOM, CASE_BOTTOM_Z);
// let corner_2 = DVec3::new(CASE_RIGHT / 2.0, CASE_TOP, CASE_TOP_Z);
Expand Down

0 comments on commit e70dba3

Please sign in to comment.