1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-09-04 20:56:07 +02:00

Compare commits

..

9 Commits

Author SHA1 Message Date
Chris Palmer
21c06667a3 Added ATX300 PSU model. 2021-10-20 20:35:45 +01:00
Chris Palmer
d19fad3f9f PSU grills can now have different holes sizes, spacing, round or heaxagonal and avoid a list of rectangular regions. 2021-10-20 20:33:52 +01:00
Chris Palmer
172bfb16d8 Added lugless pressfit IEC inlet. 2021-10-20 12:50:35 +01:00
Chris Palmer
491dbae13b screw_shorter_than() will return 4 or 3 for short grub screws. 2021-10-09 12:05:13 +01:00
Chris Palmer
99ebfffd2b Updated changelog. 2021-10-06 10:14:18 +01:00
Chris Palmer
f04486a040 Merge branch 'martinbudden-extrusion_convexity' 2021-10-06 10:12:54 +01:00
Chris Palmer
42a7d222b5 Merge branch 'extrusion_convexity' of https://github.com/martinbudden/NopSCADlib into martinbudden-extrusion_convexity 2021-10-06 10:08:08 +01:00
Chris Palmer
598a01295f Updated changelog. 2021-10-06 10:05:49 +01:00
Martin Budden
046c475e18 Set convexity to 8 for linear_extrude of extrusion. 2021-10-02 09:20:51 +01:00
12 changed files with 83 additions and 24 deletions

View File

