mirror of
https://github.com/Spritetm/minimacplus.git
synced 2025-01-13 18:30:25 +00:00
Reorganize repo; add case and PCB artwork
This commit is contained in:
parent
e99b87a269
commit
7405ea9042
428
case/mac.scad
Normal file
428
case/mac.scad
Normal file
@ -0,0 +1,428 @@
|
||||
//All measurements in mm
|
||||
|
||||
$fa=8; //segments/360 degrees
|
||||
$fs=0.1; //min size of fragment
|
||||
$fn=32; //override amount of facets
|
||||
|
||||
|
||||
scale=50/300; //1-to-6
|
||||
|
||||
wall=2.5; //real mms
|
||||
|
||||
overlap=5; //real mms; overlap between halves
|
||||
overlapth=1.5; //real mms: thickness of material in overlap
|
||||
|
||||
//1 - cutout
|
||||
//2 - full render
|
||||
//3 - intersection case - pcb
|
||||
//4 - front half / back half
|
||||
//5 - front half / back half side-by-side
|
||||
//6 - back
|
||||
//7 - front
|
||||
type=6;
|
||||
|
||||
|
||||
if (type==1) {
|
||||
difference() {
|
||||
union() {
|
||||
mac_half_front(wall, scale, overlap, overlapth);
|
||||
translate([0,1,0]) mac_half_back(wall, scale, overlap, overlapth);
|
||||
}
|
||||
translate([125*scale, -500, -500]) cube([1000, 1000, 1000], false);
|
||||
}
|
||||
displaypcb(wall, scale);
|
||||
translate([0,1,0]) usbserpcb_mounted(wall);
|
||||
} else if (type==2) {
|
||||
union() {
|
||||
mac_half_front(wall, scale, overlap, overlapth);
|
||||
mac_half_back(wall, scale, overlap, overlapth);
|
||||
}
|
||||
displaypcb(wall, scale);
|
||||
usbserpcb_mounted(wall);
|
||||
} else if (type==3) {
|
||||
intersection() {
|
||||
union() {
|
||||
mac_half_front(wall, scale, overlap, overlapth);
|
||||
mac_half_back(wall, scale, overlap, overlapth);
|
||||
}
|
||||
displaypcb(wall, scale);
|
||||
}
|
||||
} else if (type==4 || type==5) {
|
||||
translate([0, 10, 0]) union() {
|
||||
mac_half_back(wall, scale, overlap, overlapth);
|
||||
usbserpcb_mounted(wall);
|
||||
}
|
||||
rotate([0,0,type==5?180:0]) union () {
|
||||
mac_half_front(wall, scale, overlap, overlapth);
|
||||
*color("red") displaypcb(wall, scale);
|
||||
}
|
||||
} else if (type==6) {
|
||||
mac_half_back(wall, scale, overlap, overlapth);
|
||||
} else if (type==7) {
|
||||
mac_half_front(wall, scale, overlap, overlapth);
|
||||
}
|
||||
|
||||
|
||||
module mac_half_front(wall, scale, overlap, overlapth) {
|
||||
union() {
|
||||
scale(scale) union() {
|
||||
difference() {
|
||||
mac_hull(wall/scale);
|
||||
mac_crack_divider();
|
||||
}
|
||||
intersection() {
|
||||
mac_overlap_inner_edge(overlapth/scale);
|
||||
difference() {
|
||||
mac_crack_divider_expanded(-0.8/scale);
|
||||
mac_crack_divider_expanded(overlap/scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
difference() {
|
||||
union() {
|
||||
//bottom screen tab
|
||||
translate([17+wall, -1, 8]) rotate([-20, 0, 0]) cube([10, 2, 3]);
|
||||
//top tab
|
||||
translate([14.5+wall, 1, 50]) cube([4, 5, 3]);
|
||||
}
|
||||
displaypcb(wall, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module mac_half_back(wall, scale, overlap, overlapth) {
|
||||
union() {
|
||||
difference() {
|
||||
union() {
|
||||
scale(scale) difference() {
|
||||
intersection() {
|
||||
mac_hull(wall/scale);
|
||||
mac_crack_divider();
|
||||
}
|
||||
intersection() {
|
||||
mac_overlap_inner_edge(overlapth/scale);
|
||||
difference() {
|
||||
mac_crack_divider();
|
||||
mac_crack_divider_expanded(overlap/scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
//front tab for usb-ser conv
|
||||
translate([wall, 37.7-26-2, 0]) cube([16, 2, wall+1.7]);
|
||||
//back tabs for usb-ser conv
|
||||
translate([0, 37-5, wall+1.9]) cube([16+wall, 7, 3]);
|
||||
}
|
||||
usb_hole(wall);
|
||||
mouse_hole(wall);
|
||||
usbserpcb_mounted(wall);
|
||||
}
|
||||
//Enable for signatures in backplate
|
||||
//Disabled because 3d-printer doesn't really show these...
|
||||
//translate([wall, 38.2, 8+wall]) rotate([90, 0, 0]) scale(.2) linear_extrude(height = 3.3) import(file = "signatures.dxf");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
module usb_hole(wall) {
|
||||
w=3; //extra width for bevel
|
||||
i=0.2; //inset of bevel
|
||||
translate([16+wall,37.7,wall]) rotate([0,0,180]) union() {
|
||||
translate([4.5, -100, 1.6]) cube([7.55, 100 , 3.65]);
|
||||
translate([4.5-w/2, -wall+i-10, 1.6-w/2]) cube([7.55+w, 10 , 3.65+w]);
|
||||
}
|
||||
}
|
||||
|
||||
module mouse_hole(wall) {
|
||||
translate([26+wall, 37.7, wall+3.2]) rotate([-90, 0, 0]) cylinder(d=2, 50);
|
||||
}
|
||||
|
||||
module usbserpcb_mounted(wall) {
|
||||
translate([16+wall,37.7,wall]) rotate([0,0,180]) usbserpcb();
|
||||
}
|
||||
|
||||
module usbserpcb() {
|
||||
cube([16, 26, 1.6]);
|
||||
translate([4.5, 0, 1.6]) cube([7.55, 9 , 3.65]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//generates square hull you can cut the inner overlap out of
|
||||
module mac_overlap_inner_edge(overlapth, isInner) {
|
||||
difference() {
|
||||
translate([overlapth, -200, overlapth]) cube([247.6-overlapth*2,500,334-overlapth*2]);
|
||||
translate([overlapth*2, -200, overlapth*2]) cube([247.6-overlapth*4,500,334-overlapth*4]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
module mac_hull(wall) {
|
||||
difference() {
|
||||
mac_hull_solid(0);
|
||||
union() {
|
||||
mac_hull_solid(wall);
|
||||
translate([0, -25.4, 44.5]) rotate([-5,0, 0]) union() { //Cutout the screen in the back of the frontplate as well
|
||||
translate([247.6/2, 0, 185]) rotate([90, 0, 0]) scale(1.69) mac_screen_cutout(wall/1.69);
|
||||
//Cutout fdd slot
|
||||
translate([129, -5.2, 62.8]) rotate([90,0,0]) fdd_cutout();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
module displaypcb(wall, scale) {
|
||||
translate([wall+.6,-1.6,60*scale]) rotate([90-5,180,180]) translate([0, -42, wall-2.05]) union() {
|
||||
cube([35,42, 0.8]); //main pcb
|
||||
translate([1, 6.8, 0]) cube([16, 24, 3.6+0.8]); //wroom block
|
||||
translate([1.6, 0.4, -1.2]) difference() { //screen
|
||||
cube([32.2, 36.75, 1.2]);
|
||||
translate([1.5, 2.73, -10+0.7]) cube([28.9, 19.5, 10]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
module mac_hull_solid(shrink) {
|
||||
rnd=4.5; //rounding of outer case
|
||||
//ir=0.8; //rounding of outmost screen bezel
|
||||
//a=-6.18; //angle of front
|
||||
r=(rnd<shrink)?0.01:rnd-shrink;
|
||||
difference() {
|
||||
union() {
|
||||
difference() {
|
||||
//Cube that makes up bottom and back of mac
|
||||
translate([shrink, shrink, shrink]) roundedcube(247.6-shrink*2, 241.3-shrink*2, 310-shrink*2, r);
|
||||
//cut off bit that sticks through front panel
|
||||
translate([-500, -1000+150, 150]) cube([1000, 1000, 1000]);
|
||||
}
|
||||
//add in rotated front bulk
|
||||
translate([0, -25.4, 44.5]) rotate([-5,0, 0]) mac_front_bulk(4.5, 2, shrink);
|
||||
}
|
||||
union() {
|
||||
//Cut off diagonal bit in top-back of case
|
||||
translate([-1, 241-shrink, 266]) rotate([30, 0, 0]) cube([300, 300, 300], false);
|
||||
//Handle handle
|
||||
translate([247.6/2,105-shrink,280]) rotate([90+5,0,180]) mac_handle_hole(shrink);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module mac_front_bulk(or, ir, shrink) {
|
||||
fp_th=5.2; //thickness of front plate)
|
||||
fp_extra=(shrink<fp_th)?0:shrink-fp_th;
|
||||
or=(or<shrink)?0.01:or-shrink;
|
||||
ir=(ir<shrink)?0.01:ir-shrink;
|
||||
difference() {
|
||||
union() {
|
||||
difference() {
|
||||
translate([0+shrink, -20+shrink, 0+shrink]) roundedcube(247.6-shrink*2, 233.9+20-shrink*2, 292.1-shrink*2, or);
|
||||
union() {
|
||||
//Cut off front where faceplate goes
|
||||
translate([-500, -1000+fp_extra, -500]) cube([1000, 1000, 1000]);
|
||||
}
|
||||
}
|
||||
if (shrink==0) {
|
||||
mac_front_faceplate(or, ir);
|
||||
} else {
|
||||
translate([247.6/2, 50, 185]) rotate([90,0,0])scale([1.69, 1.69, 100]) mac_screen_cutout_back();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//negative: handle hole (as in: hole for the handle to carry the mac)
|
||||
//needs to be bigger when shrink increases
|
||||
module mac_handle_hole(shrink) {
|
||||
r=6.4;
|
||||
difference() {
|
||||
union() {
|
||||
hull() {
|
||||
translate([-97/2+r-shrink, r-shrink ,0]) cylinder(r=r, 200);
|
||||
translate([97/2-r+shrink, r-shrink ,0]) cylinder(r=r, 200);
|
||||
translate([-103/2+r-shrink, 46-r ,0]) cylinder(r=r, 200);
|
||||
translate([103/2-r+shrink, 46-r ,0]) cylinder(r=r, 200);
|
||||
}
|
||||
if (shrink==0) {
|
||||
difference() {
|
||||
translate([-103/2-r, 46-r, 0]) cube([103+2*r, 200, 200]);
|
||||
union() {
|
||||
translate([-103/2-r, 46-r ,0]) cylinder(r=r, 200);
|
||||
translate([103/2+r, 46-r ,0]) cylinder(r=r, 2200);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (shrink==0) {
|
||||
//thing where you hold the mac
|
||||
translate([-100, 35, 0]) rotate([90,0,90]) hull() {
|
||||
cylinder(d=14.6, 200);
|
||||
translate([0, 35, 0]) cylinder(d=14.6, 200);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//crack divider, but moved up/right to get the overlap edge
|
||||
module mac_crack_divider_expanded(ex) {
|
||||
translate([0,ex,ex]) mac_crack_divider();
|
||||
}
|
||||
|
||||
module mac_crack_divider() {
|
||||
difference() {
|
||||
rotate([-5, 0, 0]) translate([0, -15, 65]) union() {
|
||||
hull () {
|
||||
translate([0,0,0]) rotate([0,90,0]) cylinder(r=1.5, 1000);
|
||||
translate([0,0,1000]) rotate([0,90,0]) cylinder(r=1.5, 1000);
|
||||
translate([0,1000,0]) rotate([0,90,0]) cylinder(r=1.5, 1000);
|
||||
}
|
||||
translate([-500,20,-500]) cube([1000,1000,1000]);
|
||||
}
|
||||
translate([0, 15, 0]) hull() {
|
||||
translate([-500, 0, -200]) rotate([0,90,0]) cylinder(r=4.5, 1000);
|
||||
translate([-500, 0, 58.4]) rotate([0,90,0]) cylinder(r=4.5, 1000);
|
||||
translate([-500, -200, 58.4]) rotate([0,90,0]) cylinder(r=4.5, 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module mac_front_faceplate() {
|
||||
mac_front_faceplate_outer(4.5, 2);
|
||||
}
|
||||
|
||||
module mac_front_faceplate_outer(or, ir) {
|
||||
hull() {
|
||||
//connection to bulk of case
|
||||
translate([0+or, 0, 0+or]) rotate([90,0,0]) cylinder(1, or);
|
||||
translate([0+or, 0, 292.1-or]) rotate([90,0,0]) cylinder(1, or);
|
||||
translate([247.6-or, 0, 0+or]) rotate([90,0,0]) cylinder(1, or);
|
||||
translate([247.6-or, 0, 292.1-or]) rotate([90,0,0]) cylinder(1, or);
|
||||
//face of mac
|
||||
translate([0+3.4+ir, 1-5.2, 0+8+ir]) rotate([90,0,0]) cylinder(1, ir);
|
||||
translate([0+3.4+ir, 1-5.2, 292.1-10-ir]) rotate([90,0,0]) cylinder(1, ir);
|
||||
translate([247.6-3.4-ir, 1-5.2, 0+8+ir]) rotate([90,0,0]) cylinder(1, ir);
|
||||
translate([247.6-3.4-ir, 1-5.2, 292.1-10-ir]) rotate([90,0,0]) cylinder(1, ir);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//WARNING: Everything inhere is adjusted using the wrong scale because I didn't pay attention. I'm too lazy to fix it all up, so if you use it scale(1.69) it first.
|
||||
module mac_screen_cutout(depth) {
|
||||
or=2.5;
|
||||
ow=123-or*2;
|
||||
oh=94-or*2;
|
||||
hull() {
|
||||
//back cutout; fakes CRT curves
|
||||
translate([0,0,2.5-depth]) mac_screen_cutout_back();
|
||||
//very front of bezel
|
||||
translate([ow/2, oh/2, 5.2-1]) cylinder(1, r=or);
|
||||
translate([ow/2, -oh/2, 5.2-1]) cylinder(1, r=or);
|
||||
translate([-ow/2, oh/2, 5.2-1]) cylinder(1, r=or);
|
||||
translate([-ow/2, -oh/2, 5.2-1]) cylinder(1, r=or);
|
||||
}
|
||||
}
|
||||
|
||||
//Same scale(1.69) is required here.
|
||||
module mac_screen_cutout_back() {
|
||||
intersection() {
|
||||
intersection() {
|
||||
union() {
|
||||
translate([0, 23-(46-42), 0]) scale([246, 46, 1]) cylinder(10, d=1);
|
||||
translate([0, -23+(46-42), 0]) scale([246, 46, 1]) cylinder(10, d=1);
|
||||
}
|
||||
union() {
|
||||
translate([-56/2, 0, 0]) scale([56, 300, 1]) cylinder(1, d=1);
|
||||
translate([0, 0, 0]) scale([56, 300, 1]) cylinder(1, d=1);
|
||||
translate([56/2, 0, 0]) scale([56, 300, 1]) cylinder(1, d=1);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
union() {
|
||||
dr=6.2;
|
||||
w=111-dr*2;
|
||||
h=82-dr*2;
|
||||
translate([w/2, h/2, 0]) cylinder(10, r=6.2);
|
||||
translate([w/2, -h/2, 0]) cylinder(10, r=6.2);
|
||||
translate([-w/2, h/2, 0]) cylinder(10, r=6.2);
|
||||
translate([-w/2, -h/2, 0]) cylinder(10, r=6.2);
|
||||
translate([-w/2, -500, 0]) cube([w, 1000, 10]);
|
||||
translate([-500, -h/2, 0]) cube([1000, h, 10]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Negative space of FDD.
|
||||
module fdd_cutout() {
|
||||
union() {
|
||||
fdd_cutout_inner_slot();
|
||||
fdd_cutout_inner_right();
|
||||
translate([0,0,0]) fdd_cutout_bezel();
|
||||
//fdd force eject button
|
||||
translate([98, -5,-50]) cylinder(100, r=1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module fdd_cutout_bezel() {
|
||||
thickness=1;
|
||||
union() {
|
||||
hull() {
|
||||
translate([0,0,5-thickness]) fdd_cutout_inner_slot();
|
||||
translate([-10.4, -11.5/2, 0]) flatroundedcube(112.3, 11.5, 10, 1);
|
||||
}
|
||||
hull() {
|
||||
translate([0,0,5-thickness]) fdd_cutout_inner_right();
|
||||
translate([57.7,-24/2 , 0]) flatroundedcube(44.5, 24, 10, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module fdd_cutout_inner_slot() {
|
||||
translate([0, -2.6, -5]) cube([93.4, 5.2, 10]);
|
||||
}
|
||||
|
||||
module fdd_cutout_inner_right() {
|
||||
translate([65.7, -8.9, -5]) flatroundedcube(27.7, 17.8, 10, 2.1);
|
||||
}
|
||||
|
||||
//Cube with 4 edges rounded; front/back are flat
|
||||
module flatroundedcube(x,y,z,r) {
|
||||
hull(){
|
||||
translate([0+r, 0+r, 0]) cylinder(z, r=r);
|
||||
translate([0+r, y-r, 0]) cylinder(z, r=r);
|
||||
translate([x-r, 0+r, 0]) cylinder(z, r=r);
|
||||
translate([x-r, y-r, 0]) cylinder(z, r=r);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Cube with all edges rounded
|
||||
module roundedcube(x, y, z, r) {
|
||||
if(0) {
|
||||
cube([x,y,z], false);
|
||||
} else {
|
||||
hull() {
|
||||
translate([0+r,0+r,0+r]) sphere(r);
|
||||
translate([x-r,0+r,0+r]) sphere(r);
|
||||
translate([0+r,y-r,0+r]) sphere(r);
|
||||
translate([x-r,y-r,0+r]) sphere(r);
|
||||
translate([0+r,0+r,z-r]) sphere(r);
|
||||
translate([x-r,0+r,z-r]) sphere(r);
|
||||
translate([0+r,y-r,z-r]) sphere(r);
|
||||
translate([x-r,y-r,z-r]) sphere(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
255
case/mouse.scad
Normal file
255
case/mouse.scad
Normal file
@ -0,0 +1,255 @@
|
||||
$fa=8; //segments/360 degrees
|
||||
$fs=0.1; //min size of fragment
|
||||
$fn=32; //override amount of facets
|
||||
|
||||
|
||||
//scale=50/300; //1-to-6
|
||||
scale=1/2.5;
|
||||
|
||||
cheat=1.17; //cheat: scale the height up slightly to fit the sensor. 1=no cheating
|
||||
|
||||
|
||||
wall=2.5;
|
||||
|
||||
btn_lip_outer=1.3;
|
||||
btn_toler=.1;
|
||||
btn_ex=.2; //how much the button 'sticks out'
|
||||
|
||||
mouse_lip_h=2;
|
||||
mouse_lip_th=1.7;
|
||||
|
||||
//1 - presentation view / cutaway
|
||||
//2 - bottom plate
|
||||
//3 - top plate
|
||||
//4 - button
|
||||
type=5;
|
||||
|
||||
if (type==1) {
|
||||
difference() {
|
||||
union() {
|
||||
macmouse_lower(scale, wall, cheat, btn_lip_outer, mouse_lip_h, mouse_lip_th);
|
||||
translate([0,0,5]) macmouse_upper(scale, wall, cheat, btn_lip_outer, mouse_lip_h, mouse_lip_th);
|
||||
}
|
||||
//Cut off 2nd half of mouse
|
||||
translate([30*scale, 0, -10]) cube([1000, 1000, 1000]);
|
||||
}
|
||||
|
||||
//Add sensor
|
||||
translate([(59*scale)/2, 65*scale, 1.3]) sensor(false);
|
||||
|
||||
//Add button
|
||||
translate([0,0,5]) difference() {
|
||||
mousebtn(scale, wall, btn_lip_outer-btn_toler, btn_toler, btn_ex, cheat);
|
||||
translate([30*scale, 0, -10]) cube([1000, 1000, 1000]);
|
||||
}
|
||||
} else if (type==2) {
|
||||
difference() {
|
||||
macmouse_lower(scale, wall, cheat, btn_lip_outer, mouse_lip_h, mouse_lip_th);
|
||||
translate([(59*scale)/2, 65*scale, 1.3]) sensor(true);
|
||||
}
|
||||
} else if (type==3) {
|
||||
macmouse_upper(scale, wall, cheat, btn_lip_outer, mouse_lip_h, mouse_lip_th);
|
||||
} else if (type==4) {
|
||||
mousebtn(scale, wall, btn_lip_outer-btn_toler, btn_toler, btn_ex, cheat);
|
||||
} else if (type==5) {
|
||||
union() {
|
||||
translate([0,0,5]) macmouse_upper(scale, wall, cheat, btn_lip_outer, mouse_lip_h, mouse_lip_th);
|
||||
//Add button
|
||||
translate([0,0,5]) {
|
||||
mousebtn(scale, wall, btn_lip_outer-btn_toler, btn_toler, btn_ex, cheat);
|
||||
}
|
||||
}
|
||||
|
||||
macmouse_lower(scale, wall, cheat, btn_lip_outer, mouse_lip_h, mouse_lip_th);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
module macmouse_lower(scale, wall, cheat, btn_lip_outer, mouse_lip_h, mouse_lip_th) {
|
||||
difference() {
|
||||
union() {
|
||||
intersection() {
|
||||
macmouse(scale, wall, cheat, btn_lip_outer);
|
||||
cube([1000, 1000, 5.4*scale]);
|
||||
}
|
||||
intersection() {
|
||||
scale(scale, scale, scale*cheat) translate([0, 0, 5.4]) difference() {
|
||||
macmouse_solid(mouse_lip_th/scale);
|
||||
macmouse_solid(mouse_lip_th*2/scale);
|
||||
}
|
||||
translate([0,0,5.4*scale]) cube([1000, 1000, mouse_lip_h]);
|
||||
}
|
||||
}
|
||||
cord_hole(scale);
|
||||
}
|
||||
}
|
||||
|
||||
module macmouse_upper(scale, wall, cheat, btn_lip_outer, mouse_lip_h, mouse_lip_th) {
|
||||
difference() {
|
||||
union() {
|
||||
difference() {
|
||||
macmouse(scale, wall, cheat, btn_lip_outer);
|
||||
cube([1000, 1000, 5.4*scale+mouse_lip_h]);
|
||||
}
|
||||
intersection() {
|
||||
macmouse(scale, wall-(mouse_lip_th/2), cheat, btn_lip_outer);
|
||||
translate([0,0,5.4*scale]) cube([1000, 1000, mouse_lip_h]);
|
||||
}
|
||||
}
|
||||
cord_hole(scale);
|
||||
}
|
||||
}
|
||||
|
||||
module cord_hole(scale) {
|
||||
translate([59/2*scale, 30, wall+1.5]) rotate([-90,0,0]) cylinder(d=2, 100);
|
||||
}
|
||||
|
||||
module macmouse(scale, wall, cheat, btn_lip_outer) {
|
||||
scale([1, 1, cheat]) difference() {
|
||||
macmouse_hull(scale, wall);
|
||||
union() {
|
||||
//button hole
|
||||
scale(scale) macmouse_btn_hole(0);
|
||||
//lip
|
||||
scale(scale) intersection() {
|
||||
macmouse_btn_hole(-btn_lip_outer/scale);
|
||||
translate([0, 0, 5.4+(btn_lip_outer/scale)]) macmouse_solid(wall/scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module mousebtn(scale, wall, lipsz, toler, btn_ex, cheat) {
|
||||
difference() {
|
||||
scale([scale, scale, scale*cheat]) union() {
|
||||
intersection() {
|
||||
//mouse button itself
|
||||
translate([0, 0, 5.4]) difference() {
|
||||
translate([0,0,btn_ex/scale]) macmouse_solid(0);
|
||||
macmouse_solid(wall/scale);
|
||||
}
|
||||
macmouse_btn_hole(toler/scale);
|
||||
}
|
||||
intersection() {
|
||||
//lip
|
||||
translate([0, 0, 5.4]) difference() {
|
||||
translate([0,0,lipsz/scale]) macmouse_solid(wall/scale);
|
||||
macmouse_solid(wall/scale);
|
||||
}
|
||||
macmouse_btn_hole(-lipsz/scale);
|
||||
}
|
||||
|
||||
}
|
||||
translate([(59*scale)/2, 65*scale+2.1, 1.3+11.35-(2.6/2)]) cube([5, 5, 2.6], true);
|
||||
}
|
||||
}
|
||||
|
||||
module sensor(negative) {
|
||||
union() {
|
||||
difference() {
|
||||
//inner oval on bottom
|
||||
flatroundedcube(9.3, 11.6, 1.5, 2, true);
|
||||
flatroundedcube(8.0, 10.3, 1.5, 2-0.3, true);
|
||||
}
|
||||
difference() {
|
||||
//2nd oval on bottom
|
||||
flatroundedcube(14.1, 16.3, 1.5, 4.5, true);
|
||||
flatroundedcube(12.9, 14.5, 1.5, 4.5-0.3, true);
|
||||
}
|
||||
if (negative) {
|
||||
translate([0,0,-20]) flatroundedcube(8.0, 10.3, 40, 2-0.3, true);
|
||||
}
|
||||
translate([0,0,1]) flatroundedcube(14.1, 16.3, 1, 4.5, true);
|
||||
translate([0,-1,2+(6.5/2)]) cube([8.6, 12.8, 6.5], true);
|
||||
translate([0,0.3,6.5+(2/2)]) cube([14.3, 15.6, 2], true);
|
||||
|
||||
translate([0, 2.1, 8.5+(2.6/2)]) cube([3.4, 4.2, 2.6], true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module macmouse_hull(scale, wall) {
|
||||
scale(scale) translate([0, 0, 5.4]) difference() {
|
||||
macmouse_solid(0);
|
||||
macmouse_solid(wall/scale);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module macmouse_btn_hole(shrink) {
|
||||
translate([59/2, 73, 10]) flatroundedcube(35-shrink, 25-shrink, 100, 1.6, true);
|
||||
}
|
||||
|
||||
module macmouse_solid(shrink) {
|
||||
union() {
|
||||
hull() {
|
||||
macmouse_topbulk(shrink);
|
||||
translate([0, 95.3, 0]) rotate([5, 0, 0]) translate([(59-47.6)/2, -92+16, 22-shrink]) cube([47.6, 60.3, 6]);
|
||||
}
|
||||
macmouse_bottombulk(shrink);
|
||||
}
|
||||
}
|
||||
|
||||
module macmouse_bottombulk(shrink) {
|
||||
r=5-shrink;
|
||||
v=0.4; //difference in rounding of corners of mouse vs bottom side of mouse
|
||||
difference() {
|
||||
translate([shrink, shrink, -5.4+shrink]) scale([1,1,v]) roundedcube(59-(shrink*2), 95.4-(shrink*2), 20/v, r);
|
||||
translate([-500, -500, 0]) cube([1000, 1000, 1000]);
|
||||
}
|
||||
}
|
||||
|
||||
module macmouse_topbulk(shrink) {
|
||||
r=5-shrink;
|
||||
difference() {
|
||||
union() {
|
||||
//bulk... erm... bulk
|
||||
translate([shrink, 95.3+shrink, 0]) rotate([5, 0, 0]) translate([0, -92, 0]) flatroundedcube(59-shrink*2, 92-shrink*2, 30, r);
|
||||
//to add the corner near the bottom of the mouse
|
||||
translate([shrink, shrink, 0]) rotate([-5, 0, 0]) flatroundedcube(59-shrink*2, 20, 20, r);
|
||||
}
|
||||
union() {
|
||||
//cut off bottom so it's flat
|
||||
translate([-500, -500, -1000]) cube([1000, 1000, 1000]);
|
||||
//cut off top so it's flat
|
||||
rotate([5, 0, 0]) translate([-500, -500, 14.28-shrink*0.7]) cube([1000, 1000, 1000]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Cube with 4 edges rounded; front/back are flat
|
||||
module flatroundedcube(x,y,z,r,center) {
|
||||
if(r<=0) {
|
||||
cube([x,y,z], center);
|
||||
} else {
|
||||
translate([center?-x/2:0, center?-y/2:0, 0]) hull(){
|
||||
translate([0+r, 0+r, 0]) cylinder(z, r=r);
|
||||
translate([0+r, y-r, 0]) cylinder(z, r=r);
|
||||
translate([x-r, 0+r, 0]) cylinder(z, r=r);
|
||||
translate([x-r, y-r, 0]) cylinder(z, r=r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Cube with all edges rounded
|
||||
module roundedcube(x, y, z, r, center) {
|
||||
if(r<=0) {
|
||||
cube([x,y,z], center);
|
||||
} else {
|
||||
translate([center?-x/2:0, center?-y/2:0, 0]) hull() {
|
||||
translate([0+r,0+r,0+r]) sphere(r);
|
||||
translate([x-r,0+r,0+r]) sphere(r);
|
||||
translate([0+r,y-r,0+r]) sphere(r);
|
||||
translate([x-r,y-r,0+r]) sphere(r);
|
||||
translate([0+r,0+r,z-r]) sphere(r);
|
||||
translate([x-r,0+r,z-r]) sphere(r);
|
||||
translate([0+r,y-r,z-r]) sphere(r);
|
||||
translate([x-r,y-r,z-r]) sphere(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
0
.gitignore → firmware/.gitignore
vendored
0
.gitignore → firmware/.gitignore
vendored
21
pcb/bom.txt
Normal file
21
pcb/bom.txt
Normal file
@ -0,0 +1,21 @@
|
||||
IC1: TPS65631W *WARNING PCB USES QFN10 VERSION, QFN12 IS ALSO OBTAINABLE BUT WON'T FIT*
|
||||
IC2: 74LVC1G74
|
||||
IC3: NS8002
|
||||
IC4: HT7830
|
||||
IC5: VRH1802NLX
|
||||
|
||||
(R8, R9, near conn: add 2 3K6 resistors to R11 top)
|
||||
R2, R4: 20K
|
||||
R3, R18, R19, R20: 10K
|
||||
R5, R14, R15: 280
|
||||
R6, R7, R16: 1K
|
||||
R8, R9, R10, R13: 150
|
||||
R17: 320
|
||||
R12: 1K5
|
||||
R11, R21, R22: 3K6
|
||||
|
||||
C1, C6, C6, C13: 1uF
|
||||
C2, C3, C8-C12: 10uF
|
||||
C4, C5, C7: 100nF
|
||||
|
||||
L1, L2: SWPA4012S100MT 10uH
|
3492
pcb/gerber/mac128.bottom.gbr
Normal file
3492
pcb/gerber/mac128.bottom.gbr
Normal file
File diff suppressed because it is too large
Load Diff
53
pcb/gerber/mac128.bottommask.gbr
Normal file
53
pcb/gerber/mac128.bottommask.gbr
Normal file
@ -0,0 +1,53 @@
|
||||
G04 start of page 7 for group -4062 idx -4062 *
|
||||
G04 Title: (unknown), soldermask *
|
||||
G04 Creator: pcb 4.0.2 *
|
||||
G04 CreationDate: Sun Feb 4 07:02:53 2018 UTC *
|
||||
G04 For: jeroen *
|
||||
G04 Format: Gerber/RS-274X *
|
||||
G04 PCB-Dimensions (mil): 6000.00 5000.00 *
|
||||
G04 PCB-Coordinate-Origin: lower left *
|
||||
%MOIN*%
|
||||
%FSLAX25Y25*%
|
||||
%LNBOTTOMMASK*%
|
||||
%ADD43C,0.0660*%
|
||||
%ADD42C,0.0001*%
|
||||
%ADD41C,0.0300*%
|
||||
G54D41*X456299Y178740D03*
|
||||
Y181496D03*
|
||||
Y184252D03*
|
||||
G54D42*G36*
|
||||
X344810Y310072D02*Y303472D01*
|
||||
X351410D01*
|
||||
Y310072D01*
|
||||
X344810D01*
|
||||
G37*
|
||||
G54D43*X358110Y306772D03*
|
||||
X368110D03*
|
||||
X378110D03*
|
||||
X388110D03*
|
||||
G54D42*G36*
|
||||
X461503Y320623D02*Y314023D01*
|
||||
X468103D01*
|
||||
Y320623D01*
|
||||
X461503D01*
|
||||
G37*
|
||||
G54D43*X474803Y317323D03*
|
||||
G54D42*G36*
|
||||
X444338Y309402D02*Y302802D01*
|
||||
X450938D01*
|
||||
Y309402D01*
|
||||
X444338D01*
|
||||
G37*
|
||||
G54D43*X447638Y296102D03*
|
||||
G54D42*G36*
|
||||
X344810Y320623D02*Y314023D01*
|
||||
X351410D01*
|
||||
Y320623D01*
|
||||
X344810D01*
|
||||
G37*
|
||||
G54D43*X358110Y317323D03*
|
||||
X368110D03*
|
||||
X378110D03*
|
||||
X388110D03*
|
||||
X398110D03*
|
||||
M02*
|
148
pcb/gerber/mac128.bottomsilk.gbr
Normal file
148
pcb/gerber/mac128.bottomsilk.gbr
Normal file
@ -0,0 +1,148 @@
|
||||
G04 start of page 9 for group -4078 idx -4078 *
|
||||
G04 Title: (unknown), bottomsilk *
|
||||
G04 Creator: pcb 4.0.2 *
|
||||
G04 CreationDate: Sun Feb 4 07:02:53 2018 UTC *
|
||||
G04 For: jeroen *
|
||||
G04 Format: Gerber/RS-274X *
|
||||
G04 PCB-Dimensions (mil): 6000.00 5000.00 *
|
||||
G04 PCB-Coordinate-Origin: lower left *
|
||||
%MOIN*%
|
||||
%FSLAX25Y25*%
|
||||
%LNBOTTOMSILK*%
|
||||
%ADD48C,0.0059*%
|
||||
G54D48*X347244Y165608D02*X347644Y166008D01*
|
||||
X347244Y163208D02*X347644Y162808D01*
|
||||
X347244Y163208D02*Y165608D01*
|
||||
X349164Y166008D02*X350204D01*
|
||||
X348604Y165448D02*X349164Y166008D01*
|
||||
X348604Y163368D02*Y165448D01*
|
||||
Y163368D02*X349164Y162808D01*
|
||||
X350204D01*
|
||||
X351164D02*X351564Y163208D01*
|
||||
Y165608D01*
|
||||
X351164Y166008D02*X351564Y165608D01*
|
||||
X353964Y163208D02*X354364Y162808D01*
|
||||
X355564D01*
|
||||
X355964Y163208D01*
|
||||
Y164008D01*
|
||||
X353964Y166008D02*X355964Y164008D01*
|
||||
X353964Y166008D02*X355964D01*
|
||||
X356924Y165608D02*X357324Y166008D01*
|
||||
X356924Y163208D02*Y165608D01*
|
||||
Y163208D02*X357324Y162808D01*
|
||||
X358124D01*
|
||||
X358524Y163208D01*
|
||||
Y165608D01*
|
||||
X358124Y166008D02*X358524Y165608D01*
|
||||
X357324Y166008D02*X358124D01*
|
||||
X356924Y165208D02*X358524Y163608D01*
|
||||
X359484Y163448D02*X360124Y162808D01*
|
||||
Y166008D01*
|
||||
X359484D02*X360684D01*
|
||||
X361644Y165608D02*X362044Y166008D01*
|
||||
X361644Y164968D02*Y165608D01*
|
||||
Y164968D02*X362204Y164408D01*
|
||||
X362684D01*
|
||||
X363244Y164968D01*
|
||||
Y165608D01*
|
||||
X362844Y166008D02*X363244Y165608D01*
|
||||
X362044Y166008D02*X362844D01*
|
||||
X361644Y163848D02*X362204Y164408D01*
|
||||
X361644Y163208D02*Y163848D01*
|
||||
Y163208D02*X362044Y162808D01*
|
||||
X362844D01*
|
||||
X363244Y163208D01*
|
||||
Y163848D01*
|
||||
X362684Y164408D02*X363244Y163848D01*
|
||||
X348450Y169501D02*X348850Y169901D01*
|
||||
X347250Y169501D02*X348450D01*
|
||||
X346850Y169901D02*X347250Y169501D01*
|
||||
X346850Y169901D02*Y170701D01*
|
||||
X347250Y171101D01*
|
||||
X348450D01*
|
||||
X348850Y171501D01*
|
||||
Y172301D01*
|
||||
X348450Y172701D02*X348850Y172301D01*
|
||||
X347250Y172701D02*X348450D01*
|
||||
X346850Y172301D02*X347250Y172701D01*
|
||||
X350210Y169501D02*Y172701D01*
|
||||
X349810Y169501D02*X351410D01*
|
||||
X351810Y169901D01*
|
||||
Y170701D01*
|
||||
X351410Y171101D02*X351810Y170701D01*
|
||||
X350210Y171101D02*X351410D01*
|
||||
X352770Y169501D02*X354370D01*
|
||||
X354770Y169901D01*
|
||||
Y170701D01*
|
||||
X354370Y171101D02*X354770Y170701D01*
|
||||
X353170Y171101D02*X354370D01*
|
||||
X353170Y169501D02*Y172701D01*
|
||||
X353810Y171101D02*X354770Y172701D01*
|
||||
X355730Y169501D02*X356530D01*
|
||||
X356130D02*Y172701D01*
|
||||
X355730D02*X356530D01*
|
||||
X357490Y169501D02*X359090D01*
|
||||
X358290D02*Y172701D01*
|
||||
X360050Y170941D02*X361250D01*
|
||||
X360050Y172701D02*X361650D01*
|
||||
X360050Y169501D02*Y172701D01*
|
||||
Y169501D02*X361650D01*
|
||||
X364210D02*X364610Y169901D01*
|
||||
X363010Y169501D02*X364210D01*
|
||||
X362610Y169901D02*X363010Y169501D01*
|
||||
X362610Y169901D02*Y170701D01*
|
||||
X363010Y171101D01*
|
||||
X364210D01*
|
||||
X364610Y171501D01*
|
||||
Y172301D01*
|
||||
X364210Y172701D02*X364610Y172301D01*
|
||||
X363010Y172701D02*X364210D01*
|
||||
X362610Y172301D02*X363010Y172701D01*
|
||||
X365570Y169501D02*Y172701D01*
|
||||
Y169501D02*X366770Y171101D01*
|
||||
X367970Y169501D01*
|
||||
Y172701D01*
|
||||
X368930Y169901D02*Y172301D01*
|
||||
Y169901D02*X369330Y169501D01*
|
||||
X370130D01*
|
||||
X370530Y169901D01*
|
||||
Y172301D01*
|
||||
X370130Y172701D02*X370530Y172301D01*
|
||||
X369330Y172701D02*X370130D01*
|
||||
X368930Y172301D02*X369330Y172701D01*
|
||||
X371890Y169501D02*Y172701D01*
|
||||
X372930Y169501D02*X373490Y170061D01*
|
||||
Y172141D01*
|
||||
X372930Y172701D02*X373490Y172141D01*
|
||||
X371490Y172701D02*X372930D01*
|
||||
X371490Y169501D02*X372930D01*
|
||||
X376050D02*X376450Y169901D01*
|
||||
X374850Y169501D02*X376050D01*
|
||||
X374450Y169901D02*X374850Y169501D01*
|
||||
X374450Y169901D02*Y170701D01*
|
||||
X374850Y171101D01*
|
||||
X376050D01*
|
||||
X376450Y171501D01*
|
||||
Y172301D01*
|
||||
X376050Y172701D02*X376450Y172301D01*
|
||||
X374850Y172701D02*X376050D01*
|
||||
X374450Y172301D02*X374850Y172701D01*
|
||||
X377410D02*X377810D01*
|
||||
X379330D02*X380370D01*
|
||||
X378770Y172141D02*X379330Y172701D01*
|
||||
X378770Y170061D02*Y172141D01*
|
||||
Y170061D02*X379330Y169501D01*
|
||||
X380370D01*
|
||||
X381330Y169901D02*Y172301D01*
|
||||
Y169901D02*X381730Y169501D01*
|
||||
X382530D01*
|
||||
X382930Y169901D01*
|
||||
Y172301D01*
|
||||
X382530Y172701D02*X382930Y172301D01*
|
||||
X381730Y172701D02*X382530D01*
|
||||
X381330Y172301D02*X381730Y172701D01*
|
||||
X383890Y169501D02*Y172701D01*
|
||||
Y169501D02*X385090Y171101D01*
|
||||
X386290Y169501D01*
|
||||
Y172701D01*
|
||||
M02*
|
1649
pcb/gerber/mac128.fab.gbr
Normal file
1649
pcb/gerber/mac128.fab.gbr
Normal file
File diff suppressed because it is too large
Load Diff
21
pcb/gerber/mac128.outline.gbr
Normal file
21
pcb/gerber/mac128.outline.gbr
Normal file
@ -0,0 +1,21 @@
|
||||
G04 start of page 4 for group 6 idx 6 *
|
||||
G04 Title: (unknown), outline *
|
||||
G04 Creator: pcb 4.0.2 *
|
||||
G04 CreationDate: Sun Feb 4 07:02:53 2018 UTC *
|
||||
G04 For: jeroen *
|
||||
G04 Format: Gerber/RS-274X *
|
||||
G04 PCB-Dimensions (mil): 6000.00 5000.00 *
|
||||
G04 PCB-Coordinate-Origin: lower left *
|
||||
%MOIN*%
|
||||
%FSLAX25Y25*%
|
||||
%LNOUTLINE*%
|
||||
%ADD33C,0.0100*%
|
||||
G54D33*X480315Y157480D02*X342520D01*
|
||||
X480315Y228346D02*X468504D01*
|
||||
Y204724D01*
|
||||
X480315D01*
|
||||
Y157480D02*Y204724D01*
|
||||
X342520Y322835D02*X480315D01*
|
||||
X342520Y157480D02*Y322835D01*
|
||||
X480315Y228346D02*Y322835D01*
|
||||
M02*
|
90
pcb/gerber/mac128.plated-drill.cnc
Normal file
90
pcb/gerber/mac128.plated-drill.cnc
Normal file
@ -0,0 +1,90 @@
|
||||
M48
|
||||
INCH
|
||||
T37C0.035
|
||||
T36C0.020
|
||||
T35C0.038
|
||||
T34C0.012
|
||||
%
|
||||
T34
|
||||
X035000Y019961
|
||||
X035039Y020472
|
||||
X035079Y019449
|
||||
X035118Y021063
|
||||
X035354Y021614
|
||||
X035472Y025079
|
||||
X035748Y022362
|
||||
X035945Y021772
|
||||
X037491Y023589
|
||||
X038150Y022520
|
||||
X038150Y022008
|
||||
X038150Y021496
|
||||
X038661Y022520
|
||||
X038661Y022008
|
||||
X038661Y021496
|
||||
X039173Y022520
|
||||
X039173Y022008
|
||||
X039173Y021496
|
||||
X039302Y029164
|
||||
X040766Y028885
|
||||
X040787Y029331
|
||||
X040925Y021673
|
||||
X042323Y021457
|
||||
X042362Y023937
|
||||
X042638Y026378
|
||||
X042756Y027362
|
||||
X043307Y022441
|
||||
X043307Y021929
|
||||
X043344Y023032
|
||||
X043740Y025945
|
||||
X043858Y020118
|
||||
X044094Y026063
|
||||
X044449Y023819
|
||||
X044685Y027165
|
||||
X044823Y023465
|
||||
X045472Y023740
|
||||
X045512Y024980
|
||||
X045512Y021890
|
||||
X045512Y021496
|
||||
X045630Y018425
|
||||
X045630Y018150
|
||||
X045630Y017874
|
||||
X046131Y026028
|
||||
X047047Y025945
|
||||
T36
|
||||
X035079Y018937
|
||||
X040394Y025630
|
||||
X041299Y018937
|
||||
X042598Y020453
|
||||
X042677Y018701
|
||||
X042776Y016614
|
||||
X042874Y019803
|
||||
X043602Y019154
|
||||
X043681Y017776
|
||||
X043996Y019488
|
||||
X044646Y017677
|
||||
X045079Y020079
|
||||
X046437Y019705
|
||||
X047205Y017126
|
||||
X047224Y016634
|
||||
T37
|
||||
X036732Y028071
|
||||
X040827Y019488
|
||||
X041654Y031437
|
||||
X044764Y031417
|
||||
T35
|
||||
X034811Y031732
|
||||
X034811Y030677
|
||||
X035811Y031732
|
||||
X035811Y030677
|
||||
X036811Y031732
|
||||
X036811Y030677
|
||||
X037811Y031732
|
||||
X037811Y030677
|
||||
X038811Y031732
|
||||
X038811Y030677
|
||||
X039811Y031732
|
||||
X044764Y030610
|
||||
X044764Y029610
|
||||
X046480Y031732
|
||||
X047480Y031732
|
||||
M30
|
1594
pcb/gerber/mac128.top.gbr
Normal file
1594
pcb/gerber/mac128.top.gbr
Normal file
File diff suppressed because it is too large
Load Diff
1151
pcb/gerber/mac128.topmask.gbr
Normal file
1151
pcb/gerber/mac128.topmask.gbr
Normal file
File diff suppressed because it is too large
Load Diff
1111
pcb/gerber/mac128.toppaste.gbr
Normal file
1111
pcb/gerber/mac128.toppaste.gbr
Normal file
File diff suppressed because it is too large
Load Diff
1014
pcb/gerber/mac128.topsilk.gbr
Normal file
1014
pcb/gerber/mac128.topsilk.gbr
Normal file
File diff suppressed because it is too large
Load Diff
1949
pcb/mac128.pcb
Normal file
1949
pcb/mac128.pcb
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user