Skip to content

Instantly share code, notes, and snippets.

@patmood
Created July 16, 2026 00:08
Show Gist options
  • Select an option

  • Save patmood/8927e5b189f85986560ca1710e289dc9 to your computer and use it in GitHub Desktop.

Select an option

Save patmood/8927e5b189f85986560ca1710e289dc9 to your computer and use it in GitHub Desktop.
[fiddlecad] B550M-C Motherboard IO Shield
// ============================================================
// Parametric Motherboard I/O Shield — Gigabyte B550M-C style
// ============================================================
/* [Overall Dimensions] */
// Outer width (ATX standard ≈ 158.75)
width = 158.75; // [120:0.25:180]
// Outer height (ATX standard ≈ 44.45)
height = 44.45; // [35:0.25:55]
// Face plate thickness
thickness = 0.8; // [0.5:0.1:1.5]
// Depth of the folded mounting flanges
flange_depth = 6; // [3:0.5:12]
// Flange wall thickness
flange_thickness = 0.8; // [0.4:0.1:1.5]
// Outer corner radius
corner_r = 1.2; // [0:0.2:3]
// Inset of the dark face panel from the outer flange lip
face_inset = 1.8; // [0.5:0.1:4]
/* [Port sizing] */
// USB Type-A cutout width
usb_w = 14; // [10:0.5:18]
// USB Type-A cutout height
usb_h = 6.2; // [4:0.5:9]
// Generic rectangle corner radius (cutouts)
rect_r = 0.7; // [0:0.1:2]
// Circle fragments
$fn = 64;
/* [Left section] */
// Show VGA / D-Sub silhouette
show_vga = true;
vga_w = 17.5; // [12:0.5:28]
vga_h = 8.5; // [6:0.5:14]
// X from left of face (center)
vga_x = 12; // [6:0.5:30]
vga_y = 9.5; // [5:0.5:25]
// Stacked USB (top-left)
show_usb_stack = true;
usb_stack_x = 27; // [15:0.5:50]
// Y of the gap between the two USBs
usb_stack_mid_y = 29; // [18:0.5:40]
usb_stack_gap = 2.2; // [0.5:0.5:6]
// Large circular hole under USBs
show_ps2 = true;
ps2_d = 14.5; // [8:0.5:22]
ps2_x = 27; // [15:0.5:50]
ps2_y = 10.5; // [5:0.5:25]
/* [Mid-left double rect] */
show_display_out = true;
// Often HDMI / DP pair
disp_w = 13; // [8:0.5:20]
disp_h = 5.8; // [3:0.5:10]
disp_x = 46; // [30:0.5:70]
disp_mid_y = 16; // [8:0.5:35]
disp_gap = 2.2; // [0.5:0.5:6]
/* [Center USB + LAN stack] */
show_center = true;
// Top / mid USB-style
cen_usb_w = 14; // [10:0.5:18]
cen_usb_h = 6.5; // [4:0.5:10]
// Bottom (RJ-45 LAN typically taller)
cen_lan_w = 15.5; // [12:0.5:22]
cen_lan_h = 12; // [8:0.5:18]
cen_gap = 1.6; // [0.5:0.5:5]
cen_x = 70; // [50:0.5:100]
// Y of midpoint of the three-stack
cen_mid_y = 22; // [12:0.5:35]
/* [Audio optical pair / SPDIF] */
show_circles = true;
c_d = 9.5; // [5:0.5:16]
c_x = 95; // [70:0.5:120]
// Y of gap between the two circles
c_mid_y = 26; // [12:0.5:38]
c_pitch = 12.5; // [8:0.5:20]
/* [Right mixed rects] */
show_right_rects = true;
// Upper horizontal slot
rr_slot_w = 15; // [8:0.5:24]
rr_slot_h = 5.5; // [3:0.5:10]
rr_slot_x = 115; // [90:0.5:140]
rr_slot_y = 28.5; // [15:0.5:40]
// Two lower stacked rects
rr_w = 12; // [6:0.5:18]
rr_h = 5.5; // [3:0.5:10]
rr_x = 115; // [90:0.5:140]
rr_mid_y = 13; // [6:0.5:28]
rr_gap = 2; // [0.5:0.5:5]
/* [Far-right audio jacks] */
show_audio = true;
// Number of stacked 3.5mm jacks
audio_n = 4; // [2:1:6]
audio_d = 7.8; // [4:0.5:12]
audio_x = 139; // [110:0.5:155]
// Y of lowest jack center
audio_y0 = 8; // [4:0.5:18]
// Pitch between jack centers
audio_pitch = 8.8; // [5:0.5:14]
/* [Label text] */
show_label = true;
label_text = "B550M-C";
label_size = 3.5; // [2:0.1:8]
// Depth of debossed label
label_depth = 0.3; // [0.05:0.05:0.8]
label_x = 8; // [2:0.5:40]
label_y = 32; // [15:0.5:42]
// ============================================================
// Derived
// ============================================================
face_w = width - 2 * face_inset;
face_h = height - 2 * face_inset;
// ============================================================
// Primitives
// ============================================================
module round_rect_2d(w, h, r) {
r2 = min(r, w / 2 - 0.01, h / 2 - 0.01);
if (r2 <= 0)
square([w, h], center = true);
else
offset(r = r2)
offset(r = -r2)
square([w, h], center = true);
}
module rounded_box(w, h, t, r) {
linear_extrude(t)
round_rect_2d(w, h, r);
}
// VGA / D-Sub silhouette (truncated hexagon)
module vga_2d(w, h) {
// Classic D-sub silhouette — flat top/bottom with tapered sides
chamfer = min(2.2, h * 0.35);
ster = min(1.4, w * 0.08);
polygon([
[-w/2 + ster, -h/2],
[ w/2 - ster, -h/2],
[ w/2, -h/2 + chamfer],
[ w/2, h/2 - chamfer],
[ w/2 - ster, h/2],
[-w/2 + ster, h/2],
[-w/2, h/2 - chamfer],
[-w/2, -h/2 + chamfer]
]);
}
// ============================================================
// Face cutouts. Origin at face bottom-left; Z upward through plate.
// ============================================================
module face_ports() {
// USB stack
if (show_usb_stack) {
translate([usb_stack_x, usb_stack_mid_y + usb_stack_gap/2 + usb_h/2, 0])
linear_extrude(thickness + 2)
round_rect_2d(usb_w, usb_h, rect_r);
translate([usb_stack_x, usb_stack_mid_y - usb_stack_gap/2 - usb_h/2, 0])
linear_extrude(thickness + 2)
round_rect_2d(usb_w, usb_h, rect_r);
}
// PS/2 / large circle under stack
if (show_ps2)
translate([ps2_x, ps2_y, 0])
cylinder(h = thickness + 2, d = ps2_d);
// VGA silhouette
if (show_vga)
translate([vga_x, vga_y, 0])
linear_extrude(thickness + 2)
vga_2d(vga_w, vga_h);
// Display outs (double rect)
if (show_display_out) {
translate([disp_x, disp_mid_y + disp_gap/2 + disp_h/2, 0])
linear_extrude(thickness + 2)
round_rect_2d(disp_w, disp_h, rect_r);
translate([disp_x, disp_mid_y - disp_gap/2 - disp_h/2, 0])
linear_extrude(thickness + 2)
round_rect_2d(disp_w, disp_h, rect_r);
}
// Center USB/USB/LAN
if (show_center) {
stack_h = cen_usb_h * 2 + cen_lan_h + 2 * cen_gap;
y0 = cen_mid_y - stack_h / 2;
// LAN bottom
translate([cen_x, y0 + cen_lan_h / 2, 0])
linear_extrude(thickness + 2)
round_rect_2d(cen_lan_w, cen_lan_h, rect_r + 0.2);
// middle USB
translate([cen_x, y0 + cen_lan_h + cen_gap + cen_usb_h / 2, 0])
linear_extrude(thickness + 2)
round_rect_2d(cen_usb_w, cen_usb_h, rect_r);
// top USB
translate([cen_x, y0 + cen_lan_h + cen_gap + cen_usb_h + cen_gap + cen_usb_h / 2, 0])
linear_extrude(thickness + 2)
round_rect_2d(cen_usb_w, cen_usb_h, rect_r);
}
// Circle pair
if (show_circles) {
translate([c_x, c_mid_y + c_pitch / 2, 0])
cylinder(h = thickness + 2, d = c_d);
translate([c_x, c_mid_y - c_pitch / 2, 0])
cylinder(h = thickness + 2, d = c_d);
}
// Right rects
if (show_right_rects) {
translate([rr_slot_x, rr_slot_y, 0])
linear_extrude(thickness + 2)
round_rect_2d(rr_slot_w, rr_slot_h, rect_r + 0.4);
translate([rr_x, rr_mid_y + rr_gap/2 + rr_h/2, 0])
linear_extrude(thickness + 2)
round_rect_2d(rr_w, rr_h, rect_r);
translate([rr_x, rr_mid_y - rr_gap/2 - rr_h/2, 0])
linear_extrude(thickness + 2)
round_rect_2d(rr_w, rr_h, rect_r);
}
// Audio jacks
if (show_audio) {
for (i = [0 : audio_n - 1]) {
translate([audio_x, audio_y0 + i * audio_pitch, 0])
cylinder(h = thickness + 2, d = audio_d);
}
}
// Debossed label (as a shallow cut from front)
if (show_label) {
translate([label_x, label_y, thickness - label_depth])
linear_extrude(label_depth + 0.1)
text(label_text, size = label_size,
font = "Liberation Sans:style=Bold",
valign = "center", halign = "left", $fn = 24);
}
}
// ============================================================
// Body: face plate + 4-sided flange
// ============================================================
module flange_frame() {
// Outer wall of flange
difference() {
// outer
translate([0, 0, -flange_depth])
rounded_box(width, height, flange_depth + thickness * 0.5, corner_r);
// hollow out interior
translate([0, 0, -flange_depth - 0.1])
rounded_box(
width - 2 * flange_thickness,
height - 2 * flange_thickness,
flange_depth + 0.2,
max(0.1, corner_r - flange_thickness)
);
// open the front (keep only the flange “walls”)
// keep a thin rim
translate([0, 0, -0.05])
rounded_box(
face_w,
face_h,
thickness + 0.2,
max(0.1, corner_r - face_inset)
);
}
}
module face_plate() {
rounded_box(face_w, face_h, thickness, max(0.1, corner_r - face_inset * 0.4));
}
module io_shield() {
difference() {
union() {
flange_frame();
// Face plate sits flush at Z = 0 (front)
face_plate();
}
// Cut ports through face (origin shifted to face bottom-left)
translate([-face_w / 2, -face_h / 2, -0.5])
face_ports();
}
}
// Render — brushed metal look
color([0.75, 0.76, 0.78])
io_shield();
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment