powder-loader/power-loader.scad

163 lines
3.9 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;
border = 1;
funnel_size = 1;
2024-03-27 22:18:54 +00:00
part = 0;
2024-03-27 22:19:04 +00:00
part_sep = 0.2;
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:19:04 +00:00
difference() {
union() {
for(i = [0:5]) {
rotate([0, 0, i / 6 * 360])
bottom_part();
}
}
translate([0, 0, bottom_height])
connection(true);
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:49:56 +00:00
intersection() {
bottom();
translate([0, 0, -1])
cylinder(d = 12, h = 5);
}
2024-03-27 21:36:18 +00:00
module top() {
for(i = [0:5]) {
rotate([0, 0, i / 6 * 360])
top_part();
}
2024-03-27 22:19:04 +00:00
connection(false);
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")
2024-03-27 22:19:04 +00:00
translate([0, 0, bottom_height + part_sep])
2024-03-27 22:49:56 +00:00
intersection() {
top();
translate([0, 0, -4])
cylinder(d = 12, h = 5);
}
2024-03-27 21:36:18 +00:00
2024-03-27 22:19:04 +00:00
module connection(hole) {
sep_hole = hole?part_sep:0;
sep_screw = hole?0:part_sep;
translate([0, 0, -1.5 - sep_screw * 2])
cylinder(d = 4 + sep_hole, h = 1.5 + sep_screw * 2);
translate([0, 0, -3 - sep_screw * 2])
cylinder(d1 = 8 + sep_hole, d2 = 4 + sep_hole, h = 1.5);
}
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);
}