Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Screening for Elektor 500ppm LCR meter LCD PCB.
//
// Elektor 500ppm LCR meter PCB PCB screen
//
$fa = 6;
$fs = 0.5;
thickness = 0.75;
pcb_clearance = 1.5;
pcb_width = 79;
pcb_length = 100;
hole_y_pitch = 70;
hole_x_pitch = 87;
hole_x0 = 8.8 - pcb_length / 2;
corner_rad = 5;
wall = 3;
//
// See http://hydraraptor.blogspot.com/2011/02/polyholes.html
//
module poly_cylinder(r, h, center = false) {
function sides(r) = max(round(4 *r),3);
function corrected_radius(r, n = 0) = 0.1 + r / cos(180 / (n ? n : sides(r)));
n = sides(r);
cylinder(h = h, r = corrected_radius(r, n), $fn = n, center = center);
}
module shape()
offset(corner_rad) offset(-corner_rad)
square([pcb_length, pcb_width ], center = true);
module screw_holes()
for(side = [-1, 1], end = [0, 1])
translate([hole_x0 + end * hole_x_pitch, side * hole_y_pitch / 2, 0])
children();
difference() {
linear_extrude(height = thickness + pcb_clearance)
shape();
difference() {
translate([0, 0, thickness])
linear_extrude(pcb_clearance + 1)
offset(-wall)
shape();
screw_holes()
cylinder(d = 9, h = 100, center = true);
}
screw_holes()
poly_cylinder(r = 3.3 / 2, h = 100, center = true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment