$fn = 300; // * c w part = "c"; slot_center_spacing = 25.4; ramp_height = 5; ramp_slot_mid = 4.25; ramp_depth = 2.5; deramp_height = 1; deramp_depth = (ramp_depth / ramp_height) * (ramp_height - deramp_height); bulk_radius = 2; rod_radius = 4.2; bearing_radius = 4; bearing_cut_depth = 2; core_bump_radius = 1; core_bump_height = 2; e = 0.02; outer_radius = rod_radius + bearing_radius + bulk_radius; echo("outer_radius=", outer_radius); echo("max_radius=", outer_radius + ramp_depth); mid = slot_center_spacing - ramp_slot_mid - ramp_slot_mid; total_height = deramp_height + ramp_height + mid + ramp_height + deramp_height; echo("total_height=", total_height); if (part == "*" || part == "c") { color("grey", 0.6) intersection() { wheel(); core_mask(); } } if (part == "*" || part == "w") { color("red", 0.6) difference() { wheel(); core_mask(); } } module core_mask() { rotate_extrude() polygon([ [0, total_height + e], [0, 0 - e], [rod_radius + bearing_radius + core_bump_radius, 0 - e], [rod_radius + bearing_radius + core_bump_radius, 0], [rod_radius + bearing_radius, core_bump_height], [rod_radius + bearing_radius + core_bump_radius, total_height + e], ]); } module wheel() { // deramp // ramp // [tip] // ramp // mid // ramp // [tip] // ramp // deramp difference() { rotate_extrude() polygon([ [rod_radius, total_height], [rod_radius, 0], [outer_radius + deramp_depth, 0], [outer_radius + ramp_depth, deramp_height], [outer_radius, deramp_height + ramp_height], [outer_radius, deramp_height + ramp_height + mid], [outer_radius + ramp_depth, deramp_height + ramp_height + mid + ramp_height], [outer_radius + deramp_depth, total_height], ]); for (a=[0:45:360]) { translate([0, 0, -e]) rotate([0, 0, a]) cube([rod_radius + bearing_cut_depth, 1, e + total_height + e]); } } }