Merge branch 'main' of gitlab.com:noisy_cricket/cad

This commit is contained in:
Ricardo (XenGi) Band 2023-07-17 10:49:25 +02:00
commit 6b6e93edb6
No known key found for this signature in database
10 changed files with 111 additions and 41 deletions

16
.editorconfig Normal file
View 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

View file

@ -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

View file

@ -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
```
---

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Before After
Before After

View file

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View file

@ -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();
@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

34
upper_case.scad Normal file
View 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);
}

View file

@ -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;
@ -112,3 +113,4 @@ module mx_2x1_cutout() {
translate([-11.9, -0.5, 0]) cube([8, 15, pcb_thickness+0.1], center=true);
}
}