Merge branch 'martinbudden-square_blower'

This commit is contained in:
Chris Palmer 2020-11-18 11:31:57 +00:00
commit ecba7eaea4
5 changed files with 149 additions and 44 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 839 KiB

After

Width:  |  Height:  |  Size: 841 KiB

View File

@ -296,11 +296,18 @@ Models of radial blowers.
| ```blower_wall(type)``` | Side wall thickness |
| ```blower_width(type)``` | Width of enclosing rectangle |
### Functions
| Function | Description |
|:--- |:--- |
| ```blower_casing_is_square(type)``` | True for square radial fans, false for spiral shape radial blowers |
| ```blower_exit_offset(type)``` | Offset of exit's centre from the edge |
### Modules
| Module | Description |
|:--- |:--- |
| ```blower(type)``` | Draw specified blower |
| ```blower_hole_positions(type)``` | Translate children to screw hole positions |
| ```blower_square(type)``` | Draw a square blower |
![blowers](tests/png/blowers.png)
@ -309,8 +316,11 @@ Models of radial blowers.
| ---:|:--- |:---|
| 1 | ```blower(PE4020)``` | Blower Pengda Technology 4020 |
| 1 | ```blower(RB5015)``` | Blower Runda RB5015 |
| 4 | ```screw(M2_cap_screw, 8)``` | Screw M2 cap x 8mm |
| 3 | ```screw(M3_cap_screw, 20)``` | Screw M3 cap x 20mm |
| 2 | ```screw(M4_cap_screw, 25)``` | Screw M4 cap x 25mm |
| 1 | ```blower(BL40x10)``` | Square radial 4010 |
| 4 | ```washer(M2_washer)``` | Washer M2 x 5mm x 0.3mm |
| 3 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
| 2 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -22,6 +22,8 @@
//
include <../utils/core/core.scad>
use <../utils/rounded_cylinder.scad>
use <../utils/quadrant.scad>
use <screw.scad>
function blower_length(type) = type[2]; //! Length of enclosing rectangle
function blower_width(type) = type[3]; //! Width of enclosing rectangle
@ -39,8 +41,87 @@ function blower_top(type) = type[14]; //! Thickness of the top
function blower_wall(type) = type[15]; //! Side wall thickness
function blower_lug(type) = type[16]; //! Height of the lugs
function blower_casing_is_square(type) = len(blower_screw_holes(type)) > 3; //! True for square radial fans, false for spiral shape radial blowers
function blower_exit_offset(type) = blower_casing_is_square(type) ? blower_length(type) / 2 : blower_exit(type) / 2; //! Offset of exit's centre from the edge
fan_colour = grey(20);
module blower_fan(type, casing_is_square) {
module squarish(s, n) {
polygon([
for(i = [0 : n]) [i * s.x / n, s.y + (i % 2) * eps],
for(i = [0 : n]) [s.x - i * s.x / n, (i % 2) * eps],
]);
}
depth = blower_depth(type);
blade_ir = blower_hub(type) / 2 + 0.5; // slight gap between main part of blades and hub
blade_len = casing_is_square
? (blower_bore(type) - 1) / 2 - blade_ir // fan constrained by bore hole
: blower_width(type) - blower_axis(type).x- blower_wall(type) - blade_ir; // fan extends to casing
blade_thickness = 0.75;
blade_count = 25;
base_offset = 1;
translate([blower_axis(type).x, blower_axis(type).y, blower_base(type) + base_offset])
linear_extrude(blower_hub_height(type) - 0.5 - blower_base(type) - base_offset, center = false, convexity = 4, twist = -30, slices = round(depth / 2))
for(i = [0 : blade_count - 1])
rotate((360 * i) / blade_count)
translate([blade_ir, -blade_thickness / 2])
squarish([blade_len, blade_thickness], round(blade_len / 2));
}
module blower_square(type) { //! Draw a square blower
width = blower_width(type);
depth = blower_depth(type);
wall = blower_wall(type);
hole_pitch = (blower_screw_holes(type)[1].x - blower_screw_holes(type)[0].x) / 2;
corner_radius = width / 2 - hole_pitch;
corner_inset = (width - blower_exit(type)) / 2;
module square_inset_corners(remove_center = false)
difference() {
//overall outside
square([width, width], center = false);
if (remove_center) {
// cut out the inside, leaving the corners
translate([corner_inset + wall, -eps])
square([width - 2 * (wall + corner_inset), width - wall + eps], center = false);
translate([wall, corner_inset + wall])
square([width - 2 * wall, width - 2 * (wall + corner_inset)], center = false);
} else {
// cut out the bore for the fan
translate(blower_axis(type))
circle(d = blower_bore(type));
}
// corner inset
translate([width / 2, width / 2])
for(i = [0 : 3])
rotate(i * 90)
translate([-width / 2 - eps, -width/ 2 - eps])
quadrant(corner_inset, corner_inset - corner_radius);
}
base_height = blower_base(type);
linear_extrude(base_height)
difference () {
rounded_square([width, width], corner_radius, center = false);
blower_hole_positions(type)
circle(d = blower_screw_hole(type));
}
translate_z(base_height)
linear_extrude(depth - base_height)
square_inset_corners(remove_center = true);
translate_z(depth - base_height)
linear_extrude(blower_top(type))
square_inset_corners();
}
module blower(type) { //! Draw specified blower
length = blower_length(type);
width = blower_width(type);
@ -70,7 +151,11 @@ module blower(type) { //! Draw specified blower
vitamin(str("blower(", type[0], "): ", type[1]));
is_square = blower_casing_is_square(type); // Description starts with square!
color(fan_colour) {
if (is_square) {
blower_square(type);
} else {
// screw lugs
linear_extrude(blower_lug(type), center = false)
for(hole = blower_screw_holes(type))
@ -87,9 +172,6 @@ module blower(type) { //! Draw specified blower
shape(true);
}
// rotor
translate(concat(blower_axis(type), [blower_base(type) + 1]))
rounded_cylinder(r = blower_hub(type) / 2, h = blower_hub_height(type) - blower_base(type) - 1, r2 = 1);
*%square([length, width]);
@ -101,6 +183,7 @@ module blower(type) { //! Draw specified blower
translate(concat(blower_axis(type), [blower_base(type)]))
circle(d = 2);
}
// sides
linear_extrude(depth)
difference() {
@ -120,6 +203,12 @@ module blower(type) { //! Draw specified blower
circle(d = blower_bore(type));
}
}
// rotor
translate(concat(blower_axis(type), [blower_base(type) + 1]))
rounded_cylinder(r = blower_hub(type) / 2, h = blower_hub_height(type) - blower_base(type) - 1, r2 = 1);
blower_fan(type, is_square);
}
}
module blower_hole_positions(type) //! Translate children to screw hole positions

View File

@ -16,10 +16,16 @@
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
// l w d b s h a s s e h b t w l
// e i e o c u x c c x u a o a u
// n d p r r b i r r i b s p l g
// g t t e e s e e t e l
// t h h w d w w t
// h h s t t
RB5015 = ["RB5015", "Blower Runda RB5015", 51.3, 51, 15, 31.5, M4_cap_screw, 26, [27.3, 25.4], 4.5, [[4.3, 45.4], [47.3,7.4]], 20, 14, 1.5, 1.3, 1.2, 15];
PE4020 = ["PE4020", "Blower Pengda Technology 4020", 40, 40, 20, 27.5, M3_cap_screw, 22, [21.5, 20 ], 3.2, [[37,3],[3,37],[37,37]], 29.3, 17, 1.7, 1.2, 1.3, 13];
BL40x10 =["BL40x10","Square radial 4010", 40, 40,9.5, 27, M2_cap_screw, 16, [24, 20 ], 2.4, [[2,2],[38,2],[2,38],[38,38]], 30 , 9.5, 1.5, 1.5, 1.1, 1.5];
blowers = [PE4020, RB5015];
blowers = [BL40x10, PE4020, RB5015];
use <blower.scad>