154 lines
3.7 KiB
OpenSCAD
154 lines
3.7 KiB
OpenSCAD
$fn=32*2;
|
|
thickness=1.6;
|
|
width=208.5;
|
|
depth=70.5;
|
|
height=8;
|
|
|
|
// outer display frame
|
|
difference(){
|
|
cube([width+(thickness*2), depth+(thickness*2), height]);
|
|
translate([thickness, thickness, 0])
|
|
cube([width, depth, height]);
|
|
}
|
|
|
|
// inner display catch
|
|
translate([thickness, thickness, 1.5]){
|
|
padding=5;
|
|
ledge=0.8;
|
|
difference(){
|
|
translate([padding, 0, 0])
|
|
cube([width-(padding*2), depth, thickness]);
|
|
translate([0, ledge, 0])
|
|
cube([width, depth-(ledge*2), thickness]);
|
|
}
|
|
}
|
|
|
|
// usb compartment
|
|
usb_compartment();
|
|
|
|
// battery compartment
|
|
translate([146.6, 0, 0])
|
|
battery_compartment();
|
|
|
|
// raspberry pi 4 cover
|
|
rpi4_cover();
|
|
|
|
// hinge test
|
|
translate([100, -80, 0]){
|
|
male_hinge();
|
|
}
|
|
|
|
module usb_compartment(){
|
|
usb_tray_width=31;
|
|
usb_tray_height=4;
|
|
usb_step_width=10;
|
|
usb_step_height=2;
|
|
hole=6;
|
|
hole_x=usb_tray_width+(usb_step_width/2)+thickness;
|
|
hole_y=5.6+thickness;
|
|
|
|
// usb tray
|
|
difference(){
|
|
translate([0, 0, height])
|
|
cube([usb_tray_width+thickness, depth+(thickness*2), usb_tray_height+thickness]);
|
|
|
|
translate([thickness, thickness, height+thickness])
|
|
cube([usb_tray_width, depth, usb_tray_height]);
|
|
}
|
|
|
|
// usb step
|
|
difference(){
|
|
translate([usb_tray_width, 0, height])
|
|
cube([usb_step_width+thickness, depth+(thickness*2), usb_step_height+thickness]);
|
|
|
|
translate([usb_tray_width+thickness, thickness, height])
|
|
cube([usb_step_width, depth, usb_step_height]);
|
|
|
|
translate([hole_x, hole_y, height+usb_step_height])
|
|
cylinder(h=thickness, d=hole);
|
|
|
|
translate([hole_x, depth+(thickness*2)-hole_y, height+usb_step_height])
|
|
cylinder(h=thickness, d=hole);
|
|
}
|
|
}
|
|
|
|
module battery_compartment(){
|
|
battery_width=63.5;
|
|
battery_height=4;
|
|
hole=6;
|
|
hole_x=5;
|
|
hole_y=5.6+thickness;
|
|
|
|
difference(){
|
|
translate([0, 0, height])
|
|
cube([battery_width+thickness, depth+(thickness*2), battery_height+thickness]);
|
|
|
|
translate([0, thickness, height])
|
|
cube([battery_width, depth, battery_height]);
|
|
|
|
translate([hole_x, hole_y, height+4])
|
|
cylinder(h=thickness, d=hole);
|
|
|
|
translate([hole_x, depth+(thickness*2)-hole_y, height+battery_height])
|
|
cylinder(h=thickness, d=hole);
|
|
}
|
|
}
|
|
|
|
module rpi4_cover(){
|
|
difference(){
|
|
translate([31+thickness+10, 0, height])
|
|
cube([104, depth+(thickness*2), 25+thickness]);
|
|
|
|
translate([31+thickness+10, thickness, height])
|
|
cube([104, depth, 25]);
|
|
|
|
translate([31+thickness+62, (depth+(thickness*2))/2, height+25])
|
|
cylinder(h=thickness, d=41.5);
|
|
}
|
|
|
|
// left slope
|
|
difference(){
|
|
translate([19+thickness, 0, height+thickness])
|
|
left_slope(22, depth+(thickness*2), 23.4);
|
|
|
|
translate([19+thickness, thickness, height+thickness])
|
|
left_slope(22, depth, 25);
|
|
}
|
|
|
|
// right slope
|
|
difference(){
|
|
translate([145+thickness, 0, height+thickness])
|
|
right_slope(22, depth+(thickness*2), 23.4);
|
|
|
|
translate([145+thickness, thickness, height+thickness])
|
|
right_slope(22, depth, 25);
|
|
}
|
|
|
|
// logo
|
|
translate([31+thickness+62, (depth+(thickness*2))/2, height+25])
|
|
linear_extrude(height=1.6)
|
|
resize([42, 42, 0])
|
|
import(file="mk-logo.svg", center=true);
|
|
}
|
|
|
|
module left_slope(w, d, h){
|
|
polyhedron(
|
|
points=[[0,d,0], [0,0,0], [w,0,0], [w,d,0], [w,d,h], [w,0,h]],
|
|
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){
|
|
polyhedron(
|
|
points=[[0,d,0], [0,0,0], [w,0,0], [w,d,0], [0,d,h], [0,0,h]],
|
|
faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]);
|
|
}
|
|
|
|
module male_hinge(){
|
|
translate([0, 0, -10+th/2])
|
|
cube([l, w, th], center=true);
|
|
//generating 2 tabs with sp spacing
|
|
translate([0, -sp, 0])
|
|
tab();
|
|
translate([0, sp, 0])
|
|
tab();
|
|
} |