$fn = 64; // --- Parameters --- // Designed for standard 1-inch pegboard (1/4" holes) peg_spacing = 25.4; // Standard 1-inch pegboard spacing peg_diameter = 5.8; // Fits standard 1/4-inch (6.35mm) holes board_thickness = 5.0; // Pegboard thickness base_width = 16.0; // Width of the mounting plate base_thickness = 8.0; // Total thickness of the front block // Mounting Interface Parameters hole_diameter = 3.4; // M3 screw hole (with tolerance) nut_width_flats = 6.0; // M3 hex nut width across flats (with tolerance) nut_depth = 3.0; // Depth for captured nut module pegboard_mount() { difference() { union() { // Main Base Block hull() { translate([0, 0, 0]) cylinder(d=base_width, h=base_thickness); translate([0, -peg_spacing, 0]) cylinder(d=base_width, h=base_thickness); } // Top Locking Peg (Shaft) translate([0, 0, -board_thickness - peg_diameter]) cylinder(d=peg_diameter, h=board_thickness + peg_diameter + 0.1); // Top Locking Lip (Rounded for easy insertion) translate([0, 0, -board_thickness - peg_diameter/2]) hull() { sphere(d=peg_diameter); translate([0, peg_diameter * 0.8, 0]) sphere(d=peg_diameter); } // Bottom Stabilizing Peg (Shaft) translate([0, -peg_spacing, -board_thickness]) cylinder(d=peg_diameter, h=board_thickness + 0.1); // Bottom Peg (Rounded Tip) translate([0, -peg_spacing, -board_thickness]) sphere(d=peg_diameter); } // --- Versatile Mounting Interface --- // Center M3 Hole & Captured Nut translate([0, -peg_spacing/2, -0.1]) { cylinder(d=hole_diameter, h=base_thickness + 0.2); cylinder(d=nut_width_flats / cos(30), h=nut_depth + 0.1, $fn=6); } // Top M3 Hole & Captured Nut translate([0, -peg_spacing/2 + 8, -0.1]) { cylinder(d=hole_diameter, h=base_thickness + 0.2); cylinder(d=nut_width_flats / cos(30), h=nut_depth + 0.1, $fn=6); } // Bottom M3 Hole & Captured Nut translate([0, -peg_spacing/2 - 8, -0.1]) { cylinder(d=hole_diameter, h=base_thickness + 0.2); cylinder(d=nut_width_flats / cos(30), h=nut_depth + 0.1, $fn=6); } } } // Render the part // Note: For maximum strength, rotate 90 degrees on the X or Y axis in your slicer // so the layer lines run along the length of the pegs. pegboard_mount();