133 lines
4.4 KiB
OpenSCAD
133 lines
4.4 KiB
OpenSCAD
include <BOSL2/std.scad>
|
|
|
|
$fn=40;
|
|
|
|
rotateAngle=54;
|
|
|
|
leeway=0.5;
|
|
|
|
bodyFaceW=120;
|
|
bodyFaceH=100;
|
|
bodyBackW=30;
|
|
bodyBackH=20;
|
|
bodyDepth=55;
|
|
|
|
screwHoleDia=2;
|
|
|
|
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;
|
|
screenScrewDia=3;
|
|
screenScrewHeight=3;
|
|
screenBracketHeight=7;
|
|
|
|
keypadWidth=46+leeway; // visible
|
|
keypadHeight=57+leeway; // visible
|
|
keypadDepth=4;
|
|
keypadY=10;
|
|
keypadX=30;
|
|
keypadMountDia=3;
|
|
|
|
speakerWidth=45; // visible
|
|
speakerMountWidth=50;
|
|
speakerConeWidth=60;
|
|
speakerDepth=2.2;
|
|
speakerY=0;
|
|
speakerX=-27;
|
|
|
|
sensorWidth=4; // visible
|
|
sensorDepth=4;
|
|
sensorY=-10;
|
|
|
|
powerWidth=8; // visible
|
|
powerHeight=4;
|
|
powerDepth=10;
|
|
powerY=0;
|
|
|
|
module speaker(){
|
|
diff("hole","mount") translate([0, 0, 0]) rotate([rotateAngle,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(LEFT) left(4) tube(h=screenScrewHeight, od=screenScrewDia, id=screwHoleDia, anchor=TOP);
|
|
position(RIGHT) right(4) tube(h=screenScrewHeight, od=screenScrewDia, id=screwHoleDia, 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]) tube(h=1, od=keypadMountDia, id=screwHoleDia/2, anchor=TOP);
|
|
position(BACK+LEFT) translate([-.2,1,0]) tube(h=1, od=keypadMountDia, id=screwHoleDia/2, anchor=TOP);
|
|
position(FRONT+RIGHT) translate([.2,-1,0]) tube(h=1, od=keypadMountDia, id=screwHoleDia/2, anchor=TOP);
|
|
position(BACK+RIGHT) translate([.2,1,0]) tube(h=1, od=keypadMountDia, id=screwHoleDia/2, 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)
|
|
tube(h=4, od=4, id=screwHoleDia, anchor=TOP);
|
|
}
|
|
}
|
|
attach(BACK) {
|
|
// sensor
|
|
translate([0,-sensorY,0]) cylinder(h=sensorDepth, d=sensorWidth, center=true)
|
|
tag("mount") {
|
|
zrot_copies([0, 90, 180, 270]) translate([10,10,0])
|
|
tube(h=5, od=4, id=screwHoleDia, anchor=TOP);
|
|
}
|
|
}
|
|
attach(BOTTOM) {
|
|
// power
|
|
translate([0,-powerY,0]) cuboid([powerWidth, powerHeight, powerDepth], rounding=1, center=true)
|
|
tag("mount") {
|
|
zrot_copies([0, 180]) fwd(5)
|
|
tube(h=5, od=4, id=screwHoleDia, anchor=TOP);
|
|
}
|
|
}
|
|
// clamshell posts
|
|
attach(TOP) tag("mount") {
|
|
// post
|
|
zrot_copies([0, 180]) fwd(bodyFaceH/2-8)
|
|
tube(h=5, od=4, id=screwHoleDia, anchor=TOP);
|
|
// tube
|
|
zrot_copies([0, 180]) fwd(bodyFaceH/2-8) down(5) {
|
|
diff("hole"){
|
|
tube(h=1, od=5+leeway, id=3+leeway, anchor=TOP);
|
|
tube(h=8, od=6, id=5+leeway, anchor=TOP)
|
|
tag("hole") position(BOTTOM) rotate([-53,0,0]) cube([20,20,5], anchor=CTR);
|
|
}
|
|
tag("hole") down(1) cylinder(h=20, d=5+leeway, anchor=TOP);
|
|
}
|
|
}
|
|
// hollow
|
|
prismoid([bodyBackW-5, bodyBackH-5], [bodyFaceW-6, bodyFaceH-6], bodyDepth-4, rounding=3, center=true);
|
|
}
|
|
}
|
|
}
|
|
|
|
// clamshell halves
|
|
difference(){
|
|
speaker();
|
|
translate([0,-bodyDepth-13+6.1,0]) rotate([-rotateAngle+18,0,0]) partition_mask(l=1000, h=1000, w=0.1, gap=0, cutpath="flat");
|
|
}
|
|
|
|
|
|
// screen mount bracket
|
|
diff("hole") back(100) cuboid([screenCutoutWidth+16,screenBracketHeight,2], anchor=TOP)
|
|
tag("hole") {
|
|
position(LEFT) left(-4) cylinder(h=4, d=3, anchor=CTR);
|
|
position(RIGHT) right(-4) cylinder(h=4, d=3, anchor=CTR);
|
|
} |