scad_files/pi-camera-case.scad

38 lines
1.4 KiB
OpenSCAD

include <PiZero.scad>
include <BOSL2/std.scad>
include <BOSL2/walls.scad>
CaseSizeX = PiSizeX + 1.5;
CaseSizeY = PiSizeY + 1.5;
wall_thickness = 3;
cap_thickness = 6;
case_height = 7;
outer_rect_size=[CaseSizeX + wall_thickness, CaseSizeY + wall_thickness];
PiZeroVer = "WH";
module case() {
%up(cap_thickness) PiZeroBody(false);
union() {
// Case Walls
up(cap_thickness - 0.05) difference() {
rect_tube(h=case_height, size=outer_rect_size , isize=[CaseSizeX, CaseSizeY], anchor=BOTTOM);
up(0.5) PiZeroBody(true);
up(2) fwd(CaseSizeY / 2 + wall_thickness / 2 - 0.29) right(CaseSizeX / 2 - 6) xrot(90) text3d(text = "5V", size=3, font = "Hurmit Nerd Font", thickness = 0.3, anchor=FRONT+LEFT+BOTTOM);
up(case_height - 0.1) topCap();
}
// Bottom Wall Cap
linear_extrude(cap_thickness) rect(size = outer_rect_size, anchor = CENTER, spin = 0);
// Top Wall Cap
}
}
module topCap() {
linear_extrude(cap_thickness) rect(size = outer_rect_size, anchor = CENTER, spin = 0);
down(2) rect_tube(h=2, size=[CaseSizeX - 0.5, CaseSizeY - 0.5], isize=[CaseSizeX - wall_thickness, CaseSizeY - wall_thickness], anchor=BOTTOM);
right((CaseSizeX - 0.5) / 2) down(2) yrot(90) narrowing_strut(w=1, l=CaseSizeY - (wall_thickness * 2), wall=0.1, ang=60, anchor=BOTTOM+RIGHT);
left((CaseSizeX - 0.5) / 2) down(2) yrot(-90) narrowing_strut(w=1, l=CaseSizeY - (wall_thickness * 2), wall=0.1, ang=60, anchor=BOTTOM+LEFT);
}
!case();
up(cap_thickness) yrot(180) topCap();