@@ -3,6 +3,21 @@
This changelog is generated by `changelog.py` using manually added semantic version tags to classify commits as breaking changes, additions or fixes. This changelog is generated by `changelog.py` using manually added semantic version tags to classify commits as breaking changes, additions or fixes.
#### [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.
#### [v17.2.1](https://github.com/nophead/NopSCADlib/releases/tag/v17.2.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v17.2.0...v17.2.1 "diff with v17.2.0")
* 2021-10-06 [`5f72a12`](https://github.com/nophead/NopSCADlib/commit/5f72a1212514ee7f8a795b53b1d1d180329660df "show commit") [C.P.](# "Chris Palmer") Nuts shown on jacks and fuseholders only shown threaded when exploded.
### [v17.2.0](https://github.com/nophead/NopSCADlib/releases/tag/v17.2.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v17.1.0...v17.2.0 "diff with v17.1.0")
* 2021-10-06 [`82502eb`](https://github.com/nophead/NopSCADlib/commit/82502eb470127b28e4036821077cbdbd06c17e9e "show commit") [C.P.](# "Chris Palmer") Added `pot_nut()` module to draw potentiometer nuts and washers.
### [v17.1.0](https://github.com/nophead/NopSCADlib/releases/tag/v17.1.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v17.0.1...v17.1.0 "diff with v17.0.1")
* 2021-10-05 [`b541298`](https://github.com/nophead/NopSCADlib/commit/b541298eae361b80df3c6c5797f3940a37fc2a38 "show commit") [C.P.](# "Chris Palmer") Printed foot assembly can now omit the top washer when space is at a premium.
Now correctly shows the screw in the squeezed position.
* 2021-10-02 [`9884160`](https://github.com/nophead/NopSCADlib/commit/9884160ed5e8cd7d1f44c6fee950e3682714da9c "show commit") [C.P.](# "Chris Palmer") Updated the gallery
#### [v17.0.1](https://github.com/nophead/NopSCADlib/releases/tag/v17.0.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v17.0.0...v17.0.1 "diff with v17.0.0") #### [v17.0.1](https://github.com/nophead/NopSCADlib/releases/tag/v17.0.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v17.0.0...v17.0.1 "diff with v17.0.0")
* 2021-10-01 [`38c973b`](https://github.com/nophead/NopSCADlib/commit/38c973b316a853fcbef3ccb857d99404a772d9dd "show commit") [C.P.](# "Chris Palmer") FR4 veroboard made the correct colour. * 2021-10-01 [`38c973b`](https://github.com/nophead/NopSCADlib/commit/38c973b316a853fcbef3ccb857d99404a772d9dd "show commit") [C.P.](# "Chris Palmer") FR4 veroboard made the correct colour.
veroboard track cuts made slightly bigger. veroboard track cuts made slightly bigger.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 932 KiB

After

Width:  |  Height:  |  Size: 943 KiB

View File

@@ -1454,6 +1454,7 @@ IEC mains inlets and outlet.
| 1 | `iec(IEC_inlet)` | IEC inlet | | 1 | `iec(IEC_inlet)` | IEC inlet |
| 1 | `iec(IEC_inlet_atx)` | IEC inlet for ATX | | 1 | `iec(IEC_inlet_atx)` | IEC inlet for ATX |
| 1 | `iec(IEC_outlet)` | IEC outlet RS 811-7193 | | 1 | `iec(IEC_outlet)` | IEC outlet RS 811-7193 |
| 1 | `iec(IEC_inlet_atx2)` | IEC pressfit inlet for ATX |
| 1 | `iec(IEC_320_C14_switched_fused_inlet)` | IEC320 C14 switched fused inlet module | | 1 | `iec(IEC_320_C14_switched_fused_inlet)` | IEC320 C14 switched fused inlet module |
| 12 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc | | 12 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc |
| 4 | `screw(M3_cs_cap_screw, 10)` | Screw M3 cs cap x 10mm | | 4 | `screw(M3_cs_cap_screw, 10)` | Screw M3 cs cap x 10mm |
@@ -2889,18 +2890,18 @@ Face order is bottom, top, left, right, front, back.
### Vitamins ### Vitamins
| Qty | Module call | BOM entry | | Qty | Module call | BOM entry |
| ---:|:--- |:---| | ---:|:--- |:---|
| 1 | | IEC mains lead | | 2 | | IEC mains lead |
| 1 | `psu(ATX500)` | PSU ATX500 | | 1 | `psu(ATX500)` | PSU ATX500 |
| 1 | `psu(KY240W)` | PSU KY-240W-12-L | | 1 | `psu(ATX300)` | PSU FSP300-60GHX |
| 1 | `psu(KY240W)` | PSU KY-240W-12-L - not shown |
| 1 | `psu(PD_150_12)` | PSU PD-150-12 | | 1 | `psu(PD_150_12)` | PSU PD-150-12 |
| 1 | `psu(S_250_48)` | PSU S-250-48 | | 1 | `psu(S_250_48)` | PSU S-250-48 |
| 1 | `psu(S_300_12)` | PSU S-300-12 | | 1 | `psu(S_300_12)` | PSU S-300-12 |
| 4 | `screw(No632_pan_screw, 8)` | Screw 6-32 pan x 8mm | | 9 | `screw(No632_pan_screw, 8)` | Screw 6-32 pan x 8mm |
| 4 | `screw(M3_cap_screw, 8)` | Screw M3 cap x 8mm |
| 8 | `screw(M3_pan_screw, 8)` | Screw M3 pan x 8mm | | 8 | `screw(M3_pan_screw, 8)` | Screw M3 pan x 8mm |
| 4 | `screw(M4_cap_screw, 8)` | Screw M4 cap x 8mm | | 4 | `screw(M4_cap_screw, 8)` | Screw M4 cap x 8mm |
| 12 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm | | 8 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
| 8 | `washer(M4_washer)` | Washer M4 x 9mm x 0.8mm | | 13 | `washer(M4_washer)` | Washer M4 x 9mm x 0.8mm |
<a href="#top">Top</a> <a href="#top">Top</a>

View File

@@ -22,7 +22,7 @@ include <../vitamins/psus.scad>
use <../utils/layout.scad> use <../utils/layout.scad>
module psus() module psus()
layout([for(p = psus) psu_width(p)], 10) let(p = psus[$i]) layout([for(p = psus) atx_psu(p) ? psu_length(p) : psu_width(p)], 10) let(p = psus[$i])
rotate(atx_psu(p) ? 0 : 90) { rotate(atx_psu(p) ? 0 : 90) {
psu(p); psu(p);
@@ -31,5 +31,10 @@ module psus()
screw_and_washer(psu_screw(p), 8); screw_and_washer(psu_screw(p), 8);
} }
if($preview) if($preview) {
psus(); psus();
for(p = psus_not_shown)
hidden()
psu(p);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 KiB

After

Width:  |  Height:  |  Size: 251 KiB

View File

@@ -138,6 +138,6 @@ module extrusion(type, length, center = true, cornerHole = false) { //! Draw the
vitamin(str("extrusion(", type[0], ", ", length, arg(cornerHole, false, "cornerHole"), "): Extrusion ", type[0], " x ", length, "mm")); vitamin(str("extrusion(", type[0], ", ", length, arg(cornerHole, false, "cornerHole"), "): Extrusion ", type[0], " x ", length, "mm"));
color(grey(90)) color(grey(90))
linear_extrude(length, center = center) linear_extrude(length, center = center, convexity = 8)
extrusion_cross_section(type, cornerHole); extrusion_cross_section(type, cornerHole);
} }

View File

@@ -203,9 +203,10 @@ module iec(type) { //! Draw specified IEC connector
function iec_spade_depth(type) = iec_depth(type) + max([for(spade = iec_spades(type)) spade[1]]); function iec_spade_depth(type) = iec_depth(type) + max([for(spade = iec_spades(type)) spade[1]]);
module iec_screw_positions(type) //! Position children at the screw holes module iec_screw_positions(type) //! Position children at the screw holes
for(side = [-1, 1]) if(iec_pitch(type))
translate([side * iec_pitch(type) / 2, 0]) for(side = [-1, 1])
children(); translate([side * iec_pitch(type) / 2, 0])
children();
module iec_holes(type, h = 100, poly = false, horizontal = false, insert = false) { //! Drill the required panel holes module iec_holes(type, h = 100, poly = false, horizontal = false, insert = false) { //! Drill the required panel holes
clearance = 0.2; clearance = 0.2;

View File

@@ -59,7 +59,8 @@ IEC_320_C14_switched_fused_inlet = ["IEC_320_C14_switched_fused_inlet", "IEC320
M3_cs_cap_screw, 40, 27, 16,46.8,3,28, 48, 2.4, 1.0, 33, 57, 4, 3.0, 48,16.5, iec320c14FusedSwitchedSpades, false ]; M3_cs_cap_screw, 40, 27, 16,46.8,3,28, 48, 2.4, 1.0, 33, 57, 4, 3.0, 48,16.5, iec320c14FusedSwitchedSpades, false ];
IEC_inlet = ["IEC_inlet", "IEC inlet", M3_cs_cap_screw, 40, 28, 18, 20, 3, 28, 20.5, 4, 2.5, 37, 23, 1, 2.5, 48, 14, inlet_spades, false ]; IEC_inlet = ["IEC_inlet", "IEC inlet", M3_cs_cap_screw, 40, 28, 18, 20, 3, 28, 20.5, 4, 2.5, 37, 23, 1, 2.5, 48, 14, inlet_spades, false ];
IEC_inlet_atx = ["IEC_inlet_atx", "IEC inlet for ATX", M3_cs_cap_screw, 40, 27, 18, 19, 3, 30.5, 22, 2, 2.0, 30.5, 22, 2, 4.0, 50, 15, atx_spades, false ]; IEC_inlet_atx = ["IEC_inlet_atx", "IEC inlet for ATX", M3_cs_cap_screw, 40, 27, 18, 19, 3, 30.5, 22, 2, 2.0, 30.5, 22, 2, 4.0, 50, 15, atx_spades, false ];
IEC_inlet_atx2 = ["IEC_inlet_atx2", "IEC pressfit inlet for ATX", M3_cs_cap_screw, 0, 27, 18, 19, 3, 30.5, 22, 1, 0, 30.5, 22, 1, 4.0, 50, 15, atx_spades, false ]; // lugless
IEC_outlet = ["IEC_outlet", "IEC outlet RS 811-7193", M3_cs_cap_screw, 40, 32, 18, 24, 3, 28, 20.5, 2, 0.0, 29, 29, 2, 2.8, 50, 23, outlet_spades, true ]; IEC_outlet = ["IEC_outlet", "IEC outlet RS 811-7193", M3_cs_cap_screw, 40, 32, 18, 24, 3, 28, 20.5, 2, 0.0, 29, 29, 2, 2.8, 50, 23, outlet_spades, true ];
iecs = [IEC_inlet, IEC_inlet_atx, IEC_fused_inlet, IEC_fused_inlet2, IEC_320_C14_switched_fused_inlet, IEC_outlet]; iecs = [IEC_inlet_atx2, IEC_inlet, IEC_inlet_atx, IEC_fused_inlet, IEC_fused_inlet2, IEC_320_C14_switched_fused_inlet, IEC_outlet];
use <iec.scad> use <iec.scad>

View File

@@ -124,19 +124,23 @@ function psu_face_transform(type, face) = //! Returns a transformation
translations = [h / 2, h / 2, l / 2 - left, l / 2 - right, w / 2, w / 2] translations = [h / 2, h / 2, l / 2 - left, l / 2 - right, w / 2, w / 2]
) translate([0, 0, h / 2]) * rotate(rotations[face]) * translate([0, 0, translations[face]]); ) translate([0, 0, h / 2]) * rotate(rotations[face]) * translate([0, 0, translations[face]]);
grill_hole = 4.5; module psu_grill(width, height, grill_hole = 4.5, grill_gap = 1.5, fn = 0, avoid = []) {
grill_gap = 1.5;
module psu_grill(width, height) {
nx = floor(width / (grill_hole + grill_gap)); nx = floor(width / (grill_hole + grill_gap));
xpitch = width / nx; xpitch = width / nx;
ny = floor(height / ((grill_hole + grill_gap) * cos(30))); ny = floor(height / ((grill_hole + grill_gap) * cos(30)));
ypitch = height / ny; 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;
function in(regions, x, y) = [for(r = regions) if(x >= r[0].x && x <= r[1].x && y >= r[0].y && y <= r[1].y) true];
for(y = [0 : ny - 1], x = [0 : nx - 1 - (y % 2)]) { for(y = [0 : ny - 1], x = [0 : nx - 1 - (y % 2)]) {
x = -width / 2 + (x + 0.5 + (y % 2) / 2) * xpitch; x = -width / 2 + (x + 0.5 + (y % 2) / 2) * xpitch;
y = -height / 2 + (y + 0.5) * ypitch; y = -height / 2 + (y + 0.5) * ypitch;
translate([x, y]) if(!avoid || !in(avoid, x, y))
circle(d = grill_hole); translate([x, y])
rotate(30)
circle(r, $fn = fn);
} }
} }
@@ -185,12 +189,18 @@ module psu(type) { //! Draw a power supply
translate(h) translate(h)
drill(screw_pilot_hole(psu_screw(type)), 0); drill(screw_pilot_hole(psu_screw(type)), 0);
if(psu_face_grill(f)) { 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; mx = 6;
my1 = i == f_top && psu_face_grill(faces[f_back]) ? 0 : 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; my2 = i == f_back && psu_face_grill(faces[f_top]) ? 0 : 6;
translate([0, (my2 - my1) / 2]) translate([0, (my2 - my1) / 2])
psu_grill(xw - 2 * mx, yw - my1 - my2); psu_grill(xw - 2 * mx, yw - my1 - my2, grill_hole = hole, grill_gap = gap, fn = fn, avoid = avoid);
} }
if(fan) if(fan)
translate([fan.x, fan.y]) intersection() { translate([fan.x, fan.y]) intersection() {
@@ -234,7 +244,7 @@ module psu(type) { //! Draw a power supply
} }
if(iec) if(iec)
translate([iec.x, iec.y]) translate([iec.x, iec.y, t])
rotate(iec.z) rotate(iec.z)
iec_assembly(iec[3], t); iec_assembly(iec[3], t);

View File

@@ -68,6 +68,29 @@ ATX500 =
[": IEC mains lead"] [": 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, [],
[
[[], 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.x, -p.y, 5, 5],
[-p.x, p.y, 5, 5],
[p.x, 0, 9, 100],
[p.x, -p.y, 17, 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]],
[[], 0.5, []],
],
[": IEC mains lead"]
];
KY240W = KY240W =
["KY240W", "KY-240W-12-L", 199, 110, 50, M3_cap_screw, M3_clearance_radius, false, 0, 0, [], ["KY240W", "KY-240W-12-L", 199, 110, 50, M3_cap_screw, M3_clearance_radius, false, 0, 0, [],
[ [
@@ -75,7 +98,6 @@ KY240W =
[ 199 / 2 - 12, 110 / 2 - 9 ], [ 199 / 2 - 12, 110 / 2 - 9 ],
[ 199 / 2 - 138, 110 / 2 - 93], [ 199 / 2 - 138, 110 / 2 - 93],
[ 199 / 2 - 138, 110 / 2 - 9 ]]] [ 199 / 2 - 138, 110 / 2 - 9 ]]]
], ],
[] []
]; ];
@@ -179,6 +201,8 @@ External =
[": IEC mains lead"] [": IEC mains lead"]
]; ];
psus = [PD_150_12, S_250_48, S_300_12, ATX500, KY240W]; psus = [PD_150_12, S_250_48, S_300_12, ATX300, ATX500];
psus_not_shown = [KY240W];
use <psu.scad> use <psu.scad>

View File

@@ -62,7 +62,9 @@ function screw_shorter_than(x) = x >= 20 ? floor(x / 5) * 5 : //! Returns the le
x >= 10 ? 10 : x >= 10 ? 10 :
x >= 8 ? 8 : x >= 8 ? 8 :
x >= 6 ? 6 : x >= 6 ? 6 :
5; x >= 5 ? 5 :
x >= 4 ? 4 :
3;
function screw_length(screw, thickness, washers, insert = false, nyloc = false, nut = false, longer = false) = //! Returns the length of the longest or shortest screw that will got through `thickness` and `washers` and possibly an `insert`, `nut` or `nyloc` function screw_length(screw, thickness, washers, insert = false, nyloc = false, nut = false, longer = false) = //! Returns the length of the longest or shortest screw that will got through `thickness` and `washers` and possibly an `insert`, `nut` or `nyloc`
let(washer = washers ? washers * washer_thickness(screw_washer(screw)) : 0, let(washer = washers ? washers * washer_thickness(screw_washer(screw)) : 0,