mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-09-07 05:31:18 +02:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
f5d0bfb6c8 | ||
|
b2117fa99a | ||
|
6687a4a7c6 | ||
|
8524ddd34d | ||
|
c8869fc415 |
@@ -3,6 +3,15 @@
|
||||
This changelog is generated by `changelog.py` using manually added semantic version tags to classify commits as breaking changes, additions or fixes.
|
||||
|
||||
|
||||
### [v17.3.0](https://github.com/nophead/NopSCADlib/releases/tag/v17.3.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v17.2.2...v17.3.0 "diff with v17.2.2")
|
||||
* 2021-10-20 [`21c0666`](https://github.com/nophead/NopSCADlib/commit/21c06667a3c5a0bc65440b990e28b8a2f93c7c32 "show commit") [C.P.](# "Chris Palmer") Added ATX300 PSU model.
|
||||
|
||||
* 2021-10-20 [`d19fad3`](https://github.com/nophead/NopSCADlib/commit/d19fad3f9f7e6eba94b2005b4798b5914fff4b69 "show commit") [C.P.](# "Chris Palmer") PSU grills can now have different holes sizes, spacing, round or heaxagonal and avoid a list of rectangular regions.
|
||||
|
||||
* 2021-10-20 [`172bfb1`](https://github.com/nophead/NopSCADlib/commit/172bfb16d8ec8ffee8b5185ef42867b37ab6bce1 "show commit") [C.P.](# "Chris Palmer") Added lugless pressfit IEC inlet.
|
||||
|
||||
* 2021-10-09 [`491dbae`](https://github.com/nophead/NopSCADlib/commit/491dbae13b9ff2736324ff084c6a6f313b4a09fc "show commit") [C.P.](# "Chris Palmer") `screw_shorter_than()` will return 4 or 3 for short grub screws.
|
||||
|
||||
#### [v17.2.2](https://github.com/nophead/NopSCADlib/releases/tag/v17.2.2 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v17.2.1...v17.2.2 "diff with v17.2.1")
|
||||
* 2021-10-02 [`046c475`](https://github.com/nophead/NopSCADlib/commit/046c475e1833c09a925a5310d1ccc6e4b07e7f89 "show commit") [M.B.](# "Martin Budden") Set convexity to 8 for `linear_extrude` of extrusion.
|
||||
|
||||
|
@@ -74,7 +74,8 @@ module foot_assembly(t = 0, type = foot, flip = false, no_washer = false) { //!
|
||||
screw_length = screw_length(screw, foot_thickness(type) + t - squeeze, no_washer ? 1 : 2, nyloc = true);
|
||||
|
||||
vflip() explode(15, true) {
|
||||
stl_colour(pp4_colour) foot(type);
|
||||
translate_z(-squeeze)
|
||||
stl_colour(pp4_colour) foot(type);
|
||||
|
||||
if(t)
|
||||
explode(15, true)
|
||||
|
@@ -1527,6 +1527,7 @@ E.g. a "brown" socket for mains live needs to be displayed as "sienna" to look r
|
||||
### Functions
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| `jack_4mm_flange_radius()` | 4mm jack socket flange radius |
|
||||
| `jack_4mm_hole_radius()` | Panel hole radius for 4mm jack |
|
||||
| `jack_4mm_plastic_flange_radius()` | 4mm plastic jack socket flange radius |
|
||||
| `jack_4mm_shielded_hole_radius()` | Panel hole radius for 4mm shielded jack |
|
||||
@@ -2845,6 +2846,7 @@ Face order is bottom, top, left, right, front, back.
|
||||
|:--- |:--- |
|
||||
| `atx_psu(type)` | True if an ATX style PSU |
|
||||
| `psu_accessories(type)` | Accessories to add to BOM, e.g. mains lead |
|
||||
| `psu_face_cutout(type)` | Panel cutout to accommodate this face, e.g. for ATX |
|
||||
| `psu_face_cutouts(type)` | List of polygons to remove |
|
||||
| `psu_face_fan(type)` | Fan x,y position and type |
|
||||
| `psu_face_grill(type)` | Is this face a grill |
|
||||
@@ -2880,7 +2882,7 @@ Face order is bottom, top, left, right, front, back.
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| `atx_psu_cutout(type)` | Cut out for the rear of an ATX |
|
||||
| `atx_psu_cutout(type, face = f_front)` | Cut out for the rear of an ATX, which is actually f_front! |
|
||||
| `psu(type)` | Draw a power supply |
|
||||
| `psu_screw_positions(type, face = undef)` | Position children at the screw positions on the preferred mounting face, which can be overridden. |
|
||||
| `terminal_block(type, ways)` | Draw a power supply terminal block |
|
||||
|
@@ -16,11 +16,15 @@
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
show_cutout = false;
|
||||
|
||||
include <../core.scad>
|
||||
include <../vitamins/psus.scad>
|
||||
|
||||
use <../utils/layout.scad>
|
||||
|
||||
|
||||
|
||||
module psus()
|
||||
layout([for(p = psus) atx_psu(p) ? psu_length(p) : psu_width(p)], 10) let(p = psus[$i])
|
||||
rotate(atx_psu(p) ? 0 : 90) {
|
||||
@@ -29,6 +33,9 @@ module psus()
|
||||
psu_screw_positions(p)
|
||||
translate_z(3)
|
||||
screw_and_washer(psu_screw(p), 8);
|
||||
|
||||
if(show_cutout && atx_psu(p))
|
||||
#atx_psu_cutout(p);
|
||||
}
|
||||
|
||||
if($preview) {
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 100 KiB |
Binary file not shown.
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 137 KiB |
Binary file not shown.
Before Width: | Height: | Size: 251 KiB After Width: | Height: | Size: 255 KiB |
@@ -103,7 +103,7 @@ module drill(r, h = 100, center = true) //! Make a cylinder for drilling holes s
|
||||
|
||||
module poly_drill(r, h = 100, center = true) //! Make a cylinder for drilling holes suitable for CNC routing if cnc_bit_r is non zero, otherwise a poly_cylinder.
|
||||
if(cnc_bit_r)
|
||||
drill(r, h, center = true);
|
||||
drill(r, h, center = center);
|
||||
else
|
||||
poly_cylinder(r, h, center);
|
||||
|
||||
|
@@ -29,10 +29,11 @@ use <../utils/thread.scad>
|
||||
use <ring_terminal.scad>
|
||||
|
||||
function jack_4mm_hole_radius() = 8/2; //! Panel hole radius for 4mm jack
|
||||
function jack_4mm_flange_radius() = 10.6 / 2; //! 4mm jack socket flange radius
|
||||
|
||||
module jack_4mm(colour, thickness, display_colour = false) { //! Draw a 4mm jack socket with nut positioned for specified panel thickness
|
||||
vitamin(str("jack_4mm(\"", colour, "\", 3", arg(display_colour, false), "): 4mm jack socket ", colour));
|
||||
flange_d = 10.6;
|
||||
flange_r = jack_4mm_flange_radius();
|
||||
flange_t = 3;
|
||||
flange_id = 4.6;
|
||||
length = 28.5;
|
||||
@@ -50,7 +51,7 @@ module jack_4mm(colour, thickness, display_colour = false) { //! Draw a 4mm jack
|
||||
explode(length, offset = -length + flange_t) {
|
||||
color(display_colour ? display_colour : colour) rotate_extrude() difference() {
|
||||
union() {
|
||||
square([flange_d / 2, flange_t]);
|
||||
square([flange_r, flange_t]);
|
||||
|
||||
translate([0, -sleaved])
|
||||
square([sleaved_d / 2, sleaved]);
|
||||
|
@@ -39,6 +39,7 @@ function psu_face_fan(type) = type[4]; //! Fan x,y position and typ
|
||||
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_face_cutout(type) = type[8]; //! Panel cutout to accommodate this face, e.g. for ATX
|
||||
|
||||
function psu_name(type) = type[1]; //! The part name
|
||||
function psu_length(type) = type[2]; //! Length
|
||||
@@ -125,9 +126,9 @@ function psu_face_transform(type, face) = //! Returns a transformation
|
||||
) translate([0, 0, h / 2]) * rotate(rotations[face]) * translate([0, 0, translations[face]]);
|
||||
|
||||
module psu_grill(width, height, grill_hole = 4.5, grill_gap = 1.5, fn = 0, avoid = []) {
|
||||
nx = floor(width / (grill_hole + grill_gap));
|
||||
nx = floor(width / (grill_hole + grill_gap)) + 1;
|
||||
xpitch = width / nx;
|
||||
ny = floor(height / ((grill_hole + grill_gap) * cos(30)));
|
||||
ny = floor(height / ((grill_hole + grill_gap) * cos(30))) + 1;
|
||||
ypitch = height / ny;
|
||||
r = grill_hole / 2;
|
||||
avoid = avoid ? [for(p = avoid) [[p.x - p[2] / 2 - r, p.y - p[3] / 2 - r], [p.x + p[2] / 2 + r, p.y + p[3] / 2 + r]]] : false;
|
||||
@@ -192,15 +193,17 @@ module psu(type) { //! Draw a power supply
|
||||
g = psu_face_grill(f);
|
||||
if(g) {
|
||||
list = is_list(g);
|
||||
fn = list ? g[2] : 0;
|
||||
hole = list ? g[0] : 4.5;
|
||||
gap = list ? g[1] : 1.5;
|
||||
avoid = list ? g[3] : [];
|
||||
mx = 6;
|
||||
my1 = i == f_top && psu_face_grill(faces[f_back]) ? 0 : 6;
|
||||
my2 = i == f_back && psu_face_grill(faces[f_top]) ? 0 : 6;
|
||||
translate([0, (my2 - my1) / 2])
|
||||
psu_grill(xw - 2 * mx, yw - my1 - my2, grill_hole = hole, grill_gap = gap, fn = fn, avoid = avoid);
|
||||
fn = list ? g[2] : 0;
|
||||
margins = list ? g[3] : [6, 6, 6, 6];
|
||||
avoid = list ? g[4] : [];
|
||||
mx1 = margins[0];
|
||||
mx2 = margins[1];
|
||||
my1 = i == f_top && psu_face_grill(faces[f_back]) ? 0 : margins[2];
|
||||
my2 = i == f_back && psu_face_grill(faces[f_top]) ? 0 : margins[3];
|
||||
translate([(mx1 - mx2) / 2, (my2 - my1) / 2])
|
||||
psu_grill(xw - mx1 - mx2, yw - my1 - my2, grill_hole = hole, grill_gap = gap, fn = fn, avoid = avoid);
|
||||
}
|
||||
if(fan)
|
||||
translate([fan.x, fan.y]) intersection() {
|
||||
@@ -343,22 +346,9 @@ module psu_screw_positions(type, face = undef) { //! Position children at the sc
|
||||
children();
|
||||
}
|
||||
|
||||
module atx_psu_cutout(type) { //! Cut out for the rear of an ATX
|
||||
holes = psu_face_holes(psu_faces(type)[f_front]);
|
||||
translate([holes[0].x, -psu_width(type) / 2, psu_height(type) / 2 + holes[0].y])
|
||||
rotate([90, 0, 0])
|
||||
linear_extrude(100, center = true)
|
||||
round(5)
|
||||
polygon([ // https://www.techpowerup.com/forums/threads/pc-component-dimensions.157239, tweaked
|
||||
[18.7, -13],
|
||||
[ 5.7, 0],
|
||||
[ 5.7, 54],
|
||||
[18.7, 67],
|
||||
[127, 67],
|
||||
[140, 67 - 13 / tan(52)],
|
||||
[140, -5 + 11 / tan(52)],
|
||||
[129, -5],
|
||||
[81.3, -5],
|
||||
[73.3, -13],
|
||||
]);
|
||||
module atx_psu_cutout(type, face = f_front) { //! Cut out for the rear of an ATX, which is actually f_front!
|
||||
multmatrix(psu_face_transform(type, face))
|
||||
linear_extrude(100, center = true)
|
||||
round(5)
|
||||
polygon(psu_face_cutout(psu_faces(type)[face]));
|
||||
}
|
||||
|
@@ -62,29 +62,58 @@ ATX500 =
|
||||
[[], 0.8, []],
|
||||
[[], 0.8, []],
|
||||
[[], 0.8, []],
|
||||
[[[-69, -27], [-69, 37], [69, 37], [45, -37]], 0.8, [], false, [-25, 0, fan80x25], [45, -19.6, 180, IEC_inlet_atx], [45, 23, 90, small_rocker]],
|
||||
[[[-69, -27], [-69, 37], [69, 37], [45, -37]], 0.8, [], false, [-25, 0, fan80x25], [45, -19.6, 180, IEC_inlet_atx], [45, 23, 90, small_rocker], false,
|
||||
let(h0 = [-69, -27]) [ // https://www.techpowerup.com/forums/threads/pc-component-dimensions.157239, tweaked
|
||||
[18.7, -13] + h0,
|
||||
[ 5.7, 0] + h0,
|
||||
[ 5.7, 54] + h0,
|
||||
[18.7, 67] + h0,
|
||||
[127, 67] + h0,
|
||||
[140, 67 - 13 / tan(52)] + h0,
|
||||
[140, -5 + 11 / tan(52)] + h0,
|
||||
[129, -5] + h0,
|
||||
[81.3, -5] + h0,
|
||||
[73.3, -13] + h0,
|
||||
]
|
||||
],
|
||||
[[], 0.8, [], true],
|
||||
],
|
||||
[": IEC mains lead"]
|
||||
];
|
||||
|
||||
// Single fan in the top, wires exit opposite side from mains in
|
||||
ATX300 = let(p = [113 / 2, 51 / 2], iec = [35.5, 6], sw = [6.5, 7])
|
||||
["ATX300", "FSP300-60GHX", 125, 100, 64, No632_pan_screw, 5/2, true, 0, 0, [],
|
||||
ATX300 = let(p = [113 / 2, 51.5 / 2], s = [125, 100, 64], iec = [35.5, 6], sw = [6.5, 7])
|
||||
["ATX300", "FSP300-60GHX", s.x, s.y, s.z, No632_pan_screw, No6_clearance_radius, true, 0, 0, [],
|
||||
[
|
||||
[[], 0.5, []],
|
||||
[[], 0.5, [], false, [0, 8, fan80x25]],
|
||||
[[], 0.5, []],
|
||||
[[], 0.5, []],
|
||||
[[-p, p, [-p.x, p.y], [p.x, -p.y], [p.x, 0]], 0.5, [], [3, 0.35, 6, [
|
||||
[[-p, p, [-p.x, p.y], [p.x, -p.y], [p.x, 0]], 0.5, [], [3, 0.6, 6, [6.3, 7, 6.4, 5.5], [
|
||||
[-p.x, -p.y, 5, 5],
|
||||
[-p.x, p.y, 5, 5],
|
||||
[p.x, 0, 9, 100],
|
||||
[p.x, -p.y, 17, 6],
|
||||
[p.x, 0, 5, 100],
|
||||
[p.x, p.y, 12, 6],
|
||||
[p.x, -p.y, 12, 6],
|
||||
[iec.x, iec.y, 32, 22],
|
||||
[sw.x, sw.y, 23, 20],
|
||||
[sw.x, sw.y, 28, 12],
|
||||
]], false, [iec.x, iec.y, 180, IEC_inlet_atx2], [sw.x, sw.y, 90, small_rocker]],
|
||||
[sw.x, sw.y, 20, 20],
|
||||
[sw.x, sw.y, 27, 12],
|
||||
]], false, [iec.x, iec.y, 180, IEC_inlet_atx2], [sw.x, sw.y, 90, small_rocker], false, [
|
||||
[-s.x / 2 + 11.5, -s.z / 2 + 4.5],
|
||||
[-s.x / 2 + 5.5, -s.z / 2 + 4.5 + 6 * tan(60)],
|
||||
|
||||
[-s.x / 2 + 5.5, s.z / 2 - 5.4 - 6 * tan(60)],
|
||||
[-s.x / 2 + 11.5, s.z / 2 - 5.4],
|
||||
|
||||
[ s.x / 2 - 14, s.z / 2 - 5.4],
|
||||
[ s.x / 2 - 10.5, s.z / 2 - 5.4 - 3.5 * tan(60)],
|
||||
[ s.x / 2 - 10.5, -6],
|
||||
[ s.x / 2 - 8, -8.5],
|
||||
|
||||
[ s.x / 2 - 8, -s.z / 2 + 4.5 + 6 * tan(60)],
|
||||
[ s.x / 2 - 14, -s.z / 2 + 4.5],
|
||||
]
|
||||
],
|
||||
[[], 0.5, []],
|
||||
],
|
||||
[": IEC mains lead"]
|
||||
|
Reference in New Issue
Block a user