Make the 3D model more gooder

This commit is contained in:
Will Bradley 2024-05-01 12:45:48 -07:00
parent bca0d18bfc
commit 5a9c3d9daf
Signed by: will
GPG Key ID: 1159B930701263F3
2 changed files with 95 additions and 50 deletions

View File

@ -2,13 +2,17 @@ include <BOSL2/std.scad>
$fn=40;
rotateAngle=54;
leeway=0.5;
bodyFaceW=120;
bodyFaceH=100;
bodyBackW=20;
bodyBackH=15;
bodyDepth=50;
bodyBackW=30;
bodyBackH=20;
bodyDepth=55;
screwHoleDia=2;
screenWidth=16.5+leeway; // visible
screenHeight=13+leeway; // visible
@ -18,15 +22,19 @@ 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=1;
keypadMountDia=3;
speakerWidth=45; // visible, 50 OD
speakerWidth=45; // visible
speakerMountWidth=50;
speakerConeWidth=60;
speakerDepth=2.2;
speakerY=0;
@ -34,14 +42,15 @@ speakerX=-27;
sensorWidth=4; // visible
sensorDepth=4;
sensorY=-15;
sensorY=-10;
powerWidth=4; // visible
powerWidth=8; // visible
powerHeight=4;
powerDepth=10;
powerY=0;
right_half()
diff("hole","mount") translate([0, 0, 0]) rotate([50,0,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") {
@ -51,38 +60,74 @@ diff("hole","mount") translate([0, 0, 0]) rotate([50,0,0]) {
// 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);
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]) 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);
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)
cylinder(h=5, d1=2, d2=2, anchor=TOP);
tube(h=4, od=4, id=screwHoleDia, anchor=TOP);
}
}
attach(BACK) {
// sensor
translate([0,-sensorY,0]) cylinder(h=sensorDepth, d=sensorWidth, center=true);
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]) cylinder(h=powerDepth, d=powerWidth, center=true);
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);
}

BIN
SmartAirSpeaker.stl Normal file

Binary file not shown.