1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-09-03 20:32:35 +02:00

Compare commits

...

27 Commits

Author SHA1 Message Date
Chris Palmer
f5528c5a9a Single 7_segment objects can now have multiple digits.
This is deduced from the digit size compared to the overall size.
The decimal point is now suppressed if there are not enough pins.
Added 02531A and 02352A 3 digit displays.
2021-10-26 12:27:22 +01:00
Chris Palmer
09bce09a85 Typo 2021-10-26 08:47:35 +01:00
Chris Palmer
389e2f9c2e Updated changelog. 2021-10-24 13:52:47 +01:00
Chris Palmer
c35e263113 Merge branch 'martinbudden-magnet_name' 2021-10-24 13:50:17 +01:00
Chris Palmer
bad33da95e Updated images and readme. 2021-10-24 13:49:21 +01:00
Chris Palmer
f727e1d27d Merge branch 'magnet_name' of https://github.com/martinbudden/NopSCADlib into martinbudden-magnet_name 2021-10-24 13:36:33 +01:00
Chris Palmer
5ddd9f6324 Updated changelog. 2021-10-24 13:35:39 +01:00
Chris Palmer
f5d0bfb6c8 Fixed drill center parameter in poly_drill(). 2021-10-24 13:33:51 +01:00
Chris Palmer
b2117fa99a atx_psu_cutout(type) now parametric and can be shown in the test.
ATX300 PSU now has a correct cutout and more accurate grill holes.
The four margins around grill holes can now be specified.
2021-10-24 13:32:46 +01:00
Chris Palmer
6687a4a7c6 Added jack_4mm_flange_radius(). 2021-10-24 13:24:25 +01:00
Chris Palmer
8524ddd34d Foot now lowered by squeeze distance so the washer is visible. 2021-10-24 13:23:45 +01:00
Martin Budden
427ef610de Allowed naming of magnets. Added radial encoder magnet. 2021-10-21 10:37:56 +01:00
Chris Palmer
c8869fc415 Updated changelog. 2021-10-20 20:38:12 +01:00
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
Chris Palmer
5f72a12125 Nuts shown on jacks and fuseholders only shown threaded when exploded. 2021-10-06 07:32:50 +01:00
Chris Palmer
82502eb470 Added pot_nut() module to draw potentiometer nuts and washers. 2021-10-06 07:31:47 +01:00
Chris Palmer
b541298eae 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-05 12:33:55 +01:00
Chris Palmer
9884160ed5 Updated the gallery 2021-10-02 20:45:15 +01:00
Martin Budden
046c475e18 Set convexity to 8 for linear_extrude of extrusion. 2021-10-02 09:20:51 +01:00
Chris Palmer
7b111c016a Updated changelog. 2021-10-01 12:37:49 +01:00
37 changed files with 338 additions and 124 deletions

View File

