neotrellis-grid/plate-extra.scad

101 lines
3.9 KiB
OpenSCAD

// this SCAD file defines the top plate for the case of a neotrellis monome-compatible grid controller.
// the file is designed to be parametric, for easier testing.
// first, we declare some parameters, that will be useful to tweak while testing the model:
// TODO apply correct tolerances in the correct places
// TODO button placement seems weird?
pcb_size = 60; // the PCB is 60x60mm square
pcb_depth = 7.57; // the PCB is 7.57mm deep, overall (including connector + lEDs)
connector_depth=5.7; // the connector on the bottom of the PCB is 5.8mm thick.
pcb_thickness= 1.7; // the PCB itself (just the board, w/o components) is roughly 1.7mm thick
support_width=5; // width of support structure walls
support_depth=10; // depth of support structure wall
floor_depth = 1; // depth of the bottom floor of the support
wall_height = (pcb_depth-connector_depth)+4; // height of walls above the top of the supports
wall_width = 5; // width of walls above the top of the supports
cutout_width=25; // width of the cutouts in the support structure, for wires etc
cutout_depth=5; // depth of the cutouts in the support structure
pcbs_wide=2; // how many trellis PCBs are in the grid, width-wise
pcbs_long=4; // how many trellis PCBs are in the grid, length-wise
hole_size = 4; // size of the holes in which the top plate pegs sit
hole_depth = 15; // depth of the holes in which the top plate pegs sit
// Button size (in mm)
button_size = 10;
// Spacing between buttons (in mm)
spacing = 5;
// Tolerance for button holes (how much larger they are than a button)
button_tolerance = 1;
// Tolerance for pegs (how much smaller they are than the holes)
peg_tolerance = 0.4;
// PCB tolerance (tolerance for the size of the PCB)
pcb_tolerance = 2;
// outer spacing - spacing between the edge of the silicon part and the buttons
outer_spacing = 2.5;
plate_thickness = 3;
// module for the entire plate
module plate() {
difference() {
translate([-(wall_width+pcb_tolerance),-(wall_width+pcb_tolerance)]) {
cube(
[pcb_size*pcbs_long+(wall_width+pcb_tolerance)*2,
pcb_size*pcbs_wide+(wall_width+pcb_tolerance)*2,
plate_thickness]);
}
for(x=[0:pcbs_long-1]){
for(y=[0:pcbs_wide-1]) {
translate([x*pcb_size,y*pcb_size,0])
plate4x4(plate_thickness);
}
}
}
// mounting holes for plate
/* translate(
[-wall_width/2-pcb_tolerance/2,
-wall_width/2-pcb_tolerance/2,
-plate_thickness+peg_tolerance*2]){
cube([hole_size-peg_tolerance,hole_size-peg_tolerance,hole_depth], center=true);
}
translate(
[wall_width/2+(pcbs_long*pcb_size)+pcb_tolerance/2,
-wall_width/2-pcb_tolerance/2,
-plate_thickness+peg_tolerance*2]){
cube([hole_size-peg_tolerance,hole_size-peg_tolerance,hole_depth], center=true);
}
translate(
[wall_width/2+(pcbs_long*pcb_size)+pcb_tolerance/2,
wall_width/2+(pcbs_wide*pcb_size)+pcb_tolerance/2,
-plate_thickness+peg_tolerance*2]){
cube([hole_size-peg_tolerance,hole_size-peg_tolerance,hole_depth], center=true);
}
translate(
[-wall_width/2-pcb_tolerance/2,
wall_width/2+(pcbs_wide*pcb_size)+pcb_tolerance/2,
-plate_thickness+peg_tolerance*2]){
cube([hole_size-peg_tolerance,hole_size-peg_tolerance,hole_depth], center=true);
} */
}
// module for the holes in a 4x4 unit of the top plate.
// TODO rewrite this using center()?
module plate4x4(thickness) {
for(x=[0:3]) {
for(y=[0:3]) {
translate(
[outer_spacing-(button_tolerance/2)+((button_size+spacing)*x),
outer_spacing-(button_tolerance/2)+((button_size+spacing)*y),
-0.5])
cube([button_size+button_tolerance,button_size+button_tolerance,thickness+1]);
}
}
}
plate();