sirens/designs/openscad/tests/impeller.scad
Michael Winter 0fbf33b756 Restructure project with OpenSCAD redesign and v1 legacy code
- Move legacy FreeCAD files to v1/
- Add OpenSCAD programmatic CAD designs
- Add README and AGENTS.md documentation
- Add .gitignore
- Update firmware to v2 architecture
2026-03-29 14:24:42 +02:00

154 lines
5.7 KiB
OpenSCAD

// Impeller Parameters
diameter = 100; // Overall base diameter
hub_diameter = 30; // Diameter of the central hub
hub_height = 10; // Height of the central hub
base_thickness = 3; // Thickness of the base
shaft_diameter = 10; // Diameter of the central shaft hole
blade_count = 6; // Number of blades
blade_length = 35; // Length of blades from hub
blade_thickness = 3; // Thickness of blades
blade_height_at_hub = 5; // Blade height at the hub
blade_height_at_diameter = 20; // Blade height at full diameter
module impeller_base() {
// Base with hub
difference() {
union() {
// Solid base disk
cylinder(h = base_thickness, d = diameter, center = false);
// Central hub
translate([0, 0, base_thickness])
cylinder(h = hub_height, d = hub_diameter, center = false);
}
// Countersink for shaft entry
translate([0, 0, -0.1])
cylinder(h = 1, d1 = shaft_diameter, d2 = shaft_diameter + 2, center = false);
// Through hole for shaft
translate([0, 0, base_thickness - 0.1])
cylinder(h = hub_height + 0.2, d = shaft_diameter, center = false);
}
}
module impeller_blade() {
// Blade with base always touching the impeller base
polyhedron(
points = [
// Bottom points at hub
[hub_diameter/2, -blade_thickness/2, base_thickness],
[hub_diameter/2, blade_thickness/2, base_thickness],
// Bottom points at full diameter
[diameter/2, -blade_thickness/2, base_thickness],
[diameter/2, blade_thickness/2, base_thickness],
// Top points at hub
[hub_diameter/2, -blade_thickness/2, base_thickness + blade_height_at_hub],
[hub_diameter/2, blade_thickness/2, base_thickness + blade_height_at_hub],
// Top points at full diameter
[diameter/2, -blade_thickness/2, base_thickness + blade_height_at_diameter],
[diameter/2, blade_thickness/2, base_thickness + blade_height_at_diameter]
],
faces = [
[0, 2, 3, 1], // Bottom face
[0, 1, 5, 4], // Inner side bottom
[2, 6, 7, 3], // Outer side bottom
[4, 5, 7, 6], // Top face
[0, 4, 6, 2], // Side face 1
[1, 3, 7, 5] // Side face 2
]
);
}
module impeller_blade() {
polyhedron(
points = [
// Bottom points at hub - SHIFTED OUTWARD
[hub_diameter/2 + base_thickness * tan(30), -blade_thickness/2, base_thickness],
[hub_diameter/2 + base_thickness * tan(30), blade_thickness/2, base_thickness],
// Bottom points at full diameter - SHIFTED OUTWARD
[diameter/2 + base_thickness * tan(30), -blade_thickness/2, base_thickness],
[diameter/2 + base_thickness * tan(30), blade_thickness/2, base_thickness],
// Top points at hub - INCREASED RADIAL ANGLE
[hub_diameter/2 + blade_height_at_hub * tan(30), -blade_thickness/2, base_thickness + blade_height_at_hub],
[hub_diameter/2 + blade_height_at_hub * tan(30), blade_thickness/2, base_thickness + blade_height_at_hub],
// Top points at full diameter - INCREASED RADIAL ANGLE
[diameter/2 + blade_height_at_diameter * tan(30), -blade_thickness/2, base_thickness + blade_height_at_diameter],
[diameter/2 + blade_height_at_diameter * tan(30), blade_thickness/2, base_thickness + blade_height_at_diameter]
],
faces = [
[0, 2, 3, 1], // Bottom face
[0, 1, 5, 4], // Inner side bottom
[2, 6, 7, 3], // Outer side bottom
[4, 5, 7, 6], // Top face
[0, 4, 6, 2], // Side face 1
[1, 3, 7, 5] // Side face 2
]
);
}
module impeller_blades() {
// Add blades
for (i = [0:360/blade_count:359]) {
rotate([0, 0, i]) {
impeller_blade();
}
}
}
module impeller_column() {
// Column Parameters
column_height = blade_height_at_diameter + base_thickness; // Height matches blade height
num_ports = blade_count; // Number of ports matching blade count
wall_thickness = 5; // Thickness of the column wall
outer_diameter = diameter; // Diameter of the impeller base
// Calculate port width based on equal arc length
port_width = (PI * outer_diameter) / (num_ports * 2);
// Calculate inner diameter based on wall thickness
inner_diameter = outer_diameter - (2 * wall_thickness);
// Rotate by half the port width
rotate([0, 0, 180/(num_ports * 2)])
difference() {
union() {
// Main cylindrical body
cylinder(h = column_height, d = outer_diameter, $fn = 100);
// Close the bottom with wall_thickness height
cylinder(h = wall_thickness, d = outer_diameter, $fn = 100);
}
// Hollow out the center (open on top end)
translate([0, 0, wall_thickness])
cylinder(h = column_height + 1, d = inner_diameter, $fn = 100);
// Create evenly spaced rectangular ports
for (i = [0 : num_ports - 1]) {
rotate([0, 0, i * (360 / num_ports)])
translate([outer_diameter/2 - wall_thickness * 2, -port_width/2, 0])
cube([wall_thickness * 2 + 1, port_width, column_height + 10]);
}
}
}
module complete_impeller() {
// Combine base and blades
impeller_base();
impeller_blades();
//impeller_column();
}
// Render the complete impeller
complete_impeller();