Added top piece with snap

This commit is contained in:
Nathan Anderson 2024-03-20 17:11:02 -06:00
parent ad70f1c8e4
commit ac63b1092a

View File

@ -1,24 +1,37 @@
include <PiZero.scad> include <PiZero.scad>
include <BOSL2/std.scad> include <BOSL2/std.scad>
include <BOSL2/walls.scad>
CaseSizeX = PiSizeX + 1.5; CaseSizeX = PiSizeX + 1.5;
CaseSizeY = PiSizeY + 1.5; CaseSizeY = PiSizeY + 1.5;
wall_thickness_mod = 3; wall_thickness = 3;
cap_thickness = 6; cap_thickness = 6;
case_height = 7; case_height = 7;
outer_rect_size=[CaseSizeX + wall_thickness_mod, CaseSizeY + wall_thickness_mod]; outer_rect_size=[CaseSizeX + wall_thickness, CaseSizeY + wall_thickness];
PiZeroVer = "WH"; PiZeroVer = "WH";
module case() {
%up(cap_thickness) PiZeroBody(false); %up(cap_thickness) PiZeroBody(false);
union() { union() {
// Case Walls // Case Walls
up(cap_thickness - 0.05) difference() { up(cap_thickness - 0.05) difference() {
rect_tube(h=case_height, size=outer_rect_size , isize=[CaseSizeX, CaseSizeY], anchor=BOTTOM); rect_tube(h=case_height, size=outer_rect_size , isize=[CaseSizeX, CaseSizeY], anchor=BOTTOM);
up(0.5) PiZeroBody(true); up(0.5) PiZeroBody(true);
up(2) fwd(CaseSizeY / 2 + wall_thickness_mod / 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(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 // Bottom Wall Cap
linear_extrude(cap_thickness) rect(size = outer_rect_size, anchor = CENTER, spin = 0); linear_extrude(cap_thickness) rect(size = outer_rect_size, anchor = CENTER, spin = 0);
// Top Wall Cap // Top Wall Cap
// %up(cap_thickness + case_height - 0.1) linear_extrude(cap_thickness) rect(size = outer_rect_size, anchor = CENTER, spin = 0);
} }
}
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();