powder-loader/power-loader.scad

151 lines
3.7 KiB
OpenSCAD
Raw Normal View History

2024-03-27 21:36:18 +00:00
overall_cylinder_diam = 41;
chamber_to_center = 6.96;
chamber_diam = 11.45;
bottom_height = 3;
top_height = 20;
opening_sep = 0.1;
2024-03-27 22:30:13 +00:00
screw_hole_diam = 2;
screw_hole_depth = 12;
screw_diam = 3;
screw_spacer_diam = 10;
2024-03-27 21:36:18 +00:00
border = 1;
funnel_size = 1;
2024-03-27 22:18:54 +00:00
part = 0;
2024-03-27 21:36:18 +00:00
module _end_of_customizer() {}
2024-03-27 22:18:54 +00:00
assert(part >= 0 && part <= 2);
2024-03-27 21:36:18 +00:00
$fn = $preview?30:80;
module overall_cylinder() {
translate([0, 0, -20])
difference() {
cylinder(d = overall_cylinder_diam, h = 20);
for(i = [0:5]) {
rotate([0, 0, i/6*360])
translate([chamber_to_center + chamber_diam/2, 0, -1])
cylinder(d = chamber_diam, h = 22);
}
}
}
2024-03-27 22:18:54 +00:00
if($preview && part == 0)
2024-03-27 21:36:18 +00:00
color("#777")
overall_cylinder();
module bottom() {
2024-03-27 22:30:13 +00:00
difference() {
union()
for(i = [0:5]) {
rotate([0, 0, i / 6 * 360])
bottom_part();
}
translate([0, 0, -1])
cylinder(d = screw_diam + 1, h = bottom_height + 2);
translate([0, 0, -1])
cylinder(d = screw_spacer_diam, h = 2 + 1);
2024-03-27 21:36:18 +00:00
}
}
center_to_bottom_opening_center = chamber_to_center + chamber_diam / 2;
bottom_opening_diam = center_to_bottom_opening_center * sin(360 / 12) - opening_sep;
module bottom_part() {
difference() {
union() {
rotate([0, 0, 360/12])
linear_extrude(bottom_height)
polygon([
[0, 0],
[overall_cylinder_diam / 2 * cos(360 / 12), overall_cylinder_diam / 2 * sin(360 / 12)],
[overall_cylinder_diam / 2 * cos(360 / 12), -overall_cylinder_diam / 2 * sin(360 / 12)],
]);
translate([center_to_bottom_opening_center, 0, -funnel_size])
cylinder(
d1 = bottom_opening_diam,
d2 = bottom_opening_diam + funnel_size,
h = funnel_size
);
}
translate([center_to_bottom_opening_center, 0, -1 - funnel_size])
cylinder(d = bottom_opening_diam, h = bottom_height + 2 + funnel_size);
rotate([0, 0, 360/6])
translate([center_to_bottom_opening_center, 0, -1 - funnel_size])
cylinder(d = bottom_opening_diam, h = bottom_height + 2 + funnel_size);
}
}
2024-03-27 22:18:54 +00:00
if(part == 0 || part == 1)
2024-03-27 21:36:18 +00:00
color("#dd08")
2024-03-27 22:18:54 +00:00
bottom();
2024-03-27 21:36:18 +00:00
module top() {
2024-03-27 22:30:13 +00:00
difference() {
union()
for(i = [0:5]) {
rotate([0, 0, i / 6 * 360])
top_part();
}
translate([0, 0, -1])
cylinder(d = screw_hole_diam, h = screw_hole_depth + 1);
2024-03-27 21:36:18 +00:00
}
}
module top_part() {
difference() {
linear_extrude(top_height)
polygon([
[0, 0],
[overall_cylinder_diam / 2 * cos(360 / 12), overall_cylinder_diam / 2 * sin(360 / 12)],
[overall_cylinder_diam / 2 * cos(360 / 12), -overall_cylinder_diam / 2 * sin(360 / 12)],
]);
top_part_hollow();
}
}
module top_part_hollow() {
adjusted_radius = overall_cylinder_diam / 2 - border;
hull() {
translate([center_to_bottom_opening_center, 0, 0])
cylinder(d = bottom_opening_diam, h = 0.1);
translate([0, 0, top_height - 0.1 - border])
linear_extrude(0.1)
polygon([
[border, 0],
[adjusted_radius * cos(360 / 12), adjusted_radius * sin(360 / 12) - border / 2],
[adjusted_radius * cos(360 / 12), -adjusted_radius * sin(360 / 12) + border / 2],
]);
}
}
2024-03-27 22:18:54 +00:00
if(part == 0 || part == 2)
2024-03-27 21:36:18 +00:00
color("#4d48")
translate([0, 0, bottom_height])
top();
2024-03-27 22:18:54 +00:00
if($preview && part == 1)
2024-03-27 21:36:18 +00:00
color("#f008")
for(i = [0:5]) {
rotate([0, 0, i/6*360 + 360 / 12])
translate([center_to_bottom_opening_center, 0, 01])
cylinder(d = bottom_opening_diam, h = bottom_height + 2);
}