@@ -3,6 +3,56 @@
This changelog is generated by `changelog.py` using manually added semantic version tags to classify commits as breaking changes, additions or fixes.
### [v17.5.0](https://github.com/nophead/NopSCADlib/releases/tag/v17.5.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v17.4.0...v17.5.0 "diff with v17.4.0")
* 2021-10-24 [`bad33da`](https://github.com/nophead/NopSCADlib/commit/bad33da95eb3b20ccbb6e4906dccfe51e8f4372c "show commit") [C.P.](# "Chris Palmer") Updated images and readme.
* 2021-10-21 [`427ef61`](https://github.com/nophead/NopSCADlib/commit/427ef610def6ef2744d565329069719e485a500e "show commit") [M.B.](# "Martin Budden") Allowed naming of magnets. Added radial encoder magnet.
### [v17.4.0](https://github.com/nophead/NopSCADlib/releases/tag/v17.4.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v17.3.0...v17.4.0 "diff with v17.3.0")
* 2021-10-24 [`f5d0bfb`](https://github.com/nophead/NopSCADlib/commit/f5d0bfb6c80111399f5fa2aeb8bab5bab9101285 "show commit") [C.P.](# "Chris Palmer") Fixed drill `center` parameter in `poly_drill()`.
* 2021-10-24 [`b2117fa`](https://github.com/nophead/NopSCADlib/commit/b2117fa99a57341f9c93eed97c392c18173aa73c "show commit") [C.P.](# "Chris Palmer") `atx_psu_cutout(type)` now parametric and can be shown in the test.
ATX300 PSU now has a correct cutout and more accurate grill holes.
The four margins around grill holes can now be specified.
* 2021-10-24 [`6687a4a`](https://github.com/nophead/NopSCADlib/commit/6687a4a7c62d526a5f376db903dcd74c4fb8a25c "show commit") [C.P.](# "Chris Palmer") Added `jack_4mm_flange_radius()`.
* 2021-10-24 [`8524ddd`](https://github.com/nophead/NopSCADlib/commit/8524ddd34dd93d0bf5ddf538984809b8f0f8c986 "show commit") [C.P.](# "Chris Palmer") Foot now lowered by squeeze distance so the washer is visible.
### [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.
#### [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")
* 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.
* 2021-10-01 [`042d809`](https://github.com/nophead/NopSCADlib/commit/042d809ed056ba55c32f1d850b81dcf559fe9134 "show commit") [C.P.](# "Chris Palmer") Resistor and thermistor wires made more round.
* 2021-10-01 [`3864839`](https://github.com/nophead/NopSCADlib/commit/3864839e521eb64189cba8453ea8835d6ffadd75 "show commit") [C.P.](# "Chris Palmer") Fixed encoder breakout descripion typo.
* 2021-10-01 [`2ba2c2c`](https://github.com/nophead/NopSCADlib/commit/2ba2c2c115d4ab6c2371c662a3e54d7c77aa7785 "show commit") [C.P.](# "Chris Palmer") Removed some unused dependencies.
## [v17.0.0](https://github.com/nophead/NopSCADlib/releases/tag/v17.0.0 "show release") Breaking Changes [...](https://github.com/nophead/NopSCADlib/compare/v16.2.0...v17.0.0 "diff with v16.2.0")
* 2021-09-28 [`a5c4bf0`](https://github.com/nophead/NopSCADlib/commit/a5c4bf05adbf53cb7eb113db1139b65eb616a2e0 "show commit") [M.B.](# "Martin Budden") Added hot end style string literals following discussion.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 121 KiB

BIN
gallery/IOT_LOAD.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 287 KiB

After

Width:  |  Height:  |  Size: 287 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 121 KiB

BIN
gallery/PSU_cover.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

BIN
gallery/PotBox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 KiB

After

Width:  |  Height:  |  Size: 202 KiB

View File

@@ -25,6 +25,11 @@ WiFi controllable PSU
![](IOT_50V_PSU.png)
## IOT LOAD
WiFi controllable programmable load
![](IOT_LOAD.png)
## Lab ATX PSU
Bench power supply built around an ATX PSU.
@@ -65,6 +70,16 @@ Mains isolated and variable supply with metering.
## PSU Cover
A base and shroud to make PSU safe to sit on a desk
![](PSU_cover.png)
## PotBox
Potentiometer box with course and fine controls and three 4mm binding posts
![](PotBox.png)
## SunBot
A solar tracker to keep a solar panel pointing at the sun.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 932 KiB

After

Width:  |  Height:  |  Size: 944 KiB

View File

@@ -67,18 +67,19 @@ module foot(type = foot) { //! Generate STL
}
}
module foot_assembly(t = 0, type = foot, flip = false) { //! Assembly with fasteners in place for specified sheet thickness
module foot_assembly(t = 0, type = foot, flip = false, no_washer = false) { //! Assembly with fasteners in place for specified sheet thickness
screw = foot_screw(type);
nut = screw_nut(screw);
squeeze = 0.5;
screw_length = screw_length(screw, foot_thickness(type) + t - squeeze, 2, nyloc = true);
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)
translate_z(foot_thickness(type))
translate_z(foot_thickness(type) - squeeze)
if(flip)
nut_and_washer(nut, true);
else
@@ -87,9 +88,15 @@ module foot_assembly(t = 0, type = foot, flip = false) { //! Assembly with faste
if(t)
translate_z(t)
if(flip)
screw_and_washer(screw, screw_length);
if(no_washer)
screw(screw, screw_length);
else
screw_and_washer(screw, screw_length);
else
nut_and_washer(nut, true);
if(no_washer)
nut(nut, true);
else
nut_and_washer(nut, true);
}
module insert_foot(type = insert_foot) { //! Generate STL for foot with insert

View File

@@ -52,7 +52,10 @@ A list of changes classified as breaking, additions or fixes is maintained in [C
---
<a name="7_segments"></a>
## 7_segments
7 Segment displays
7 Segment displays.
Can be single digits stacked side by side or can be multiple digits in one unit. This is determined by the overall width compared to the width of a digit.
Presence of a decimal point is determined by the number of pins. Its position is determined by a heuristic.
[vitamins/7_segments.scad](vitamins/7_segments.scad) Object definitions.
@@ -63,7 +66,7 @@ A list of changes classified as breaking, additions or fixes is maintained in [C
### Properties
| Function | Description |
|:--- |:--- |
| `7_segment_digit_size(type)` | Size of the actual digit and segemnt width and angle |
| `7_segment_digit_size(type)` | Size of the actual digit and segment width and angle |
| `7_segment_pin_pitch(type)` | x and y pin pitches and pin diameter |
| `7_segment_pins(type)` | None |
| `7_segment_size(type)` | Size of the body |
@@ -1454,6 +1457,7 @@ IEC mains inlets and outlet.
| 1 | `iec(IEC_inlet)` | IEC inlet |
| 1 | `iec(IEC_inlet_atx)` | IEC inlet for ATX |
| 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 |
| 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 |
@@ -1526,6 +1530,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 |
@@ -1879,6 +1884,7 @@ Cylindrical and ring magnets.
|:--- |:--- |
| `magnet_h(type)` | Height |
| `magnet_id(type)` | Inside diameter if a ring |
| `magnet_name(type)` | Name |
| `magnet_od(type)` | Outer diameter |
| `magnet_r(type)` | Corner radius |
@@ -1892,9 +1898,10 @@ Cylindrical and ring magnets.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `magnet(MAG484)` | Magnet 6.35mm diameter, 6.35mm high, 3.175mm bore |
| 1 | `magnet(MAG8x4x4p2)` | Magnet 8mm diameter, 4mm high, 4.2mm bore |
| 1 | `magnet(MAG5x8)` | Magnet 8mm diameter, 5mm high |
| 1 | `magnet(MAG484)` | Magnet, 6.35mm diameter, 6.35mm high, 3.175mm bore |
| 1 | `magnet(MAG8x4x4p2)` | Magnet, 8mm diameter, 4mm high, 4.2mm bore |
| 1 | `magnet(MAG5x8)` | Magnet, 8mm diameter, 5mm high |
| 1 | `magnet(MAGRE6x2p5)` | Radial encoder magnet, 6mm diameter, 2.5mm high |
<a href="#top">Top</a>
@@ -2799,6 +2806,7 @@ Potentiometers and rotary encoders
| `pot_face(type)` | Faceplate rib width, plate depth and plate height |
| `pot_gangs(type)` | Number of gangs for mult-gang pot |
| `pot_neck(type)` | Diameter and length of the shaft neck |
| `pot_nut(type)` | Across flat diameter and thickness of the nut |
| `pot_shaft(type)` | Diameter, flat diameter, length and flat/slot length and colour. If flat diameter is less than the radius then it is a slot width |
| `pot_spigot(type)` | Spigot width, length and height above the boss |
| `pot_spigot_x(type)` | Spigot offset from the shaft centre |
@@ -2806,16 +2814,18 @@ Potentiometers and rotary encoders
| `pot_thread_h(type)` | Height of threaded part |
| `pot_thread_p(type)` | Thread pritch |
| `pot_wafer(type)` | Width, diameter and thickness of the track wafer plus true if curved |
| `pot_washer(type)` | Outside diameter and thickness of the washer |
### Functions
| Function | Description |
|:--- |:--- |
| `pot_size(type)` | Get pot body dimensions |
| `pot_z(type)` | Ideal distance behind panel surface to get the nut on comfortably |
| `pot_z(type, washer = true)` | Ideal distance behind panel surface to get the nut and washer on comfortably |
### Modules
| Module | Description |
|:--- |:--- |
| `pot_nut(type, washer = true)` | Draw the nut for a potentiometer and possibly a washer |
| `potentiometer(type, thickness = 3, shaft_length = undef)` | Draw a potentiometer with nut spaced by specified thickness |
![potentiometers](tests/png/potentiometers.png)
@@ -2841,6 +2851,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 |
@@ -2876,7 +2887,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 |
@@ -2886,18 +2897,18 @@ Face order is bottom, top, left, right, front, back.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | | IEC mains lead |
| 2 | | IEC mains lead |
| 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(S_250_48)` | PSU S-250-48 |
| 1 | `psu(S_300_12)` | PSU S-300-12 |
| 4 | `screw(No632_pan_screw, 8)` | Screw 6-32 pan x 8mm |
| 4 | `screw(M3_cap_screw, 8)` | Screw M3 cap x 8mm |
| 9 | `screw(No632_pan_screw, 8)` | Screw 6-32 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 |
| 12 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
| 8 | `washer(M4_washer)` | Washer M4 x 9mm x 0.8mm |
| 8 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
| 13 | `washer(M4_washer)` | Washer M4 x 9mm x 0.8mm |
<a href="#top">Top</a>
@@ -5189,7 +5200,7 @@ inserts don't grip well in rubber.
|:--- |:--- |
| `fastened_insert_foot_assembly(t = 3, type = insert_foot)` | Assembly with fasteners in place for specified sheet thickness |
| `foot(type = foot)` | Generate STL |
| `foot_assembly(t = 0, type = foot, flip = false)` | Assembly with fasteners in place for specified sheet thickness |
| `foot_assembly(t = 0, type = foot, flip = false, no_washer = false)` | Assembly with fasteners in place for specified sheet thickness |
| `insert_foot(type = insert_foot)` | Generate STL for foot with insert |
| `insert_foot_assembly(type = insert_foot)` | Printed part with insert in place |

View File

@@ -21,9 +21,11 @@ use <../utils/layout.scad>
include <../vitamins/7_segments.scad>
function digits(s) = 7_segment_digits(s) < 2 ? 2 : 1;
module 7_segments()
layout([for(s = 7_segments) 7_segment_size(s).x * 2], 5) let(s = 7_segments[$i])
7_segment_digits(s, 2);
layout([for(s = 7_segments) 7_segment_size(s).x * digits(s)], 3) let(s = 7_segments[$i])
7_segment_digits(s, digits(s));
if($preview)
7_segments();

View File

@@ -16,20 +16,32 @@
// 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) 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) {
psu(p);
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)
if($preview) {
psus();
for(p = psus_not_shown)
hidden()
psu(p);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 116 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: 221 KiB

After

Width:  |  Height:  |  Size: 255 KiB

View File

@@ -23,9 +23,13 @@ include <../vitamins/potentiometers.scad>
module potentiometers()
layout([for(p = potentiometers) pot_size(p).x])
hflip()
hflip() {
potentiometer(potentiometers[$i], shaft_length = 30);
translate_z(-3)
pot_nut(potentiometers[$i]);
}
if($preview)
let($show_threads = true)
potentiometers();

View File

@@ -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);

View File

@@ -18,22 +18,33 @@
//
//
//! 7 Segment displays
//! 7 Segment displays.
//!
//! Can be single digits stacked side by side or can be multiple digits in one unit. This is determined by the overall width compared to the width of a digit.
//! Presence of a decimal point is determined by the number of pins. Its position is determined by a heuristic.
//
include <../utils/core/core.scad>
function 7_segment_size(type) = type[1]; //! Size of the body
function 7_segment_digit_size(type) = type[2]; //! Size of the actual digit and segemnt width and angle
function 7_segment_digit_size(type) = type[2]; //! Size of the actual digit and segment width and angle
function 7_segment_pins(type) = type[3]; //! [x, y] array of pins
function 7_segment_pin_pitch(type) = type[4]; //! x and y pin pitches and pin diameter
function 7_segment_digits(type) = let(d = 7_segment_digit_size(type)) floor(7_segment_size(type).x / (d.x + d.y * tan(d[3])));
module 7_segment_digit(type, colour = grey(95), pin_length = 6.4) { //! Draw the specified 7 segment digit
size = 7_segment_size(type);
digit = 7_segment_digit_size(type);
pins = 7_segment_pins(type);
pin_pitch = 7_segment_pin_pitch(type);
t = digit[2];
a = digit[3];
digits = 7_segment_digits(type);
pitch = size.x / digits;
has_dp = (pins.x * pins.y) > 7 + digits;
color(grey(95))
linear_extrude(size.z)
square([size.x - 0.1, size.y], center = true);
@@ -43,48 +54,48 @@ module 7_segment_digit(type, colour = grey(95), pin_length = 6.4) { //! Draw the
cube([size.x - 0.1, size.y, eps], center = true);
color(colour)
translate_z(size.z)
linear_extrude(2 * eps) {
t = digit[2];
a = digit[3];
sq = [digit.x - 2 * t, (digit.y - 3 * t) / 2];
for(i = [0 : digits - 1])
translate([(i - (digits - 1) / 2) * pitch, 0, size.z])
linear_extrude(2 * eps) {
sq = [digit.x - 2 * t, (digit.y - 3 * t) / 2];
multmatrix([ // Skew
[1, tan(a), 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]
])
difference() {
square([digit.x, digit.y], center = true);
multmatrix([ // Skew
[1, tan(a), 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]
])
difference() {
square([digit.x, digit.y], center = true);
for(y = [-1, 1], x = [-1, 1]) {
translate([0, y * (t + sq.y) / 2])
square(sq, center = true);
for(y = [-1, 1], x = [-1, 1]) {
translate([0, y * (t + sq.y) / 2])
square(sq, center = true);
translate([x * digit.x / 2, y * digit.y / 2])
rotate(-45 * x * y) {
square([10, t], center = true);
translate([x * digit.x / 2, y * digit.y / 2])
rotate(-45 * x * y) {
square([10, t], center = true);
square([t / 5, 10], center = true);
}
square([t / 5, 10], center = true);
}
translate([x * (digit.x - t) / 2, 0])
rotate(45) {
square([t / 5, t * 2], center = true);
translate([x * (digit.x - t) / 2, 0])
rotate(45) {
square([t / 5, t * 2], center = true);
square([t * 2, t / 5], center = true);
square([t * 2, t / 5], center = true);
translate([x * t / 2, -x * t / 2])
square([t, t], center = true);
}
translate([x * t / 2, -x * t / 2])
square([t, t], center = true);
}
}
}
r = 1.25 * t / 2;
if(has_dp)
translate([max(digit.x / 2 + digit.y / 2 * tan(a) - r, digit.x / 2 - digit.y /2 * tan(a) + r * 1.25), -digit.y / 2 + r])
circle(r);
}
r = 1.25 * t / 2;
translate([digit.x / 2 - r + digit.y / 2 * tan(a), -digit.y / 2 + r])
circle(r);
}
color(silver)
translate_z(-pin_length)

View File

@@ -21,8 +21,10 @@
//! 7 Segment displays
//
02531A = ["02531A", [15.0, 8, 4.0], [3.5, 6.2, 0.7, 5], [5, 2], [inch(0.1), inch(0.1), 0.45]];
02352A = ["02352A", [15.0, 8, 4.0], [3.5, 6.2, 0.6, 5], [6, 2], [inch(0.1), 5.52, 0.45]];
WT5011BSR = ["WT5011BSR", [12.7, 19, 8.2], [7.2, 12.7, 1.2, 10], [5, 2], [inch(0.1), inch(0.6), 0.4]];
7_segments = [ WT5011BSR ];
7_segments = [02531A, 02352A, WT5011BSR];
use <7_segment.scad>

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"));
color(grey(90))
linear_extrude(length, center = center)
linear_extrude(length, center = center, convexity = 8)
extrusion_cross_section(type, cornerHole);
}

View File

@@ -68,7 +68,7 @@ module fuseholder(thickness) { //! Fuseholder with nut in place for specified pa
colour = grey(40);
vflip()
translate_z(thickness)
explode(height) {
explode(height, explode_children = true) {
color(colour) {
tube(or = nut_d / 2, ir = thread_d / 2, h = nut_flange_t, center = false);
@@ -79,7 +79,7 @@ module fuseholder(thickness) { //! Fuseholder with nut in place for specified pa
circle(d = thread_d);
}
}
if(show_threads)
if(show_threads && exploded())
female_metric_thread(thread_d, thread_p, nut_t, false, colour = colour);
}
//

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]]);
module iec_screw_positions(type) //! Position children at the screw holes
for(side = [-1, 1])
translate([side * iec_pitch(type) / 2, 0])
children();
if(iec_pitch(type))
for(side = [-1, 1])
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
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 ];
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_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 ];
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>

View File

@@ -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]);
@@ -77,12 +78,12 @@ module jack_4mm(colour, thickness, display_colour = false) { //! Draw a 4mm jack
spade(spade4p8l, spade);
}
translate_z(-thickness)
explode(-length)
explode(-length, explode_children = true)
vflip() {
color(silver)
tube(ir = thread_d / 2, or = nut_d / 2, h = nut_t, center = false);
if(show_threads)
if(show_threads && exploded())
female_metric_thread(thread_d, thread_p, nut_t, false, colour = silver);
}
}

View File

@@ -22,10 +22,11 @@
//
include <../utils/core/core.scad>
function magnet_od(type) = type[1]; //! Outer diameter
function magnet_id(type) = type[2]; //! Inside diameter if a ring
function magnet_h(type) = type[3]; //! Height
function magnet_r(type) = type[4]; //! Corner radius
function magnet_name(type) = type[1]; //! Name
function magnet_od(type) = type[2]; //! Outer diameter
function magnet_id(type) = type[3]; //! Inside diameter if a ring
function magnet_h(type) = type[4]; //! Height
function magnet_r(type) = type[5]; //! Corner radius
module magnet(type) { //! Draw specified magnet
od = magnet_od(type);
@@ -33,7 +34,7 @@ module magnet(type) { //! Draw specified magnet
h = magnet_h(type);
r = magnet_r(type);
vitamin(str("magnet(", type[0], "): Magnet ", od, "mm diameter, ", h, "mm high", id ? str(", ", id, "mm bore") : "" ));
vitamin(str("magnet(", type[0], "): ", magnet_name(type), ", ", od, "mm diameter, ", h, "mm high", id ? str(", ", id, "mm bore") : "" ));
or = od / 2;
ir = id / 2;

View File

@@ -20,11 +20,12 @@
//! Cylindrical and ring magnets.
//
// od, id, h, r
MAG8x4x4p2 = ["MAG8x4x4p2", 8, 4.2, 4, 0.5];
MAG484 = ["MAG484", inch(1/4), inch(1/8), inch(1/4), 0.5];
MAG5x8 = ["MAG5x8", 8, 0, 5, 0.5];
// name, od, id, h, r
MAG8x4x4p2 = ["MAG8x4x4p2", "Magnet", 8, 4.2, 4, 0.5];
MAG484 = ["MAG484", "Magnet", inch(1/4), inch(1/8), inch(1/4), 0.5];
MAG5x8 = ["MAG5x8", "Magnet", 8, 0, 5, 0.5];
MAGRE6x2p5 = ["MAGRE6x2p5", "Radial encoder magnet", 6, 0, 2.5, 0.5];
magnets = [MAG8x4x4p2, MAG484, MAG5x8];
magnets = [MAG8x4x4p2, MAG484, MAG5x8, MAGRE6x2p5];
use <magnet.scad>

View File

@@ -40,12 +40,52 @@ function pot_spigot(type) = type[9]; //! Spigot width, length and height abov
function pot_spigot_x(type) = type[10]; //! Spigot offset from the shaft centre
function pot_shaft(type) = type[11]; //! Diameter, flat diameter, length and flat/slot length and colour. If flat diameter is less than the radius then it is a slot width
function pot_neck(type) = type[12]; //! Diameter and length of the shaft neck
function pot_nut(type) = type[13]; //! Across flat diameter and thickness of the nut
function pot_washer(type) = type[14]; //! Outside diameter and thickness of the washer
function pot_size(type) = let(d = pot_body(type)) len(d) > 3 ? [d.x , d.y, d.z] : [d.x, d.x, d.y]; //! Get pot body dimensions
function pot_z(type) = pot_thread_h(type) - pot_nut_t - pot_proud; //! Ideal distance behind panel surface to get the nut on comfortably
function pot_z(type, washer = true) = pot_thread_h(type) - pot_nut(type)[1] - pot_proud - (washer ? pot_washer(type)[1] : 0); //! Ideal distance behind panel surface to get the nut and washer on comfortably
function pot_spigot_r(type) = let(sp = pot_spigot(type)) sp.x > 2 * spigot_r ? spigot_r : 0;
module pot_nut(type, washer = true) { //! Draw the nut for a potentiometer and possibly a washer
nut = pot_nut(type);
washer = washer ? pot_washer(type) : false;
nut_z = washer ? washer[1] : 0;
thread_d = pot_thread_d(type);
vflip() explode(23, explode_children = true) {
if(washer)
color(washer[2])
linear_extrude(washer[1])
difference() {
circle(d = washer.x);
circle(d = thread_d);
serations = washer[3];
if(serations)
for(i = [1 : serations])
rotate(i * 360 / serations)
translate([thread_d / 2, 0])
square([(washer.x - thread_d) / 2, PI * thread_d / (2 * serations)], center = true);
}
if(nut)
color(nut[2])
translate_z(nut_z + exploded() * 10) {
linear_extrude(nut[1])
difference() {
circle(d = nut.x / cos(30), $fn = 6);
circle(d = thread_d);
}
if(show_threads && exploded())
female_metric_thread(thread_d, pot_thread_p(type), nut[1], center = false, colour = nut[2]);
}
}
}
module potentiometer(type, thickness = 3, shaft_length = undef) {//! Draw a potentiometer with nut spaced by specified thickness
bh = pot_boss_h(type);
s = pot_size(type);

View File

@@ -17,11 +17,11 @@
// If not, see <https://www.gnu.org/licenses/>.
//
//! Potentiometers and rotary encoders
// body h r face wafer gangs thread d pitch h boss h spigot w, l, h offset shaft d flat h flat h colour neck
imperial_pot_x2 = [[24, 22.5, 1.5], [5.7, 15.33, 0.8], [20, 28, 1.6, true], 2, inch(3/8), inch(1/32), 6.35, 13.6, 2.4, [1.12, 3.03, 2], 11, [6.27, 5.5, 44.3, 44.3, silver], [0, 0]];
imperial_pot = [[24, 12, 1.5], [5.7, 15.33, 0.8], [20, 28, 1.6, true], 1, inch(3/8), inch(1/32), 6.35, 13.6, 2.4, [1.12, 3.03, 2], 11, [6.27, 5.5, 44.3, 44.3, grey(95)], [0, 0]];
metric_pot = [[23, 11, 1.0], [0, 15.33, 0.8], [18, 27, 1.2, false], 1, 10, 0.75, 7.32, 13.9, 2.5, [1.12, 2.88, 1.26], 11, [6.27, 5.5, 43.8, 43.5, grey(50)], [0, 0]];
KY_040_encoder = [[12, 12, 6.5, 1.0], false, false, 1, 7, 0.75, 7, 0, 0, [0.4, 2, 0.8],5.8, [6, 4.5, 13, 10, grey(60)], [4, 0.5]];
// body h r face wafer gangs thread d pitch h boss h spigot w, l, h offset shaft d flat d shaft h flat h colour neck nut washer
imperial_pot_x2 = [[24, 22.5, 1.5], [5.7, 15.33, 0.8], [20, 28, 1.6, true], 2, inch(3/8), inch(1/32), 6.35, 13.6, 2.4, [1.12, 3.03, 2], 11, [6.27, 5.5, 44.3, 44.3, silver], [0, 0], [13.3, 2.4, brass], [17.4, 0.8, grey(20), 9]];
imperial_pot = [[24, 12, 1.5], [5.7, 15.33, 0.8], [20, 28, 1.6, true], 1, inch(3/8), inch(1/32), 6.35, 13.6, 2.4, [1.12, 3.03, 2], 11, [6.27, 5.5, 44.3, 44.3, grey(95)], [0, 0], [13.3, 2.4, brass], [17.4, 0.8, grey(20), 9]];
metric_pot = [[23, 11, 1.0], [0, 15.33, 0.8], [18, 27, 1.2, false], 1, 10, 0.75, 7.32, 13.9, 2.5, [1.12, 2.88, 1.26], 11, [6.27, 5.5, 43.8, 43.5, grey(50)], [0, 0], [12.8, 2, silver], [17.7, 0.8, grey(20), 10]];
KY_040_encoder = [[12, 12, 6.5, 1.0], false, false, 1, 7, 0.75, 7, 0, 0, [0.4, 2, 0.8],5.8, [6, 4.5, 13, 10, grey(60)], [4, 0.5],[9.8, 2.2, silver], [11.5, 0.4, silver]];
BTT_encoder = [[12, 11, 6, 0.5], false, false, 1, 6, 0.8, 4.5, 0, 0, false, 0, [5, 0.75, 9.5, 9, silver], [3, 0.5]];
potentiometers = [BTT_encoder, KY_040_encoder, metric_pot, imperial_pot, imperial_pot_x2];

View File

@@ -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
@@ -124,19 +125,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]
) translate([0, 0, h / 2]) * rotate(rotations[face]) * translate([0, 0, translations[face]]);
grill_hole = 4.5;
grill_gap = 1.5;
module psu_grill(width, height) {
nx = floor(width / (grill_hole + grill_gap));
module psu_grill(width, height, grill_hole = 4.5, grill_gap = 1.5, fn = 0, avoid = []) {
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;
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)]) {
x = -width / 2 + (x + 0.5 + (y % 2) / 2) * xpitch;
y = -height / 2 + (y + 0.5) * ypitch;
translate([x, y])
circle(d = grill_hole);
if(!avoid || !in(avoid, x, y))
translate([x, y])
rotate(30)
circle(r, $fn = fn);
}
}
@@ -185,12 +190,20 @@ module psu(type) { //! Draw a power supply
translate(h)
drill(screw_pilot_hole(psu_screw(type)), 0);
if(psu_face_grill(f)) {
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);
g = psu_face_grill(f);
if(g) {
list = is_list(g);
hole = list ? g[0] : 4.5;
gap = list ? g[1] : 1.5;
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() {
@@ -234,7 +247,7 @@ module psu(type) { //! Draw a power supply
}
if(iec)
translate([iec.x, iec.y])
translate([iec.x, iec.y, t])
rotate(iec.z)
iec_assembly(iec[3], t);
@@ -333,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]));
}

View File

@@ -62,12 +62,64 @@ 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.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.6, 6, [6.3, 7, 6.4, 5.5], [
[-p.x, -p.y, 5, 5],
[-p.x, p.y, 5, 5],
[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, 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"]
];
KY240W =
["KY240W", "KY-240W-12-L", 199, 110, 50, M3_cap_screw, M3_clearance_radius, false, 0, 0, [],
[
@@ -75,7 +127,6 @@ KY240W =
[ 199 / 2 - 12, 110 / 2 - 9 ],
[ 199 / 2 - 138, 110 / 2 - 93],
[ 199 / 2 - 138, 110 / 2 - 9 ]]]
],
[]
];
@@ -179,6 +230,8 @@ External =
[": 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>

View File

@@ -62,7 +62,9 @@ function screw_shorter_than(x) = x >= 20 ? floor(x / 5) * 5 : //! Returns the le
x >= 10 ? 10 :
x >= 8 ? 8 :
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`
let(washer = washers ? washers * washer_thickness(screw_washer(screw)) : 0,