$fn = 64; // --- Parameters --- height = 100; // Total height of the pen holder (mm) outer_radius = 32; // Outer circumscribed radius of the hexagon (mm) wall_thickness = 2.5; // Thickness of the walls (mm) base_thickness = 3.0; // Thickness of the solid bottom base (mm) twist_angle = 60; // Total twist angle for a modern look (degrees) // --- Geometry --- difference() { // 1. Solid outer hexagonal body linear_extrude(height = height, twist = twist_angle, slices = 120) { circle(r = outer_radius, $fn = 6); } // 2. Hollow inner cavity difference() { // Extrude the inner profile slightly taller to ensure a clean cut at the top opening. // The twist rate is scaled to perfectly match the outer body's twist at any given Z height. linear_extrude( height = height + 1, twist = twist_angle * ((height + 1) / height), slices = 122 ) { circle(r = outer_radius - wall_thickness, $fn = 6); } // 3. Mask out the bottom portion of the inner cavity to leave a solid base // This cube exactly covers from Z = -2 up to Z = base_thickness translate([0, 0, base_thickness / 2 - 1]) { cube([outer_radius * 3, outer_radius * 3, base_thickness + 2], center = true); } } }