Merge branch 'psu_vents' of https://github.com/martinbudden/NopSCADlib into martinbudden-psu_vents

This commit is contained in:
Chris Palmer 2020-02-29 08:48:33 +00:00
commit cf94972b18
2 changed files with 32 additions and 3 deletions

View File

@ -39,6 +39,7 @@ function psu_face_grill(type) = type[3]; //! Is this face a grill
function psu_face_fan(type) = type[4]; //! Fan x,y position and type
function psu_face_iec(type) = type[5]; //! IEC connector x,y, rotation and type
function psu_face_switch(type) = type[6]; //! Rocker switch x,y, rotation and type
function psu_face_vents(type) = type[7]; //! Vents array position x,y, rotation, size and corner radius
function psu_name(type) = type[1]; //! The part name
function psu_length(type) = type[2]; //! Length
@ -166,6 +167,7 @@ module psu(type) { //! Draw a power supply
fan = psu_face_fan(f);
iec = psu_face_iec(f);
switch = psu_face_switch(f);
vents = psu_face_vents(f);
multmatrix(psu_face_transform(type, i))
translate([xo, 0, -t]) {
@ -208,6 +210,14 @@ module psu(type) { //! Draw a power supply
translate([switch.x, switch.y])
rotate(switch.z)
rocker_hole(switch[3], 0);
if(vents)
for(i = [0 : len(vents) - 1]) {
// vent is of form: [ [pos.x, pos.y, angle], [size.x, size.y], corner radius ]
vent = vents[i];
translate([vent[0].x, vent[0].y])
rotate(vent[0].z)
rounded_square(vent[1], vent[2]-eps, center = true);
}
}
}

View File

@ -105,14 +105,23 @@ S_300_12 = [
1.5,// thickness
[],// cutouts
false,// grill
[],[],[]// fan, iec, rocker
[],[],[],// fan, iec, rocker
[// vents
// [ [pos.x, pos.y, angle], [size.x, size.y], corner radius ]
for(x = [0:21], y = [-1,1]) [ [-7*x+215/2-34, (115/2-5)*y, 0], [3, 25], 1.5 ]
]
],
[// f_top, top
[],// holes
0.5,// thickness
[],// coutouts
false,// grill
[215/2 - 47.5, 115/2 - 37.5, fan50x15]
[215/2 - 47.5, 115/2 - 37.5, fan50x15],
[],//iec
[],//rocker
[// vents
for(x = [0:4], y = [-1,1]) [ [-7*x-215/2+48, 28*y, 0], [3, 25], 1.5 ]
]
],
[// f_left, front (terminals) after rotation
[],// holes
@ -140,14 +149,24 @@ S_300_12 = [
1.5,// thickness
[],// cutouts
false,// grill
[],[],[],// fan, iec, rocker
[// vents
for(x = [0 : 21]) [ [-7*x+215/2-34, -25, 0], [3, 10], 1.5 ],
for(x = [0 : 1]) [ [-7*x, -1, 0], [3, 25], 1.5 ],
for(x = [0 : 2]) [ [-7*x-215/2+20, -1, 0], [3, 25], 1.5 ],
]
],
[// f_back, left after rotation
[// holes, offset from center
[215/2 - 32.5, 15], [215/2 - 182.5, 15]
[215/2 - 32.5 - 13/2, 15], [215/2 - 182.5 - 13/2, 15]
],
1.5,// thickness
[],// cutouts
false,// grill
[],[],[],// fan, iec, rocker
[// vents
for(x = [0 : 21]) [ [-7*x+215/2-34-13/2, 25, 0], [3, 10], 1.5 ]
]
],
],
// accessories to add to BOM