- Added first draft of housing
This commit is contained in:
208
Housing/RP2350_MIDI_Lighter_PCB.scad
Normal file
208
Housing/RP2350_MIDI_Lighter_PCB.scad
Normal file
@@ -0,0 +1,208 @@
|
||||
use <MCAD/boxes.scad>
|
||||
include <RP2350_MIDI_Lighter_Definition.scad>
|
||||
|
||||
|
||||
module PCB()
|
||||
{
|
||||
color([0.0, 1.0, 0.0])
|
||||
difference()
|
||||
{
|
||||
union()
|
||||
{
|
||||
translate([PCB_W/2, PCB_H/2+5, 0]) roundedBox([PCB_W, PCB_H-10, PCB_T], 2, true, $fn=100);
|
||||
translate([PCB_W/2, PCB_H/2-5, 0]) roundedBox([PCB_W, PCB_H-10, PCB_T], 1, true, $fn=100);
|
||||
}
|
||||
|
||||
Screw_Holes_M3();
|
||||
}
|
||||
|
||||
translate([0, 0, PCB_T/2]) translate(Power_Plug) Power_Plug();
|
||||
translate([0, 0, PCB_T/2]) translate(Button) Button();
|
||||
}
|
||||
|
||||
module PCB_Cutouts_Top()
|
||||
{
|
||||
translate([0, 0, PCB_T/2-0.3]) translate(Power_Plug) Power_Plug_Cutout();
|
||||
translate([0, 0, PCB_T/2-0.5]) translate(Button) Button_Cutout();
|
||||
translate([0, 0, PCB_T/2-0.0]) translate([0, 33, 0]) USB_Cutout();
|
||||
}
|
||||
|
||||
module PCB_Cutouts_From_Bottom()
|
||||
{
|
||||
translate([0, 0, PCB_T/2-0.3 + 09.7]) translate(Power_Plug) Power_Plug_Cutout_For_Bottom();
|
||||
translate([0, 0, PCB_T/2-0.5]) translate(Button) Button_Cutout_For_Bottom();
|
||||
translate([0, 0, 0]) translate([0, 33, 0]) USB_Cutout_Small();
|
||||
translate([0, 0, 0]) translate([0, 33, 0]) Adafruit_QT_Py_Cutout();
|
||||
}
|
||||
|
||||
module Screw_Holes_M3()
|
||||
{
|
||||
for (i = Mounting_Holes) {
|
||||
translate(i) Screw_Drill(Drill_M3);
|
||||
}
|
||||
}
|
||||
|
||||
module Screw_Rings_M3()
|
||||
{
|
||||
for (i = Mounting_Holes) {
|
||||
translate(i) Screw_Ring_M3(Ring_M3_H);
|
||||
}
|
||||
}
|
||||
|
||||
module Spacer(height)
|
||||
{
|
||||
difference()
|
||||
{
|
||||
cylinder(h=height, d=5, $fn=6);
|
||||
Screw_Drill(Drill_M3);
|
||||
}
|
||||
}
|
||||
|
||||
module Spacer_Top()
|
||||
{
|
||||
color([0.3, 0.6, 0.0])
|
||||
for (i = Mounting_Holes) {
|
||||
translate(i) Spacer(Spacer_Top_Height);
|
||||
}
|
||||
}
|
||||
|
||||
module Spacer_Bot()
|
||||
{
|
||||
color([0.3, 0.6, 0.0])
|
||||
translate([0, 0, -Spacer_Bot_Height])
|
||||
for (i = Mounting_Holes) {
|
||||
translate(i) Spacer(Spacer_Bot_Height);
|
||||
}
|
||||
}
|
||||
|
||||
module Button()
|
||||
{
|
||||
translate([0, 0, 7.4/2])
|
||||
{
|
||||
translate([-3.5/2, 0, 0]) cube([3.5, 7.3, 7.4], center=true);
|
||||
|
||||
color([1, 0.65,0 ])
|
||||
translate([+3.9/2, 0, 0]) cube([3.9, 3.5, 3.5], center=true);
|
||||
}
|
||||
}
|
||||
|
||||
module Button_Cutout()
|
||||
{
|
||||
Button_W = 8;
|
||||
Button_H = 8;
|
||||
|
||||
Button_X = 30;
|
||||
Button_Z = 20;
|
||||
|
||||
translate([+Button_X/2, 0, -Button_Z/2 + Button_H])
|
||||
cube([Button_X, Button_W, Button_Z], center=true);
|
||||
}
|
||||
|
||||
module Button_Cutout_For_Bottom()
|
||||
{
|
||||
Button_W = 8;
|
||||
Button_H = 8;
|
||||
|
||||
Button_X = 1.5;
|
||||
Button_Z = 20;
|
||||
|
||||
translate([+PCB_W - Button[0] + Wall_PCB_GAP + Button_X/2 - eps, 0, +Button_Z/2])
|
||||
cube([Button_X, Button_W, Button_Z], center=true);
|
||||
|
||||
translate([+PCB_W - Button[0] + Wall_PCB_GAP + Button_X/2 - eps, 0, 4.75])
|
||||
cube([3*Button_X, 3.5, 3.5], center=true);
|
||||
}
|
||||
|
||||
module Power_Plug()
|
||||
{
|
||||
color([0.1, 0.1, 0.1])
|
||||
translate([10.625, -2.4, 0])
|
||||
difference()
|
||||
{
|
||||
translate([-3.5, 0, 0])
|
||||
union()
|
||||
{
|
||||
translate([3.5/2, 0, 11/2]) cube([ 3.5, 9, 11.0], center=true);
|
||||
translate([-10.9/2, 0, 6.4/2]) cube([10.9, 9, 6.4], center=true);
|
||||
translate([-10.9/2, 0, 6.4]) rotate([0, 90, 0]) cylinder(h=10.9, d=9, center=true, $fn=60);
|
||||
}
|
||||
|
||||
translate([-9.2/2, 0, 6.4])
|
||||
rotate([0, 90, 0])
|
||||
cylinder(h=9.2+1, d=6.3, center=true, $fn=60);
|
||||
}
|
||||
}
|
||||
|
||||
module Power_Plug_Cutout()
|
||||
{
|
||||
Plug_D = 14.5;
|
||||
Plug_W = 10;
|
||||
Plug_H = 11.5;
|
||||
|
||||
Plug_X = 30;
|
||||
Plug_Z = 20;
|
||||
|
||||
translate([+Plug_X/2-Plug_D+5.08, -2.4, -Plug_Z/2 + Plug_H])
|
||||
cube([Plug_X, Plug_W, Plug_Z], center=true);
|
||||
}
|
||||
|
||||
module Power_Plug_Cutout_For_Bottom()
|
||||
{
|
||||
Plug_D = 14.5;
|
||||
Plug_W = 10;
|
||||
Plug_H = 11.5;
|
||||
|
||||
Plug_X = 30;
|
||||
Plug_Z = 20;
|
||||
|
||||
translate([+Plug_X/2-Plug_D+5.08, -0, -Plug_Z/2 + Plug_H + 5])
|
||||
cube([Plug_X, Plug_W, Plug_Z], center=true);
|
||||
|
||||
translate([0, 0.5, -3])
|
||||
rotate([0, 90, 0])
|
||||
cylinder(d=11, h=Plug_X, center=true, $fn=60);
|
||||
}
|
||||
|
||||
module USB_Cutout()
|
||||
{
|
||||
USB_H = 3.2;
|
||||
USB_W = 9;
|
||||
USB_D = 22;
|
||||
|
||||
USB_Y = 9.5;
|
||||
USB_Z = 20;
|
||||
|
||||
|
||||
PCB_H = 1.6;
|
||||
PCB_W = 18;
|
||||
PCB_D = 22;
|
||||
|
||||
PCB_X = 40;
|
||||
PCB_Z = 5;
|
||||
|
||||
translate([0, 0, -USB_Z/2 + PCB_H + USB_H - 0.5]) cube([USB_D, USB_Y, USB_Z], center=true);
|
||||
// translate([-PCB_X/2+PCB_D, 0, -PCB_Z/2 + PCB_H]) cube([PCB_X, PCB_W, PCB_Z], center=true);
|
||||
}
|
||||
|
||||
module USB_Cutout_Small()
|
||||
{
|
||||
USB_H = 3.2;
|
||||
USB_W = 9;
|
||||
USB_D = 22;
|
||||
|
||||
USB_Y = 9.5;
|
||||
USB_Z = 3.5;
|
||||
|
||||
|
||||
PCB_H = 1.6;
|
||||
PCB_W = 18;
|
||||
PCB_D = 22;
|
||||
|
||||
PCB_X = 40;
|
||||
PCB_Z = 5;
|
||||
|
||||
translate([0, 0.5, USB_Z/2 + PCB_H + 1.0])
|
||||
rotate([0, 90, 0])
|
||||
roundedBox([USB_Z, USB_Y, USB_D], 1, true, $fn = $preview ? 32 : 100);
|
||||
// cube([USB_D, USB_Y, USB_Z], center=true);
|
||||
}
|
||||
Reference in New Issue
Block a user