A weather station
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
3.7 KiB

$fn = 50;
width = 160;
length = 90;
height = 18;
horiz_tolerance = 0.8;
vert_tolerance = 0.8;
edge_radius = 4;
charger_width = 145;
charger_length = 74;
charger_height = 15;
use <box.scad>
module charger() {
cube([charger_width,charger_length,charger_height]);
}
module screwhole() {
translate([0,0,-12]) cylinder(r=2, h=12);
}
module centerwasher() {
translate([width/2, length/2, -0.2]) cylinder($fn=6, r=4, h=3);
}
module usb() {
minkowski() {
translate([0,50,3]) cube([17,100,8.8]);
rotate([90,0,0]) cylinder(r=horiz_tolerance/2, h=horiz_tolerance/2);
}
}
module roof2() {
difference() {
minkowski() {
translate([edge_radius,edge_radius,0]) cube([width-edge_radius*2,length-edge_radius*2,height]);
cylinder(r=edge_radius, h=0.2);
}
minkowski() {
translate([width/2-charger_width/2, length/2-charger_length/2, height-charger_height-vert_tolerance+0.4]) charger();
cylinder(r=horiz_tolerance/2,h=vert_tolerance);
}
screwhole_offset = 5;
translate([screwhole_offset,screwhole_offset,height+0.4]) screwhole();
translate([width-screwhole_offset,screwhole_offset,height+0.4]) screwhole();
translate([screwhole_offset,length-screwhole_offset,height+0.4]) screwhole();
translate([width-screwhole_offset,length-screwhole_offset,height+0.4]) screwhole();
usb_offset = 28;
translate([width/2-charger_width/2+charger_width-17-usb_offset, length/2-charger_length/2, height-charger_height-vert_tolerance+0.4]) usb();
translate([0,-23,0]) centerwasher();
translate([-23,5,0]) centerwasher();
translate([23,5,0]) centerwasher();
}
}
//rotate([30,0,0])
roof2();
%difference() {
angle = 30;
mount_height = sin(angle)*length;
rotate([angle,0,0]) translate([width*0.125,0,-mount_height]) cube([width*0.75,4,mount_height]);
rotate([-angle,0,180]) translate([-width*0.25,0.4,-25]) mount();
rotate([-angle,0,180]) translate([-width*0.75,0.4,-25]) mount();
}
module mount2() {
thickness = 4;
difference() {
translate([width/2,length/2,-thickness]) cylinder(r=30, h=thickness);
translate([0,-23,-thickness]) translate([width/2, length/2, -0.2]) cylinder($fn=50, r=2, h=4+0.4);
translate([-23,5,-thickness]) translate([width/2, length/2, -0.2]) cylinder($fn=50, r=2, h=4+0.4);
translate([23,5,-thickness]) translate([width/2, length/2, -0.2]) cylinder($fn=50, r=2, h=4+0.4);
}
difference() {
translate([width/2,length/2-8,10]) rotate([210,0,0]) difference() {
union() {
cylinder(r=16, h=50, center=false);
rotate([-210,0,0]) translate([0,8+6,-thickness-15-10]) cylinder(r1=14, r2=17, h=15);
}
cylinder(r=10, h=50+0.4, center=false);
}
translate([width/2,length/2,0]) cylinder(r=100, h=100);
}
}
//%mount2();
module mount3(mount_height) {
between = 130+4;
side_offset = 6;
length_mod = 0.8;
difference() {
cube([between+side_offset*2,length*length_mod,mount_height]);
translate([side_offset*2,0,0]) cube([between-side_offset*2,length*length_mod,mount_height]);
minkowski() {
translate([side_offset,80,-vert_tolerance/2]) rail(100);
cylinder(r=horiz_tolerance/2,h=vert_tolerance);
}
minkowski() {
translate([between+side_offset,80,-vert_tolerance/2]) rail(100);
cylinder(r=horiz_tolerance/2,h=vert_tolerance);
}
}
}
difference() {
angle = 30;
mount_height = sin(angle)*length;
rotate([angle,0,0]) translate([(width-(130+4+6*2))/2,0,-mount_height-6]) mount3(mount_height+6);
translate([-20,-20,0.2]) cube([200,150,50]);
}