88 lines
2.9 KiB
OpenSCAD
88 lines
2.9 KiB
OpenSCAD
|
include <BOSL2/std.scad>
|
||
|
|
||
|
$fn=40;
|
||
|
|
||
|
leeway=0.5;
|
||
|
|
||
|
bodyFaceW=120;
|
||
|
bodyFaceH=100;
|
||
|
bodyBackW=20;
|
||
|
bodyBackH=15;
|
||
|
bodyDepth=50;
|
||
|
|
||
|
screenWidth=16.5+leeway; // visible
|
||
|
screenHeight=13+leeway; // visible
|
||
|
screenY=-35;
|
||
|
screenX=30;
|
||
|
screenCutoutWidth=19+leeway;
|
||
|
screenCutoutHeight=19.5+leeway;
|
||
|
screenMountWidth=21+leeway;
|
||
|
screenMountHeight=21+leeway;
|
||
|
|
||
|
keypadWidth=46+leeway; // visible
|
||
|
keypadHeight=57+leeway; // visible
|
||
|
keypadDepth=4;
|
||
|
keypadY=10;
|
||
|
keypadX=30;
|
||
|
keypadMountDia=1;
|
||
|
|
||
|
speakerWidth=45; // visible, 50 OD
|
||
|
speakerConeWidth=60;
|
||
|
speakerDepth=2.2;
|
||
|
speakerY=0;
|
||
|
speakerX=-27;
|
||
|
|
||
|
sensorWidth=4; // visible
|
||
|
sensorDepth=4;
|
||
|
sensorY=-15;
|
||
|
|
||
|
powerWidth=4; // visible
|
||
|
powerDepth=10;
|
||
|
powerY=0;
|
||
|
|
||
|
right_half()
|
||
|
diff("hole","mount") translate([0, 0, 0]) rotate([50,0,0]) {
|
||
|
// body
|
||
|
prismoid([bodyBackW, bodyBackH], [bodyFaceW, bodyFaceH], bodyDepth, rounding=4)
|
||
|
tag("hole") {
|
||
|
attach([TOP]) {
|
||
|
// screen
|
||
|
translate([screenX,-screenY,0.1]) cuboid([screenWidth,screenHeight,4], anchor=TOP);
|
||
|
// screen thickness cutout
|
||
|
translate([screenX,-screenY,-1]) cuboid([screenCutoutWidth,screenCutoutHeight,2], anchor=TOP)
|
||
|
tag("mount") {
|
||
|
position(FRONT+LEFT) translate([-2,2,-0]) cylinder(h=2, d=keypadMountDia, anchor=TOP);
|
||
|
position(BACK+LEFT) translate([-2,-4,-0]) cylinder(h=2, d=keypadMountDia, anchor=TOP);
|
||
|
position(FRONT+RIGHT) translate([2,2,-0]) cylinder(h=2, d=keypadMountDia, anchor=TOP);
|
||
|
position(BACK+RIGHT) translate([2,-4,-0]) cylinder(h=2, d=keypadMountDia, anchor=TOP);
|
||
|
}
|
||
|
|
||
|
// keypad
|
||
|
translate([keypadX,-keypadY,0.1]) cuboid([keypadWidth,keypadHeight,keypadDepth], rounding=4, edges=["Z"], anchor=TOP)
|
||
|
tag("mount") {
|
||
|
//TODO: actually measure these, consider screws
|
||
|
position(FRONT+LEFT) translate([-.2,-1,0]) cylinder(h=2, d=keypadMountDia, anchor=TOP);
|
||
|
position(BACK+LEFT) translate([-.2,1,0]) cylinder(h=2, d=keypadMountDia, anchor=TOP);
|
||
|
position(FRONT+RIGHT) translate([.2,-1,0]) cylinder(h=1, d=keypadMountDia, anchor=TOP);
|
||
|
position(BACK+RIGHT) translate([.2,1,0]) cylinder(h=1, d=keypadMountDia, anchor=TOP);
|
||
|
}
|
||
|
|
||
|
// speaker
|
||
|
translate([speakerX,-speakerY,0.1]) cylinder(h=speakerDepth, d1=speakerWidth, d2=speakerConeWidth, anchor=TOP)
|
||
|
tag("mount") {
|
||
|
zrot_copies([90, 180, 270]) left(speakerConeWidth/2)
|
||
|
cylinder(h=5, d1=2, d2=2, anchor=TOP);
|
||
|
}
|
||
|
}
|
||
|
attach(BACK) {
|
||
|
// sensor
|
||
|
translate([0,-sensorY,0]) cylinder(h=sensorDepth, d=sensorWidth, center=true);
|
||
|
}
|
||
|
attach(BOTTOM) {
|
||
|
// power
|
||
|
translate([0,-powerY,0]) cylinder(h=powerDepth, d=powerWidth, center=true);
|
||
|
}
|
||
|
// hollow
|
||
|
prismoid([bodyBackW-5, bodyBackH-5], [bodyFaceW-6, bodyFaceH-6], bodyDepth-4, rounding=3, center=true);
|
||
|
}
|
||
|
}
|