45 lines
1.1 KiB
OpenSCAD

/*
* Copyright (c) Camden Dixie O'Brien
* SPDX-License-Identifier: AGPL-3.0-only
*/
module hemisphere (radius)
{
difference() {
sphere(radius);
translate([0, -radius, -radius]) cube([radius, 2 * radius, 2 * radius]);
}
}
module cup (cup_radius, cup_thickness, cup_offset, spoke_length, spoke_radius)
{
translate([0, cup_radius + spoke_length, 0]) scale([1, -1, 1])
difference() {
union() {
translate([spoke_radius + cup_offset, 0, 0]) hemisphere(cup_radius);
rotate([-90, 0, 0])
cylinder(cup_radius + spoke_length, r = spoke_radius);
}
translate([spoke_radius + cup_offset, 0, 0]) sphere(cup_radius - cup_thickness);
};
}
module cups (n_cups, hub_height, hub_outer_radius, hub_inner_radius,
cup_radius, cup_thickness, cup_offset, spoke_length,
spoke_radius)
{
difference() {
union() {
cylinder(hub_height, r = hub_outer_radius, center = true);
for (i = [0 : n_cups - 1]) {
rotate([0, 0, i * 360 / n_cups])
cup(cup_radius, cup_thickness, cup_offset, spoke_length,
spoke_radius);
}
}
cylinder(hub_height + 1, r = hub_inner_radius, center = true);
}
}
cups(5, 20, 18, 6, 40, 3, 6, 60, 8);