From b4d8df78f1e1554ca02db548b5c7d0622c4ba7ab Mon Sep 17 00:00:00 2001 From: Will Toohey Date: Sun, 13 May 2018 21:18:19 +1000 Subject: [PATCH] Dimensions cleanup in prep --- Hardware/Case/case.scad | 47 +++------------------ Hardware/Case/imports/board_dimensions.scad | 42 ++++++++++++++++++ Hardware/Case/imports/board_shape.scad | 42 ++++++++++++++++++ 3 files changed, 89 insertions(+), 42 deletions(-) create mode 100644 Hardware/Case/imports/board_dimensions.scad create mode 100644 Hardware/Case/imports/board_shape.scad diff --git a/Hardware/Case/case.scad b/Hardware/Case/case.scad index c171753..5ff71a5 100644 --- a/Hardware/Case/case.scad +++ b/Hardware/Case/case.scad @@ -2,48 +2,11 @@ use include key_profile_index = 11; +include +use + $fn = 512; -black = [0.1,0.1,0.1]; -blue = [0,0.6,1]; -// x, y, keycap width in units, rotation, colour -switches = [[0,0, 1, 0, blue], - [-42.862,-37.592, 1.25, 0, "white"], - [ 42.862,-37.592, 1.25, 0, "white"], - [-14.287,-37.592, 1.25, 0, "white"], - [ 14.287,-37.592, 1.25, 0, "white"], - [-37.9,-70.8, 1.75, -22.5, black], - [ 37.9,-70.8, 1.75, 22.5, black]]; -bolts = [[30.025, 6.65], - [71, -16.925], - [71, 16.5], - [42.732, -82.791] - ]; -// Not the encoders themselves, but the circle that surrounds them -encoders = [[-64,0.4], - [ 64,0.4]]; -encoderRadius = 13; - -// encoder solder points hit the case unless we cut these out -// x, y, hole size -encoderHoles = [[-8, 0, 4], - [ 8, 0, 4]]; -// the 3 A/B/Gnd connections -// x (mirrored), y, hole size -encoderHull = [5, -10.5, 3]; - -// x, y -leds = [[-39.9, -1.4], - [-53.6, -26.2], - [-54.8, -57.9], - [-17.3, -75.7]]; -ledDims = [6.5, 6.5]; - -macroHole = [0,-75.692]; -macroDiam = 3; - -usbWidth = 9; -usbPos = [-21.311, 10.3]; // bottom to top, last 2 are white/black sections of the 1 plate plate_thickness = [3, 3, 1.6, 3, 1.5, 0.1]; @@ -272,7 +235,7 @@ module usb() { } module board() { - import("imports/BOARD_SHAPE.dxf"); + board_shape(); } module board_encoderhole() { @@ -461,7 +424,7 @@ module fiducials() { } } // override in commandline -build = "bottom_spacer"; +build = "render"; enable_fiducials = 0; if(build == "render") { full_stack(); diff --git a/Hardware/Case/imports/board_dimensions.scad b/Hardware/Case/imports/board_dimensions.scad new file mode 100644 index 0000000..ea7dd18 --- /dev/null +++ b/Hardware/Case/imports/board_dimensions.scad @@ -0,0 +1,42 @@ +black = [0.1,0.1,0.1]; +blue = [0,0.6,1]; +// x, y, keycap width in units, rotation, colour +switches = [[0,0, 1, 0, blue], + [-42.862,-37.592, 1.25, 0, "white"], + [ 42.862,-37.592, 1.25, 0, "white"], + [-14.287,-37.592, 1.25, 0, "white"], + [ 14.287,-37.592, 1.25, 0, "white"], + [-37.9,-70.8, 1.75, -22.5, black], + [ 37.9,-70.8, 1.75, 22.5, black]]; +bolts = [[30.025, 6.65], + [71, -16.925], + [71, 16.5], + [42.732, -82.791] + ]; +encoders = [[-64,0.4], + [ 64,0.4]]; +// Not the encoders themselves, but the cutout that surrounds them +encoderRadius = 13; +// and for the board outline +encoderRadiusBoard = 22.222; + +// encoder solder points hit the case unless we cut these out +// x, y, hole size +encoderHoles = [[-8, 0, 4], + [ 8, 0, 4]]; +// the 3 A/B/Gnd connections +// x (mirrored), y, hole size +encoderHull = [5, -10.5, 3]; + +// x, y +leds = [[-39.9, -1.4], + [-53.6, -26.2], + [-54.8, -57.9], + [-17.3, -75.7]]; +ledDims = [6.5, 6.5]; + +macroHole = [0,-75.692]; +macroDiam = 3; + +usbWidth = 9; +usbPos = [-21.311, 10.3]; \ No newline at end of file diff --git a/Hardware/Case/imports/board_shape.scad b/Hardware/Case/imports/board_shape.scad new file mode 100644 index 0000000..919c365 --- /dev/null +++ b/Hardware/Case/imports/board_shape.scad @@ -0,0 +1,42 @@ +include + +$fn = 128; + +module board_half() { + // 1mm gap for the important bits + top_gap = 10.16; + encoder_side_gap = 11; + // arbitrary + height = 96.64; + angled_xoff = 44.263; + + // calculated + width = abs(encoders[0][0]) + encoder_side_gap; + + // main body + translate([0, -height + top_gap]) + difference() { + square([width, height]); + + translate([angled_xoff,0]) + rotate([0,0,-45]) + square([width, height]); + } + + // encoder bits + difference() { + translate(encoders[1]) + circle(r=encoderRadiusBoard); + + translate([width, -height/2]) + square([width, height]); + } +} + +module board_shape() { + board_half(); + mirror([1,0,0]) + board_half(); +} + +board_shape(); \ No newline at end of file