diff --git a/Makefile b/Makefile index c5882a2..b8c55fa 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,12 @@ -.PHONY: render +.PHONY: stl 3mf -render: +stl: + openscad --export-format binstl -o upper_case.stl upper_case.scad openscad --export-format binstl -o lower_case.stl lower_case.scad - openscad --export-format 3mf -o lower_case.3mf lower_case.scad openscad --export-format binstl -o plate.stl plate.scad + +3mf: + openscad --export-format 3mf -o upper_case.3mf upper_case.scad + openscad --export-format 3mf -o lower_case.3mf lower_case.scad openscad --export-format 3mf -o plate.3mf plate.scad + diff --git a/README.md b/README.md index 249220e..ebde626 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,15 @@ +![upper case](https://gitlab.com/noisy_cricket/cad/-/raw/main/upper_case.png?inline=false) +![plate](https://gitlab.com/noisy_cricket/cad/-/raw/main/plate.png?inline=false) ![lower case](https://gitlab.com/noisy_cricket/cad/-/raw/main/lower_case.png?inline=false) CAD files for noisy cricket =========================== -Create stl and 3mf files for lower case and plate files by running (needs openscad): +Create files for 3D printing or CNC by running this (needs openscad): ```shell -make render +make stl +make 3mf ``` --- diff --git a/lower_case.png b/lower_case.png index 176d149..0bdca14 100644 Binary files a/lower_case.png and b/lower_case.png differ diff --git a/lower_case.scad b/lower_case.scad index cbe3cfc..5d47f20 100644 --- a/lower_case.scad +++ b/lower_case.scad @@ -4,7 +4,7 @@ include $fn = 64; -difference() { +color("SaddleBrown") difference() { // case hull() { translate([-case_thickness, -case_thickness, 0]) cylinder(h=case_thickness+standoff_height+pcb_thickness+5, r=pcb_radius); @@ -43,10 +43,21 @@ difference() { translate([-pololu_width/2+pololu_hole_spacing, pololu_depth/2-pololu_hole_spacing, -pcb_thickness/2-2]) cylinder(h=2, r=pololu_holes_radius); translate([pololu_width/2-pololu_hole_spacing, pololu_depth/2-pololu_hole_spacing, -pcb_thickness/2-2]) cylinder(h=2, r=pololu_holes_radius); } + + // screw holes for upper case + translate([-case_thickness, -case_thickness, 0]) cylinder(h=2, d=4); + translate([pcb_width-2*pcb_radius+case_thickness, -case_thickness, 0]) cylinder(h=2, d=4); + translate([-case_thickness, pcb_depth-2*pcb_radius+case_thickness, 0]) cylinder(h=2, d=4); + translate([pcb_width-2*pcb_radius+case_thickness, pcb_depth-2*pcb_radius+case_thickness, 0]) cylinder(h=2, d=4); + + translate([-case_thickness, -case_thickness, 0]) cylinder(h=case_thickness+standoff_height+pcb_thickness+5, d=2); + translate([pcb_width-2*pcb_radius+case_thickness, -case_thickness, 0]) cylinder(h=case_thickness+standoff_height+pcb_thickness+5, d=2); + translate([-case_thickness, pcb_depth-2*pcb_radius+case_thickness, 0]) cylinder(h=case_thickness+standoff_height+pcb_thickness+5, d=2); + translate([pcb_width-2*pcb_radius+case_thickness, pcb_depth-2*pcb_radius+case_thickness, 0]) cylinder(h=case_thickness+standoff_height+pcb_thickness+5, d=2); } // mounting standoffs -for(i = [0 : len(mounting_holes)-1]) { +color("SaddleBrown") for(i = [0 : len(mounting_holes)-1]) { translate([mounting_holes[i][0] - pcb_radius, mounting_holes[i][1] - pcb_radius, case_bottom_thickness]) difference() { cylinder(h=standoff_height, d=4); cylinder(h=standoff_height, d=2); diff --git a/plate.png b/plate.png new file mode 100644 index 0000000..512ec8c Binary files /dev/null and b/plate.png differ diff --git a/plate.scad b/plate.scad index 766c1ce..c48fbd1 100644 --- a/plate.scad +++ b/plate.scad @@ -4,24 +4,22 @@ include $fn = 64; -module plate() { - hull() { - cylinder(h=plate_thickness, r=pcb_radius); - translate([pcb_width-2*pcb_radius, 0, 0]) cylinder(h=plate_thickness, r=pcb_radius); - translate([0, pcb_depth-2*pcb_radius, 0]) cylinder(h=plate_thickness, r=pcb_radius); - translate([pcb_width-2*pcb_radius, pcb_depth-2*pcb_radius, 0]) cylinder(h=plate_thickness, r=pcb_radius); +// projection(cut=true) +color("Gold") difference() { + union() { + hull() { + cylinder(h=plate_thickness, r=pcb_radius); + translate([pcb_width-2*pcb_radius, 0, 0]) cylinder(h=plate_thickness, r=pcb_radius); + translate([0, pcb_depth-2*pcb_radius, 0]) cylinder(h=plate_thickness, r=pcb_radius); + translate([pcb_width-2*pcb_radius, pcb_depth-2*pcb_radius, 0]) cylinder(h=plate_thickness, r=pcb_radius); + } + + translate([20, pcb_depth - pcb_radius, 0]) lug(); + translate([pcb_width-2*pcb_radius - 20, pcb_depth - pcb_radius, 0]) lug(); + translate([20, -pcb_radius, 0]) lug(north_facing=false); + translate([pcb_width-2*pcb_radius - 20, -pcb_radius, 0]) lug(north_facing=false); } - - translate([20, pcb_depth - pcb_radius, 0]) lug(); - translate([pcb_width-2*pcb_radius - 20, pcb_depth - pcb_radius, 0]) lug(); - translate([20, -pcb_radius, 0]) lug(north_facing=false); - translate([pcb_width-2*pcb_radius - 20, -pcb_radius, 0]) lug(north_facing=false); -} - -// projection(cut=true) -difference() { - color("gold") plate(); translate([12.7-pcb_radius, 12.7-pcb_radius, 0]) { mx_1x1_cutout(); translate([mx, 0, 0]) mx_1x1_cutout(); diff --git a/upper_case.png b/upper_case.png new file mode 100644 index 0000000..396e53a Binary files /dev/null and b/upper_case.png differ diff --git a/upper_case.scad b/upper_case.scad new file mode 100644 index 0000000..be13da7 --- /dev/null +++ b/upper_case.scad @@ -0,0 +1,34 @@ +// This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. + +include + +$fn = 64; + +color("SaddleBrown") difference() { + // case + hull() { + translate([-case_thickness, -case_thickness, 0]) cylinder(h=upper_case_height, r=pcb_radius); + translate([pcb_width-2*pcb_radius+case_thickness, -case_thickness, 0]) cylinder(h=upper_case_height, r=pcb_radius); + translate([-case_thickness, pcb_depth-2*pcb_radius+case_thickness, 0]) cylinder(h=upper_case_height, r=pcb_radius); + translate([pcb_width-2*pcb_radius+case_thickness, pcb_depth-2*pcb_radius+case_thickness, 0]) cylinder(h=upper_case_height, r=pcb_radius); + } + + // pcb + hull() { + cylinder(h=upper_case_height+0.1, r=pcb_radius); + translate([pcb_width-2*pcb_radius, 0, 0]) cylinder(h=upper_case_height+0.1, r=pcb_radius); + translate([0, pcb_depth-2*pcb_radius, 0]) cylinder(h=upper_case_height+0.1, r=pcb_radius); + translate([pcb_width-2*pcb_radius, pcb_depth-2*pcb_radius, 0]) cylinder(h=upper_case_height+0.1, r=pcb_radius); + } + + // threaded inserts + translate([-case_thickness, -case_thickness, 0]) cylinder(h=3, d=3); + translate([pcb_width-2*pcb_radius+case_thickness, -case_thickness, 0]) cylinder(h=3, d=3); + translate([-case_thickness, pcb_depth-2*pcb_radius+case_thickness, 0]) cylinder(h=3, d=3); + translate([pcb_width-2*pcb_radius+case_thickness, pcb_depth-2*pcb_radius+case_thickness, 0]) cylinder(h=3, d=3); + + translate([20, pcb_depth - pcb_radius, 0]) lug(hole=false); + translate([pcb_width-2*pcb_radius - 20, pcb_depth - pcb_radius, 0]) lug(hole=false); + translate([20, -pcb_radius, 0]) lug(north_facing=false, hole=false); + translate([pcb_width-2*pcb_radius - 20, -pcb_radius, 0]) lug(north_facing=false, hole=false); +} diff --git a/util.scad b/util.scad index 7a5cee4..d8dcf7a 100644 --- a/util.scad +++ b/util.scad @@ -12,6 +12,7 @@ plate_thickness = 1.5; case_thickness = 5; case_bottom_thickness = 5; case_height = 10; +upper_case_height = 5; standoff_height = 3;