3d/Matekiste_Power_PCB_Bracket.scad

43 lines
1.3 KiB
OpenSCAD

PCB_SIZE_X=50;
PCB_SIZE_Y=70;
PCB_DITCH_Z=2;
THICKNESS=5;
PIN_DIAMETER=2;
PIN_HEIGHT=5;
PIN_SPACING_X=2;
PIN_SPACING_Y=2;
FRAME_ROD_DIAMETER=6; // M6
FRAME_ROD_DISTANCE=25;
TOLERANCE=0.5;
$fn = 36;
// the frame
difference() {
cube([PCB_SIZE_X, PCB_SIZE_Y, THICKNESS]);
translate([THICKNESS, THICKNESS, THICKNESS - PCB_DITCH_Z])
cube([PCB_SIZE_X - THICKNESS*2, PCB_SIZE_Y - THICKNESS*2, PCB_DITCH_Z]);
}
// PCB holder pins
translate([0, 0, THICKNESS]) {
translate([PIN_SPACING_X, PIN_SPACING_Y])
cylinder(d=PIN_DIAMETER - TOLERANCE, h=PIN_HEIGHT);
translate([PCB_SIZE_X - PIN_SPACING_X, PIN_SPACING_Y])
cylinder(d=PIN_DIAMETER - TOLERANCE, h=PIN_HEIGHT);
translate([PIN_SPACING_X, PCB_SIZE_Y - PIN_SPACING_Y])
cylinder(d=PIN_DIAMETER - TOLERANCE, h=PIN_HEIGHT);
translate([PCB_SIZE_X - PIN_SPACING_X, PCB_SIZE_Y - PIN_SPACING_Y])
cylinder(d=PIN_DIAMETER - TOLERANCE, h=PIN_HEIGHT);
}
// frame connector
translate([PCB_SIZE_X, PCB_SIZE_Y/2 - THICKNESS/2])
cube([FRAME_ROD_DISTANCE + THICKNESS, THICKNESS, THICKNESS]);
translate([PCB_SIZE_X + FRAME_ROD_DISTANCE + FRAME_ROD_DIAMETER/2 + THICKNESS + TOLERANCE, PCB_SIZE_Y/2])
difference() {
cylinder(d=FRAME_ROD_DIAMETER + TOLERANCE + THICKNESS*2, h=THICKNESS);
cylinder(d=FRAME_ROD_DIAMETER + TOLERANCE, h=THICKNESS);
}