$fn = 64; // --- Parameters --- tower_height = 60; // Total height of the riser base_radius = 25; // Radius of the bottom foundation top_radius = 16; // Radius of the tower shaft just below the top battlement_radius = 20; // Radius of the flared top section battlement_height = 12; // Height of the top section (corbel + walls) cable_diameter = 8; // Diameter of the cable to route crenel_count = 8; // Number of gaps in the castle top module castle_cable_riser() { difference() { // Main solid body union() { // Base foundation cylinder(h = 5.1, r1 = base_radius + 5, r2 = base_radius); // Main tower shaft translate([0, 0, 5]) cylinder(h = tower_height - battlement_height - 4.9, r1 = base_radius, r2 = top_radius); // Corbel (flared section supporting the battlements) translate([0, 0, tower_height - battlement_height]) cylinder(h = 4.1, r1 = top_radius, r2 = battlement_radius); // Battlement wall translate([0, 0, tower_height - battlement_height + 4]) cylinder(h = battlement_height - 4, r = battlement_radius); } // --- Subtractions (Cutouts) --- // Hollow out the top inside of the battlements translate([0, 0, tower_height - battlement_height + 6]) cylinder(h = battlement_height, r = battlement_radius - 3); // Crenellations (notches in the top wall) translate([0, 0, tower_height - 2]) { for (i = [0 : crenel_count - 1]) { rotate([0, 0, i * (360 / crenel_count)]) translate([battlement_radius, 0, 0]) cube([12, 6, 10], center = true); } } // Cable routing slot (U-shape passing completely through) translate([0, 0, tower_height - cable_diameter/2 - 2]) { // Round bottom of the cradle rotate([90, 0, 0]) cylinder(h = base_radius * 4, r = cable_diameter/2 + 0.5, center = true); // Straight vertical sides of the drop-in slot translate([0, 0, cable_diameter/2]) cube([cable_diameter + 1, base_radius * 4, cable_diameter], center = true); } // Hollow base to save material (cone shaped to avoid needing supports) translate([0, 0, -1]) cylinder(h = 15, r1 = base_radius - 2, r2 = 0); } } // Render the object castle_cable_riser();