Improve sloped walls

This commit is contained in:
Deon Spengler
2023-06-22 15:41:36 +02:00
parent 17c5e8ed78
commit d2a15b8387

View File

@@ -34,9 +34,8 @@ translate([146.6, 0, 0])
rpi4_cover(); rpi4_cover();
// hinge test // hinge test
translate([100, -80, 0]){ //translate([width+(thickness*2)/2), -20, 0])
male_hinge(); //male_hinge();
}
module usb_compartment(){ module usb_compartment(){
usb_tray_width=31; usb_tray_width=31;
@@ -107,22 +106,13 @@ module rpi4_cover(){
} }
// left slope // left slope
difference(){ translate([19+thickness, 0, height+thickness])
translate([19+thickness, 0, height+thickness]) sloped_walls(22, depth+(thickness*2), 23.4, thickness);
left_slope(22, depth+(thickness*2), 23.4);
translate([19+thickness, thickness, height+thickness])
left_slope(22, depth, 25);
}
// right slope // right slope
difference(){ translate([145+thickness+22, 0, height+thickness])
translate([145+thickness, 0, height+thickness]) mirror([1,0,0])
right_slope(22, depth+(thickness*2), 23.4); sloped_walls(22, depth+(thickness*2), 23.4, thickness);
translate([145+thickness, thickness, height+thickness])
right_slope(22, depth, 25);
}
// logo // logo
translate([31+thickness+62, (depth+(thickness*2))/2, height+25]) translate([31+thickness+62, (depth+(thickness*2))/2, height+25])
@@ -131,16 +121,24 @@ module rpi4_cover(){
import(file="mk-logo.svg", center=true); import(file="mk-logo.svg", center=true);
} }
module left_slope(w, d, h){ module prism(width, depth, height){
polyhedron( polyhedron(
points=[[0,d,0], [0,0,0], [w,0,0], [w,d,0], [w,d,h], [w,0,h]], points=[[0, depth, 0],
[0, 0, 0],
[width, 0, 0],
[width, depth, 0],
[width, depth, height],
[width, 0, height]],
faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]); faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]);
} }
module right_slope(w, d, h){ module sloped_walls(width, depth, height, thickness){
polyhedron( difference(){
points=[[0,d,0], [0,0,0], [w,0,0], [w,d,0], [0,d,h], [0,0,h]], prism(width, depth, height);
faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]);
translate([0, thickness, 0])
prism(width, depth-(thickness*2), height);
}
} }
module male_hinge(){ module male_hinge(){