Commit 35591f73 authored by György Kurucz's avatar György Kurucz
Browse files

Added pcb box, raspberry pi case, and test tube holder.

parent e3ccb420
s = [55, 63];
margin = 0.5;
lip = 1;
height = 12;
corner_r = 2;
bottom_wall = 1;
difference() {
translate([0, 0, -height/2]) linear_extrude(height) minkowski() {
square([s.x, s.y], center=true);
circle(r=corner_r, $fn=50);
}
translate([0, 0, height/2]) cube([s.x + margin, s.y + margin, height], center=true);
translate([0, 0, bottom_wall]) cube([s.x - lip*2, s.y - lip*2, height], center=true);
}
\ No newline at end of file
space_below = 1.7 + 0.5 /*margin*/;
space_above = 8.5 + 0.5;
pcb = [85, 56, 1.6];
corner_r = 3;
module front_connectors(m, w=1) {
translate([87.1, 0, space_below+pcb.z]) union() {
eth = [21.5+m, 16+w, 13.5];
usb = [17+m, 15.25+w, 14.8];
translate([-eth.x+m, 2.6-w/2]) cube(eth);
translate([-usb.x+m, 2.6+15.9+3-w/2]) cube(usb);
translate([-usb.x+m, 2.6+15.9+3+15.25+2.85-w/2]) cube(usb);
}
}
module side_connectors(l=0, h=0, w=0) {
translate([0, 0, space_below+pcb.z]) union() {
uusb = [7.5+w, 5.6+l, 3.1+h];
hdmi = [15+w, 12+l, 6.5+h];
jack = [6+w, 15.1+l, 5.9+h];
translate([6.8-w/2, -l]) cube(uusb);
translate([6.8+7.5+10.2-w/2, -l]) cube(hdmi);
translate([6.8+7.5+10.2+15+11-w/2, -l]) cube(jack);
}
}
module sd_card(m, w=1.5) {
sdc = [14.6+m, 14.6, 1.7+w];
translate([-m, 21.5, space_below - sdc.z+w/2]) cube(sdc);
}
module gpio(m) {
gpio = [50.8, 5.1, 8.5+m];
translate([7, pcb.y-gpio.y-1.2, space_below+pcb.z]) {
linear_extrude(gpio.z) minkowski() {
square([gpio.x, gpio.y]);
circle(r=0.5, $fn=20);
}
}
}
module leds() {
r = 0.5;
module led() {
rotate([0, -90, 0]) cylinder(r=r, h=5, $fn=30);
}
translate([1, pcb.y-8.4, space_below + pcb.z + r]) led();
translate([1, pcb.y-(8.4+3.5), space_below + pcb.z + r]) led();
}
module pcb() {
translate([0, 0, space_below]) cube(pcb);
}
module rpi_bounds(h=0) {
m = 0.7;
translate([-m/2, -m/2]) cube([pcb.x+m, pcb.y+m, space_below + pcb.z + space_above+h]);
}
module rpi(l=0, h=0, w=0) {
pcb();
rpi_bounds(h);
front_connectors(l);
side_connectors(l, h, w);
sd_card(l);
gpio(l);
leds();
}
module pillar_placement() {
translate([3.5, 3.5]) children();
translate([3.5, pcb.y-3.5]) children();
translate([3.5+58, 3.5]) children();
translate([3.5+58, pcb.y-3.5]) children();
}
module pillars_bottom() {
k = 1;
pillar_placement() translate([0, 0, -k]) cylinder(d=6.1, h=space_below+k, $fn=30);
}
module pillars_top() {
k = 1;
pillar_placement() translate([0, 0, space_below+pcb.z]) cylinder(d=6.1, h=space_above+k, $fn=30);
}
module case_base() {
minkowski() {
cube([pcb.x, pcb.y, space_below + pcb.z + space_above]);
sphere(r=corner_r, $fn=30);
}
}
module case_top_separator() {
translate([0, 0, 5+12.5]) cube([200, 200, 10], center=true);
}
module case_lip(w=0, i=0) {
s = [pcb.x-w, corner_r/2+0.3, 5];
module lip() {
translate([w/2, 0, 10]) cube(s);
}
translate([0, -corner_r/2+i, 0]) lip();
translate([0, pcb.y-0.3-i]) lip();
}
module case_bottom() {
difference() {
case_base();
rpi(5, 10, 1);
case_lip();
case_top_separator();
}
pillars_bottom();
}
module case_top() {
difference() {
intersection() {
case_base();
union() {
rpi(5, 10);
case_top_separator();
}
}
rpi(5);
translate([pcb.x/2, pcb.y/2, space_below+pcb.z + space_above + corner_r - corner_r/2]) linear_extrude(h=corner_r) text("rPi", halign="center", valign="center", font="DejaVu Sans Mono", size=17);
}
case_lip(1, 0.3);
pillars_top();
}
//rpi();
//case_bottom();
translate([0, 0, 10]) rotate([180, 0, 0]) case_top();
\ No newline at end of file
diameter = 16;
base_diameter = diameter * 4;
wall_thickness = 4;
base_height = 5;
base_corner_r = 2;
holder_height = 30;
window_width = 6;
base_bar_width = 7;
union() {
minkowski() {
translate([0, 0, base_corner_r]) rotate([0, 0, 45]) union() {
x = base_diameter - base_corner_r*2;
y = base_bar_width;
z = base_height - base_corner_r*2;
translate([0, 0, z/2]) cube([x, y, z], center=true);
translate([0, 0, z/2]) cube([y, x, z], center=true);
}
sphere(r=base_corner_r, $fn=50);
}
od = diameter+wall_thickness*2;
cylinder(d=od, h = base_height);
difference() {
h = holder_height + base_height;
cylinder(d=od, h=h);
translate([0, 0, -1]) cylinder(d=diameter, h = h+2);
cube([window_width, 100, 100], center=true);
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment