$fn = 64; // --- Parameters --- // Overall length of the insert base insert_length = 100; // Overall width of the insert base insert_width = 60; // Total height of the insert base insert_height = 25; // Thickness of the outer walls wall_thickness = 2; // Thickness of the bottom floor bottom_thickness = 2; // Outer corner radius (0 for sharp corners) corner_radius = 4; // Bottom edge chamfer (helps with insertion and prevents elephant foot) bottom_chamfer = 1.5; // --- Modules --- // Helper module to create a rounded rectangular prism module rounded_prism(l, w, h, r) { if (r >= 0.1) { hull() { translate([r, r, 0]) cylinder(h=h, r=r); translate([l-r, r, 0]) cylinder(h=h, r=r); translate([l-r, w-r, 0]) cylinder(h=h, r=r); translate([r, w-r, 0]) cylinder(h=h, r=r); } } else { cube([l, w, h]); } } // Main module for the blank insert base module blank_insert_base() { difference() { // Outer Body hull() { // Bottom chamfered face translate([bottom_chamfer, bottom_chamfer, 0]) rounded_prism( insert_length - 2 * bottom_chamfer, insert_width - 2 * bottom_chamfer, 0.01, // extremely thin base layer for hull max(0, corner_radius - bottom_chamfer) ); // Main body extending upwards translate([0, 0, bottom_chamfer]) rounded_prism( insert_length, insert_width, insert_height - bottom_chamfer, corner_radius ); } // Hollow interior for custom inserts // Z-height is oversized to ensure a clean manifold cut at the top translate([wall_thickness, wall_thickness, bottom_thickness]) rounded_prism( insert_length - 2 * wall_thickness, insert_width - 2 * wall_thickness, insert_height, max(0, corner_radius - wall_thickness) ); } } // --- Render --- blank_insert_base();