neotrellis-grid/plate.scad

80 lines
3.2 KiB
OpenSCAD
Raw Normal View History

2021-07-20 11:52:35 +00:00
// 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:
2021-07-20 18:44:16 +00:00
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
2021-07-20 11:52:35 +00:00
// 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)
tolerance = 0.4;
// outer spacing - spacing between the edge of the silicon part and the buttons
outer_spacing = 2.5;
2021-07-20 18:44:16 +00:00
plate_thickness = 4;
// module for the entire plate
module plate() {
2021-07-20 11:52:35 +00:00
difference() {
2021-07-20 18:44:16 +00:00
translate([-(wall_width+tolerance),-(wall_width+tolerance)]) {
cube(
[pcb_size*pcbs_long+(wall_width+tolerance)*2,
pcb_size*pcbs_wide+(wall_width+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);
2021-07-20 11:52:35 +00:00
}
}
}
2021-07-20 18:44:16 +00:00
// mounting pegs
2021-07-20 20:24:39 +00:00
translate([-wall_width/2,-wall_width/2,-plate_thickness]){
2021-07-20 18:44:16 +00:00
cube([hole_size-tolerance,hole_size-tolerance,hole_depth], center=true);
}
2021-07-20 20:24:39 +00:00
translate([wall_width/2+(pcbs_long*pcb_size),-wall_width/2,-plate_thickness]){
2021-07-20 18:44:16 +00:00
cube([hole_size-tolerance,hole_size-tolerance,hole_depth], center=true);
}
2021-07-20 20:24:39 +00:00
translate([wall_width/2+(pcbs_long*pcb_size),wall_width/2+(pcbs_wide*pcb_size),-plate_thickness]){
2021-07-20 18:44:16 +00:00
cube([hole_size-tolerance,hole_size-tolerance,hole_depth], center=true);
}
2021-07-20 20:24:39 +00:00
translate([-wall_width/2,wall_width/2+(pcbs_wide*pcb_size),-plate_thickness]){
2021-07-20 18:44:16 +00:00
cube([hole_size-tolerance,hole_size-tolerance,hole_depth], center=true);
}
}
// module for the holes in a 4x4 unit of the top plate.
module plate4x4(thickness) {
for(x=[0:3]) {
for(y=[0:3]) {
translate(
[outer_spacing-(tolerance/2)+((button_size+spacing)*x),
outer_spacing-(tolerance/2)+((button_size+spacing)*y),
-0.5])
cube([button_size+tolerance,button_size+tolerance,thickness+1]);
}
}
2021-07-20 11:52:35 +00:00
}
2021-07-20 18:44:16 +00:00
plate();