76 lines
2.7 KiB
OpenSCAD
76 lines
2.7 KiB
OpenSCAD
|
|
|
||
|
|
// Air Raid Siren Stator Parameters
|
||
|
|
outer_diameter = 200; // Outer diameter of the stator
|
||
|
|
column_height = 100; // Height of the entire column
|
||
|
|
num_ports = 7; // Number of rectangular ports (works with odd or even)
|
||
|
|
port_height = 70; // Height of the ports
|
||
|
|
wall_thickness = 5; // Thickness of the column wall
|
||
|
|
|
||
|
|
module air_raid_siren_stator() {
|
||
|
|
// Calculate port width based on equal arc length
|
||
|
|
port_width = (PI * outer_diameter) / (num_ports * 2);
|
||
|
|
|
||
|
|
// Calculate vertical position to center the ports
|
||
|
|
port_vertical_offset = (column_height - port_height) / 2;
|
||
|
|
|
||
|
|
// Calculate inner diameter based on wall thickness
|
||
|
|
inner_diameter = outer_diameter - (2 * wall_thickness);
|
||
|
|
|
||
|
|
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, port_vertical_offset])
|
||
|
|
cube([wall_thickness * 2 + 1, port_width, port_height]);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
module impeller() {
|
||
|
|
// Calculate port width based on equal arc length
|
||
|
|
port_width = (PI * outer_diameter) / (num_ports * 2);
|
||
|
|
|
||
|
|
// Calculate vertical position to center the ports
|
||
|
|
port_vertical_offset = (column_height - port_height) / 2;
|
||
|
|
|
||
|
|
// Calculate inner diameter based on wall thickness
|
||
|
|
inner_diameter = outer_diameter - (2 * wall_thickness);
|
||
|
|
|
||
|
|
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, port_vertical_offset])
|
||
|
|
cube([wall_thickness * 2 + 1, port_width, port_height]);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// Render the stator
|
||
|
|
//air_raid_siren_stator();
|
||
|
|
impeller();
|