From e70dba3a1d8e0347083ec48160bbc82275118518 Mon Sep 17 00:00:00 2001 From: Brian Schwind Date: Sun, 15 Sep 2024 21:50:15 +0900 Subject: [PATCH] Add some slots to make it easier to remove the PCB from the case --- examples/src/keyboard_case.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/examples/src/keyboard_case.rs b/examples/src/keyboard_case.rs index 152b57c..eef4883 100644 --- a/examples/src/keyboard_case.rs +++ b/examples/src/keyboard_case.rs @@ -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(); @@ -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);