CAD/spdbt/cameramount.scad
Michael Hope 93d98a10ca + ‘.gitignore’
+ ‘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’
...
2017-09-17 21:40:21 +02:00

101 lines
1.8 KiB
OpenSCAD

include <libjuju.scad>
function midx(a, b) = (a[0] - b[0])/2;
function midy(a, b) = (a[1] - b[1])/2;
function midz(a, b) = (a[2] - b[2])/2;
module cameramount() {
e = 0.1;
t = .3;
h = 17;
sfront = [71+t, 31, 1];
sback = [sfront[0]-7*2+5, 24, 1];
slens = [33.4+t, 16.3+t, 20];
th = 2.5;
module camera() {
module lens(s=slens) {
translate([s[1]/2, s[1]/2, 0])
hull() {
cylinder(s[2], d=s[1], d=s[1]);
translate([s[0]-s[1], 0, 0])
cylinder(s[2], d=s[1], d=s[1]);
}
}
module body() {
r = 10;
hull() {
translate([0, 0, -t])
rplate(sfront[0], sfront[1], e, r);
translate([midx(sfront, sback), midy(sfront, sback), -h-e])
rplate(sback[0], sback[1], e, r);
}
}
translate([sfront[0]-slens[0]-7.5+1, midy(sfront, slens), 0])
lens();
body();
}
module plate() {
d = sfront[1]+th*2;
hull() {
cube([1, d, th]);
translate([sfront[0]-d/2+th, d/2, 0])
cylinder(th, d=d, d=d);
}
difference() {
translate([-th-15, 0, d/2])
rotate([0, -30, 0])
translate([-d*1, 0, -d])
cube([d*2, d, d]);
translate([-d, -e, 0])
cube([d*3, d+e*2, 50]);
}
}
module join1() {
rotate([0, -90-30, 0])
difference() {
plate();
translate([th, th, 0])
# camera();
}
}
d = sfront[0];
m = 8;
translate([3, m, 0])
difference() {
join1();
translate([-d, -e, -d])
cube([d*2, d*2, d]);
}
module base() {
d = sfront[1]+m*2+th*2;
w = 21+m;
i = 4;
difference() {
rplate(w, d, th, 3);
for (x = [0+i, w-i]) {
for (y = [0+i, d-i]) {
translate([x, y, -10+th-.3])
mbolt();
}
}
}
}
base();
}
$fn = 30;
cameramount();