Merge branch 'main' of gitlab.com:noisy_cricket/cad
This commit is contained in:
commit
6b6e93edb6
10 changed files with 111 additions and 41 deletions
16
.editorconfig
Normal file
16
.editorconfig
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*.scad]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[Makefile]
|
||||
end_of_line = lf
|
||||
indent_style = tab
|
||||
|
||||
11
Makefile
11
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
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,15 @@
|
|||

|
||||

|
||||

|
||||
|
||||
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
|
||||
```
|
||||
|
||||
---
|
||||
|
|
|
|||
BIN
lower_case.png
BIN
lower_case.png
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 33 KiB |
|
|
@ -4,7 +4,7 @@ include <util.scad>
|
|||
|
||||
$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);
|
||||
|
|
|
|||
BIN
plate.png
Normal file
BIN
plate.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 46 KiB |
37
plate.scad
37
plate.scad
|
|
@ -4,24 +4,22 @@ include <util.scad>
|
|||
|
||||
$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();
|
||||
|
|
@ -29,7 +27,7 @@ difference() {
|
|||
translate([3*mx, 0, 0]) mx_1x1_cutout();
|
||||
translate([4.5*mx, 0, 0]) mx_2x1_cutout();
|
||||
translate([4.5*mx, 0, 0]) mx_1x1_cutout();
|
||||
|
||||
|
||||
translate([(mx*1.75)/2-mx/2, mx, 0]) mx_1x1_cutout();
|
||||
translate([mx*1.75-mx, mx, 0]) {
|
||||
translate([mx, 0, 0]) mx_1x1_cutout();
|
||||
|
|
@ -38,7 +36,7 @@ difference() {
|
|||
translate([4*mx, 0, 0]) mx_1x1_cutout();
|
||||
translate([4*mx+21.4312, 9.525, 0]) mx_1x2_cutout();
|
||||
};
|
||||
|
||||
|
||||
translate([(mx*1.5)/2-mx/2, 2*mx, 0]) mx_1x1_cutout();
|
||||
translate([(mx*1.5)-mx, 2*mx, 0]) {
|
||||
translate([mx, 0, 0]) mx_1x1_cutout();
|
||||
|
|
@ -46,7 +44,7 @@ difference() {
|
|||
translate([3*mx, 0, 0]) mx_1x1_cutout();
|
||||
translate([4*mx, 0, 0]) mx_1x1_cutout();
|
||||
};
|
||||
|
||||
|
||||
translate([0, 3*mx, 0]) {
|
||||
mx_1x1_cutout();
|
||||
translate([mx, 0, 0]) mx_1x1_cutout();
|
||||
|
|
@ -60,3 +58,4 @@ difference() {
|
|||
// potentiometer
|
||||
translate([127-pcb_radius, 12.45-pcb_radius, plate_thickness/2]) cube([13, 13, plate_thickness], center=true);
|
||||
};
|
||||
|
||||
|
|
|
|||
BIN
upper_case.png
Normal file
BIN
upper_case.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
34
upper_case.scad
Normal file
34
upper_case.scad
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
// This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
|
||||
|
||||
include <util.scad>
|
||||
|
||||
$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);
|
||||
}
|
||||
32
util.scad
32
util.scad
|
|
@ -2,16 +2,17 @@
|
|||
|
||||
$fn=64;
|
||||
|
||||
pcb_width = 139.7;
|
||||
pcb_depth = 82.55;
|
||||
pcb_width = 139.7+1;
|
||||
pcb_depth = 82.55+1;
|
||||
pcb_radius = 3.175;
|
||||
pcb_thickness = 1.6;
|
||||
|
||||
plate_thickness = 1.5;
|
||||
|
||||
case_thickness = 5;
|
||||
case_bottom_thickness = 5;
|
||||
case_bottom_thickness = 5; // TODO: doesn't respect height of PCB plus switches etc
|
||||
case_height = 10;
|
||||
upper_case_height = 5;
|
||||
|
||||
standoff_height = 3;
|
||||
|
||||
|
|
@ -45,42 +46,42 @@ module lug(north_facing=true, hole=true) {
|
|||
|
||||
module mx_1x1_cutout() {
|
||||
side_length = 14;
|
||||
|
||||
|
||||
// central hole
|
||||
translate([0, 0, pcb_thickness/2]) cube([side_length, side_length, pcb_thickness+0.1], center=true);
|
||||
|
||||
|
||||
// wings
|
||||
translate([side_length/2, 2.5+3.5/2, pcb_thickness/2]) cube([2*0.8, 3.5, pcb_thickness+0.1], center=true);
|
||||
translate([side_length/2, -2.5-3.5/2, pcb_thickness/2]) cube([2*0.8, 3.5, pcb_thickness+0.1], center=true);
|
||||
translate([-side_length/2, 2.5+3.5/2, pcb_thickness/2]) cube([2*0.8, 3.5, pcb_thickness+0.1], center=true);
|
||||
translate([-side_length/2, -2.5-3.5/2, pcb_thickness/2]) cube([2*0.8, 3.5, pcb_thickness+0.1], center=true);
|
||||
|
||||
|
||||
// rounded corners
|
||||
translate([side_length/2-0.25, side_length/2-0.25, 0]) cylinder(h=pcb_thickness+0.1, r=0.5);
|
||||
translate([side_length/2-0.25, -side_length/2+0.25, 0]) cylinder(h=pcb_thickness+0.1, r=0.5);
|
||||
translate([-side_length/2+0.25, side_length/2-0.25, 0]) cylinder(h=pcb_thickness+0.1, r=0.5);
|
||||
translate([-side_length/2+0.25, -side_length/2+0.25, 0]) cylinder(h=pcb_thickness+0.1, r=0.5);
|
||||
|
||||
|
||||
}
|
||||
|
||||
module mx_1x2_cutout() {
|
||||
side_length = 14;
|
||||
|
||||
|
||||
// central hole
|
||||
translate([0, 0, pcb_thickness/2]) cube([side_length, side_length+2, pcb_thickness+0.1], center=true);
|
||||
|
||||
|
||||
// wings
|
||||
translate([side_length/2, 2.5+3.5/2, pcb_thickness/2]) cube([2*0.8, 3.5, pcb_thickness+0.1], center=true);
|
||||
translate([side_length/2, -2.5-3.5/2, pcb_thickness/2]) cube([2*0.8, 3.5, pcb_thickness+0.1], center=true);
|
||||
translate([-side_length/2, 2.5+3.5/2, pcb_thickness/2]) cube([2*0.8, 3.5, pcb_thickness+0.1], center=true);
|
||||
translate([-side_length/2, -2.5-3.5/2, pcb_thickness/2]) cube([2*0.8, 3.5, pcb_thickness+0.1], center=true);
|
||||
|
||||
|
||||
// rounded corners
|
||||
translate([side_length/2-0.25, side_length/2-0.25, 0]) cylinder(h=pcb_thickness+0.1, r=0.5);
|
||||
translate([side_length/2-0.25, -side_length/2+0.25, 0]) cylinder(h=pcb_thickness+0.1, r=0.5);
|
||||
translate([-side_length/2+0.25, side_length/2-0.25, 0]) cylinder(h=pcb_thickness+0.1, r=0.5);
|
||||
translate([-side_length/2+0.25, -side_length/2+0.25, 0]) cylinder(h=pcb_thickness+0.1, r=0.5);
|
||||
|
||||
|
||||
// stabilizers
|
||||
translate([0, 0, pcb_thickness/2]) {
|
||||
translate([-0.5, 11.9, 0]) cube([15, 8, pcb_thickness+0.1], center=true);
|
||||
|
|
@ -90,25 +91,26 @@ module mx_1x2_cutout() {
|
|||
|
||||
module mx_2x1_cutout() {
|
||||
side_length = 14;
|
||||
|
||||
|
||||
// central hole
|
||||
translate([0, 0, pcb_thickness/2]) cube([side_length+2, side_length, pcb_thickness+0.1], center=true);
|
||||
|
||||
|
||||
// wings
|
||||
translate([side_length/2, 2.5+3.5/2, pcb_thickness/2]) cube([2*0.8, 3.5, pcb_thickness+0.1], center=true);
|
||||
translate([side_length/2, -2.5-3.5/2, pcb_thickness/2]) cube([2*0.8, 3.5, pcb_thickness+0.1], center=true);
|
||||
translate([-side_length/2, 2.5+3.5/2, pcb_thickness/2]) cube([2*0.8, 3.5, pcb_thickness+0.1], center=true);
|
||||
translate([-side_length/2, -2.5-3.5/2, pcb_thickness/2]) cube([2*0.8, 3.5, pcb_thickness+0.1], center=true);
|
||||
|
||||
|
||||
// rounded corners
|
||||
translate([side_length/2-0.25, side_length/2-0.25, 0]) cylinder(h=pcb_thickness+0.1, r=0.5);
|
||||
translate([side_length/2-0.25, -side_length/2+0.25, 0]) cylinder(h=pcb_thickness+0.1, r=0.5);
|
||||
translate([-side_length/2+0.25, side_length/2-0.25, 0]) cylinder(h=pcb_thickness+0.1, r=0.5);
|
||||
translate([-side_length/2+0.25, -side_length/2+0.25, 0]) cylinder(h=pcb_thickness+0.1, r=0.5);
|
||||
|
||||
|
||||
// stabilizer holes
|
||||
translate([0, 0, pcb_thickness/2]) {
|
||||
translate([11.9, -0.5, 0]) cube([8, 15, pcb_thickness+0.1], center=true);
|
||||
translate([-11.9, -0.5, 0]) cube([8, 15, pcb_thickness+0.1], center=true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue