93d98a10ca
+ ‘hab/’ + ‘hab/18650.scad’ + ‘hab/battery_holder.scad’ + ‘hab/cr18650.scad’ + ‘hab/debug.log’ + ‘hab/libjuju.scad’ + ‘hab/pigateway.scad’ + ‘hab/sensemicro.scad’ + ‘hab/thermo.scad’ ...
145 lines
2.6 KiB
OpenSCAD
145 lines
2.6 KiB
OpenSCAD
include <libjuju.scad>
|
|
|
|
sw = 120;
|
|
sd = 100;
|
|
sh = 2;
|
|
wh = 2;
|
|
e = 0.01;
|
|
|
|
fd = 15;
|
|
// Layer thickness.
|
|
lt = 0.38;
|
|
|
|
module baseplate(inset=0, e=0, h=sh) {
|
|
translate([inset, inset, -e]) {
|
|
cube([sw-2*inset-sd/2, sd-2*inset, h+2*e]);
|
|
translate([sw-sd/2-inset, (sd-2*inset)/2, 0])
|
|
cylinder(h+2*e, d=sd-2*inset);
|
|
}
|
|
}
|
|
|
|
module stripes(d=300, w=4) {
|
|
s = [d, d, sh];
|
|
step = 20;
|
|
m = d;
|
|
|
|
translate([-d/2-step/2-w/2, -d/2-step/2-w/2, 0]) {
|
|
for (x = [0:step:s[0]]) {
|
|
translate([x, 0, 0])
|
|
cube([w, m, s[2]]);
|
|
}
|
|
for (y = [0:step:s[1]]) {
|
|
translate([0, y, 0])
|
|
cube([m, w, s[2]]);
|
|
}
|
|
}
|
|
}
|
|
|
|
module assembly() {
|
|
module plate() {
|
|
// Top plate.
|
|
baseplate(h=lt*2+e);
|
|
|
|
// Base rim.
|
|
difference() {
|
|
baseplate();
|
|
baseplate(5, e=e);
|
|
}
|
|
|
|
// Outer rim.
|
|
translate([0, 0, wh])
|
|
difference() {
|
|
baseplate();
|
|
baseplate(wh, e=e);
|
|
}
|
|
|
|
// Strengthining.
|
|
intersection() {
|
|
rotate([0, 0, 45])
|
|
stripes(300, 2);
|
|
baseplate();
|
|
}
|
|
}
|
|
|
|
module rails() {
|
|
// Motor rails.
|
|
cube([8, sd, sh]);
|
|
translate([40-8+wh, 0, 0])
|
|
cube([8, sd, sh]);
|
|
}
|
|
|
|
module wheelmount() {
|
|
// Wheel mount.
|
|
h = 15;
|
|
translate([sw-fd/2, sd/2, 0])
|
|
difference() {
|
|
cylinder(h, d=fd, d=fd);
|
|
// Screw hole. Also adds strength.
|
|
translate([0, 0, 0])
|
|
cylinder(h, d=2.5, d=2.5);
|
|
}
|
|
}
|
|
|
|
// Camera mount locator.
|
|
module camera() {
|
|
s = [30+1, 52+1, 0.5];
|
|
translate([wh, (sd - s[1])/2, -e])
|
|
cube(s);
|
|
}
|
|
|
|
module battery() {
|
|
s = [31, 55, 16];
|
|
x = sw - s[0]*1.8;
|
|
y = (sd-s[1])/2;
|
|
f = 7;
|
|
|
|
// Fillets.
|
|
module fillets() {
|
|
translate([x, y, 0]) {
|
|
difference() {
|
|
hull() {
|
|
translate([s[0]+4-sh, 0, 0])
|
|
rotate([-90, -90, 0])
|
|
qround(s[1]+sh, 4);
|
|
|
|
translate([sh, s[1]+sh, 0])
|
|
rotate([90, 0, 0])
|
|
mirror([1, 0, 0])
|
|
qround(s[1]+sh, 4);
|
|
|
|
translate([s[0]+sh*2, sh, 0])
|
|
rotate([90, 0, -90])
|
|
qround(s[0]+sh*2, 4);
|
|
}
|
|
translate([sh, sh, 0])
|
|
cube(s);
|
|
}
|
|
}
|
|
}
|
|
|
|
translate([x, y, sh])
|
|
difference() {
|
|
// Case.
|
|
cube([s[0]+sh*2, s[1] + sh - e, s[2]+sh]);
|
|
|
|
// The battery itself
|
|
translate([sh, sh, -e])
|
|
cube(s);
|
|
// Hole in the top.
|
|
translate([f, -e, sh*3])
|
|
cube([s[0]-2*f+2*sh, s[1]+sh+e*2, s[2]]);
|
|
}
|
|
fillets();
|
|
}
|
|
|
|
|
|
plate();
|
|
rails();
|
|
wheelmount();
|
|
battery();
|
|
}
|
|
|
|
$fn = 40;
|
|
assembly();
|
|
|