Model parts #50

Merged
ede1998 merged 5 commits from model-parts into main 2026-08-29 23:13:54 +02:00
Showing only changes of commit 0f4d19f37b - Show all commits
+76 -11
View File
@@ -5,9 +5,73 @@ BASE_MODEL_TRANSLATE = [-0.4, 0, 16.978];
EPS = 0.01;
$fn = 50;
module main_display() {
// Outer dimensions, height currently unknown
cube([55.04, 89.3, 10]);
module pin_header(cols = 4, rows = 1, anchor = BOTTOM, spin = 0, orient = UP) {
// Standard pin header dimensions (in mm)
base_height = 2.54; // Height of the plastic base
pin_width = 0.64; // Width/thickness of the square pin
pin_length = 6.0; // Length of pin sticking up
pitch = 2.54;
// 1. The Plastic Base is the Parent
// It directly receives your anchor, spin, and orient arguments.
color("darkgrey")
cuboid([cols * pitch, rows * pitch, base_height], anchor=anchor, spin=spin, orient=orient) {
// 2. Metal Pins are the Children
// Placed relative to the center of the plastic base
color("silver")
xcopies(spacing=pitch, n=cols) {
ycopies(spacing=pitch, n=rows) {
up(base_height / 2)
cuboid([pin_width, pin_width, pin_length], anchor=BOTTOM);
}
}
// Allows attaching other objects to this header if needed
children();
}
}
module main_display(pin_header = false) {
// Outer dimensions
width = 55.04;
length = 89.35;
height = 2.7;
display_height = 3;
display_length = 77.6;
display_inset = 5.7;
sd_width = 26.6;
sd_height = 3;
sd_length = 16.6;
sd_inset = 29.4;
hole_diameter = 3;
hole_inset = 1.5;
difference() {
cuboid([length, width, height]) {
position(TOP + RIGHT)
left(display_inset)
color("black")
cuboid([display_length, width, display_height], anchor=BOTTOM + RIGHT);
position(BOTTOM + RIGHT + FRONT)
left(sd_inset)
cuboid([sd_width, sd_length, sd_height], anchor=TOP + RIGHT + FRONT);
position(TOP + LEFT)
pin_header(14, spin=90, anchor=BOTTOM + BACK);
// pin_header();
}
xcopies(length - (2 * hole_inset) - hole_diameter) {
ycopies(width - (2 * hole_inset) - hole_diameter) {
zcyl(d=hole_diameter, h=height + EPS);
}
}
}
}
module pad() {
@@ -21,20 +85,21 @@ module secondary_display(pin_header = false) {
width = 20;
height = 3.7;
pins_height = 11.3;
pins_width = 2.5; // width of socket, not pin
hole_diameter = 2;
hole_inset = 1.5;
difference() {
cube([length, width, height]) if (pin_header)
position(LEFT + FRONT)
cube([pins_width, width, pins_height]);
cuboid([length, width, height]) {
if (pin_header)
position(LEFT + TOP)
pin_header(7, spin=90, anchor=BACK + BOTTOM);
}
move([length - hole_inset, width / 2, height / 2]) ycopies(width - (2 * hole_inset) - hole_diameter) {
cyl(d=hole_diameter, h=height + EPS, orient=UP, anchor=RIGHT);
right(length / 2 - hole_inset) {
ycopies(width - (2 * hole_inset) - hole_diameter) {
zcyl(d=hole_diameter, h=height + EPS, anchor=RIGHT);
}
}
}
}