From cb6cf91660f6cff67d35592e206c043e106d70a7 Mon Sep 17 00:00:00 2001 From: "dingfeng.wong" Date: Tue, 22 Jul 2025 00:40:03 +0800 Subject: [PATCH] a --- pcie.scad | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/pcie.scad b/pcie.scad index d5c6d16..cfad590 100644 --- a/pcie.scad +++ b/pcie.scad @@ -4,6 +4,9 @@ // Import PCIe holder functionality include ; +// Import hexagon functionality for M3 nut holes +include ; + // Trapezium module - creates a centralized trapezoid shape (2D) // Parameters: // base_width: width of the bottom edge @@ -62,17 +65,34 @@ module trapezium_with_rectangle_2d( //trapezium_2d(base_width = 20, top_width = 10, height = 15); //translate([30, 0]) rectangle_2d(width = 8, height = 5); -// Combined shape extruded to 3D: +// Combined shape extruded to 3D with M3 nut hole: rect_height_val = 1.7; extrude_height = 15; -linear_extrude(height = extrude_height) { - trapezium_with_rectangle_2d( - trap_base_width = 10.95, - trap_top_width = 5.5, - trap_height = 4.0, - rect_width = 6.3, - rect_height = rect_height_val, - rect_offset = -rect_height_val/2 // Half of rectangle height to center it at base edge - ); +difference() { + // Main extruded shape + linear_extrude(height = extrude_height) { + trapezium_with_rectangle_2d( + trap_base_width = 10.95, + trap_top_width = 5.5, + trap_height = 4.0, + rect_width = 6.3, + rect_height = rect_height_val, + rect_offset = -rect_height_val/2 // Half of rectangle height to center it at base edge + ); + } + + // M3 nut hole on top face of trapezium (extended outward for clean cut) + translate([0, 4.0/2 + (m3_nut_height + 2)/2, extrude_height/2]) { + rotate([90, 0, 0]) { + hexagon_3d(m3_nut_width, m3_nut_height + 2); // Extra height for clean cut + } + } + + // M3 bolt hole through entire trapezium + translate([0, 4.0/2, extrude_height/2]) { + rotate([90, 0, 0]) { + cylinder(h = 20, d = 3.2, center = true, $fn = 32); // Long M3 clearance hole + } + } } \ No newline at end of file