|
| 1 | +// SPDX-FileCopyrightText: 2026 Mummana Jagadeesh |
| 2 | +// SPDX-License-Identifier: Apache-2.0 |
| 3 | +// |
| 4 | +// FIR Accelerator Breakout Board Enclosure |
| 5 | +// PCB dimensions: 60mm x 40mm |
| 6 | +// Designed for FDM 3D printing (PLA/PETG) |
| 7 | + |
| 8 | +// Parameters |
| 9 | +pcb_x = 60; |
| 10 | +pcb_y = 40; |
| 11 | +pcb_z = 1.6; |
| 12 | +wall = 2.0; |
| 13 | +floor = 2.0; |
| 14 | +lid_h = 3.0; |
| 15 | +inner_h = 15.0; // tall enough for connectors/headers |
| 16 | +post_r = 2.0; |
| 17 | +post_h = 3.0; |
| 18 | +screw_r = 1.1; // M2.2 self-tap |
| 19 | + |
| 20 | +// Mounting hole positions (3mm from corners) |
| 21 | +mh_offset = 3.5; |
| 22 | +mh_pos = [ |
| 23 | + [mh_offset, mh_offset ], |
| 24 | + [pcb_x-mh_offset, mh_offset ], |
| 25 | + [mh_offset, pcb_y-mh_offset], |
| 26 | + [pcb_x-mh_offset, pcb_y-mh_offset] |
| 27 | +]; |
| 28 | + |
| 29 | +module mounting_post(h) { |
| 30 | + difference() { |
| 31 | + cylinder(r=post_r, h=h, $fn=20); |
| 32 | + cylinder(r=screw_r, h=h+1, $fn=16); |
| 33 | + } |
| 34 | +} |
| 35 | + |
| 36 | +module base() { |
| 37 | + difference() { |
| 38 | + // Outer shell |
| 39 | + cube([pcb_x + 2*wall, pcb_y + 2*wall, floor + inner_h]); |
| 40 | + // Inner cavity |
| 41 | + translate([wall, wall, floor]) |
| 42 | + cube([pcb_x, pcb_y, inner_h + 1]); |
| 43 | + // GPIO[8] input slot - left side |
| 44 | + translate([0, pcb_y*0.4 + wall - 3, floor + 2]) |
| 45 | + cube([wall + 1, 6, 8]); |
| 46 | + // GPIO[9] output slot - right side |
| 47 | + translate([pcb_x + wall - 0.5, pcb_y*0.6 + wall - 3, floor + 2]) |
| 48 | + cube([wall + 1, 6, 8]); |
| 49 | + // UART header cutout - front |
| 50 | + translate([pcb_x*0.4 + wall - 5, 0, floor + 4]) |
| 51 | + cube([10, wall + 1, 8]); |
| 52 | + // Power connector cutout - back |
| 53 | + translate([pcb_x*0.4 + wall - 4, pcb_y + wall - 0.5, floor + 4]) |
| 54 | + cube([8, wall + 1, 8]); |
| 55 | + } |
| 56 | + // Mounting posts |
| 57 | + for (p = mh_pos) { |
| 58 | + translate([p[0] + wall, p[1] + wall, floor]) |
| 59 | + mounting_post(post_h); |
| 60 | + } |
| 61 | +} |
| 62 | + |
| 63 | +module lid() { |
| 64 | + difference() { |
| 65 | + cube([pcb_x + 2*wall, pcb_y + 2*wall, lid_h]); |
| 66 | + // Label recess |
| 67 | + translate([wall + 5, wall + 5, lid_h - 0.8]) |
| 68 | + linear_extrude(1) |
| 69 | + text("FIR SoC", size=5, font="Liberation Sans:style=Bold"); |
| 70 | + // Ventilation slots |
| 71 | + for (i = [0:3]) { |
| 72 | + translate([wall + 8 + i*12, wall + pcb_y/2 - 5, -0.1]) |
| 73 | + cube([6, 10, lid_h + 0.2]); |
| 74 | + } |
| 75 | + } |
| 76 | +} |
| 77 | + |
| 78 | +// Render base by default |
| 79 | +// Use: openscad -D 'part="lid"' to render lid |
| 80 | +part = "base"; // override with -D 'part="lid"' |
| 81 | + |
| 82 | +if (part == "base") { |
| 83 | + base(); |
| 84 | +} else if (part == "lid") { |
| 85 | + lid(); |
| 86 | +} else { |
| 87 | + // Show both for preview |
| 88 | + base(); |
| 89 | + translate([0, pcb_y + 2*wall + 5, 0]) |
| 90 | + lid(); |
| 91 | +} |
0 commit comments