$fn=64; /* * Hex-Compatible Tray for Keys and Small Items * Designed to tile cleanly with other hexagonal desk organizers. */ // --- Parameters --- outer_radius = 50; // Radius from center to outer corner (100mm wide corner-to-corner) height = 25; // Total height of the tray wall_thickness = 2.5; // Thickness of the outer walls base_thickness = 2; // Thickness of the bottom base // --- Module --- module hex_tray() { // Calculate inner radius to maintain uniform wall thickness // For a hexagon, the distance to the flat edge requires dividing by cos(30) inner_radius = outer_radius - (wall_thickness / cos(30)); difference() { // Main outer body (hexagon) cylinder(h=height, r=outer_radius, $fn=6); // Hollow interior cutout // Height is increased slightly to prevent Z-fighting at the top edge translate([0, 0, base_thickness]) cylinder(h=height, r=inner_radius, $fn=6); } } // --- Render --- hex_tray();