Compare commits
50 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
f5d0bfb6c8 | ||
|
b2117fa99a | ||
|
6687a4a7c6 | ||
|
8524ddd34d | ||
|
c8869fc415 | ||
|
21c06667a3 | ||
|
d19fad3f9f | ||
|
172bfb16d8 | ||
|
491dbae13b | ||
|
99ebfffd2b | ||
|
f04486a040 | ||
|
42a7d222b5 | ||
|
598a01295f | ||
|
5f72a12125 | ||
|
82502eb470 | ||
|
b541298eae | ||
|
9884160ed5 | ||
|
046c475e18 | ||
|
7b111c016a | ||
|
38c973b316 | ||
|
042d809ed0 | ||
|
3864839e52 | ||
|
2ba2c2c115 | ||
|
e3716ce8f9 | ||
|
c4f24974ab | ||
|
61dae9c7a4 | ||
|
41a26c453c | ||
|
bab4c8e8af | ||
|
a5c4bf05ad | ||
|
a65add65ac | ||
|
c449dd0a24 | ||
|
f16f7ddb09 | ||
|
9b5ec6af1a | ||
|
50958b064d | ||
|
c37373c920 | ||
|
700f5a2205 | ||
|
4993c3e82d | ||
|
c6b280f0e8 | ||
|
6012787781 | ||
|
30db66034c | ||
|
d6f344be3d | ||
|
f6aa3b3426 | ||
|
91c8c7bf4d | ||
|
dc93b8dcdf | ||
|
c9c094248e | ||
|
119c2cb6f4 | ||
|
24b391578b | ||
|
ec49ce1a6c | ||
|
f0c25d37b0 | ||
|
588a1edf62 |
112
CHANGELOG.md
@@ -3,6 +3,118 @@
|
||||
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.
|
||||
|
||||
#### [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.
|
||||
|
||||
* 2021-09-28 [`a65add6`](https://github.com/nophead/NopSCADlib/commit/a65add65acdfeb97a657e03b9398d5376f497e85 "show commit") [M.B.](# "Martin Budden") Removed hotend global enums.
|
||||
|
||||
### [v16.2.0](https://github.com/nophead/NopSCADlib/releases/tag/v16.2.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v16.1.0...v16.2.0 "diff with v16.1.0")
|
||||
* 2021-09-29 [`bab4c8e`](https://github.com/nophead/NopSCADlib/commit/bab4c8e8afcc9e96ada5ae8d7636f3f203c36a2c "show commit") [C.P.](# "Chris Palmer") `TO247_size()` now also returns lead height and the length of the wide bit.
|
||||
TO247 leads fixed at 3.
|
||||
Lead length removed from TO220 and TO247 vitamin string.
|
||||
|
||||
### [v16.1.0](https://github.com/nophead/NopSCADlib/releases/tag/v16.1.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v16.0.3...v16.1.0 "diff with v16.0.3")
|
||||
* 2021-09-27 [`f16f7dd`](https://github.com/nophead/NopSCADlib/commit/f16f7ddb0943469a4e9aeb2aec9e6fc9e418c2dc "show commit") [C.P.](# "Chris Palmer") Images reverted to last OpenSCAD release versions.
|
||||
Mainly text spacing changes.
|
||||
|
||||
* 2021-09-27 [`9b5ec6a`](https://github.com/nophead/NopSCADlib/commit/9b5ec6af1aba313df6812a5313470ebb7e8fbdd7 "show commit") [C.P.](# "Chris Palmer") Fixed new `rounded_polygon` to work with last OpenSCAD release.
|
||||
Trainling commas in `let()`.
|
||||
|
||||
* 2021-09-27 [`50958b0`](https://github.com/nophead/NopSCADlib/commit/50958b064d5a6d5ca3fd6525a8c3d3a2c5b20199 "show commit") [C.P.](# "Chris Palmer") Added `$show_plugs` to show crude reprentations of housings on `pin_headers` and Molex KK headers.
|
||||
|
||||
* 2021-09-27 [`c37373c`](https://github.com/nophead/NopSCADlib/commit/c37373c920d3b438895ef535b0c06d0d00675609 "show commit") [C.P.](# "Chris Palmer") Added `TO247()` and `TO247_size()` to `component.scad`.
|
||||
|
||||
* 2021-09-27 [`700f5a2`](https://github.com/nophead/NopSCADlib/commit/700f5a2205173e12fad42df2f57d2c105608204e "show commit") [C.P.](# "Chris Palmer") `fanguard()` can now be made without screw holes to get just the grill.
|
||||
|
||||
* 2021-09-27 [`4993c3e`](https://github.com/nophead/NopSCADlib/commit/4993c3e82deffd933a81e39b670bb14886790b5f "show commit") [C.P.](# "Chris Palmer") Module blurb parenthesis parsing is now greedy to handle args that default to function calls.
|
||||
This means that library modules cannot be one liners.
|
||||
|
||||
* 2021-09-26 [`c6b280f`](https://github.com/nophead/NopSCADlib/commit/c6b280f0e8d6780394bf63fc7efa9c1075589abe "show commit") [C.P.](# "Chris Palmer") `_box_assembly()` fix for corners `=` 0.
|
||||
|
||||
* 2021-09-26 [`6012787`](https://github.com/nophead/NopSCADlib/commit/601278778147c66288049b768be291c714fde6e0 "show commit") [C.P.](# "Chris Palmer") Added `jack_4mm_plastic()`.
|
||||
|
||||
* 2021-09-26 [`30db660`](https://github.com/nophead/NopSCADlib/commit/30db66034c7fedf0f07b542908a07f73efd9dc08 "show commit") [C.P.](# "Chris Palmer") `Rounded_polygons` are now generated by a function returning a point list.
|
||||
The module version simply passes this to polygon.
|
||||
The arcs now sections of a `circle4n()` rather than a `circle()`.
|
||||
|
||||
#### [v16.0.3](https://github.com/nophead/NopSCADlib/releases/tag/v16.0.3 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v16.0.2...v16.0.3 "diff with v16.0.2")
|
||||
* 2021-09-16 [`f6aa3b3`](https://github.com/nophead/NopSCADlib/commit/f6aa3b342650062cd8947aa36e2ae93242752d4b "show commit") [C.P.](# "Chris Palmer") `fuseholder_hole()` now makes a `poly_hole` when `cnc_bit_r` is 0.
|
||||
|
||||
* 2021-09-16 [`91c8c7b`](https://github.com/nophead/NopSCADlib/commit/91c8c7bf4d67cf93c47f41cd5984cb23271205cb "show commit") [C.P.](# "Chris Palmer") `cnc_bit_r` is now set to zero in stl(), so holes are suitable for 3D printing rather than routing.
|
||||
|
||||
* 2021-09-16 [`dc93b8d`](https://github.com/nophead/NopSCADlib/commit/dc93b8dcdf484dbb50cdee5908a91a3f322e6610 "show commit") [C.P.](# "Chris Palmer") Added platters and extrusion overrides to the example project.
|
||||
|
||||
#### [v16.0.2](https://github.com/nophead/NopSCADlib/releases/tag/v16.0.2 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v16.0.1...v16.0.2 "diff with v16.0.1")
|
||||
* 2021-09-14 [`119c2cb`](https://github.com/nophead/NopSCADlib/commit/119c2cb6f46ea00c9238da6d98305e6479f0452c "show commit") [C.P.](# "Chris Palmer") Can now make perfboards with screws holes only at one end.
|
||||
`I.e`. for making models of chopped down boards.
|
||||
|
||||
* 2021-09-14 [`24b3915`](https://github.com/nophead/NopSCADlib/commit/24b391578b1b68f1c65eb9c48458151a80ceaf5f "show commit") [C.P.](# "Chris Palmer") Fixed recently created bug trying to delete non-existent thumbnail diffs.
|
||||
|
||||
#### [v16.0.1](https://github.com/nophead/NopSCADlib/releases/tag/v16.0.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v16.0.0...v16.0.1 "diff with v16.0.0")
|
||||
* 2021-09-12 [`f0c25d3`](https://github.com/nophead/NopSCADlib/commit/f0c25d37b0c19f76c3f3e0b4d9cabc7587f9efb5 "show commit") [C.P.](# "Chris Palmer") Workarounds for bugs in the OpenSCAD snapshots.
|
||||
|
||||
## [v16.0.0](https://github.com/nophead/NopSCADlib/releases/tag/v16.0.0 "show release") Breaking Changes [...](https://github.com/nophead/NopSCADlib/compare/v15.25.0...v16.0.0 "diff with v15.25.0")
|
||||
* 2021-09-11 [`3299aad`](https://github.com/nophead/NopSCADlib/commit/3299aad5c83d1fe21d3bdddd1450f8de19078d13 "show commit") [C.P.](# "Chris Palmer") Parametric potentiometers added, changes PCB "potentiometer" parameters.
|
||||
The first one is now the type that defaults to the previous BigTreeTech version.
|
||||
The second parameter is the shaft length override.
|
||||
|
||||
* Added `ESP32_DOIT_V1,` ArduinoNano and `KY_040` breakout PCBs.
|
||||
|
||||
* 2021-09-11 [`74c52aa`](https://github.com/nophead/NopSCADlib/commit/74c52aac0428995930b4af562a480025003b992d "show commit") [C.P.](# "Chris Palmer") Can now make perfboard without screw holes.
|
||||
Fixed missing items from last commit.
|
||||
|
||||
* 2021-09-11 [`726d9ed`](https://github.com/nophead/NopSCADlib/commit/726d9ed2dc921b5a7ef8c5b0fa6b17628f706bf8 "show commit") [C.P.](# "Chris Palmer") Can now draw right angle Molex KK connectors and can skip pins to allow high voltage.
|
||||
|
||||
* 2021-09-11 [`8a838dd`](https://github.com/nophead/NopSCADlib/commit/8a838dd1ceaac7d595aea47494cb28b9a424ee8a "show commit") [C.P.](# "Chris Palmer") Added `pcb_grid_components()` module for placing parts on a perfboard.
|
||||
|
||||
* 2021-09-11 [`181c6ac`](https://github.com/nophead/NopSCADlib/commit/181c6ac6248e7db6204b6d461f122e719492b0cc "show commit") [C.P.](# "Chris Palmer") Added `vero_pin` PCB component.
|
||||
|
||||
* 2021-09-11 [`e952aa7`](https://github.com/nophead/NopSCADlib/commit/e952aa7840cf4f3765c518a481d32f582bef27b4 "show commit") [C.P.](# "Chris Palmer") PCB chip component can now be round if width is zero to fake round buttons.
|
||||
|
||||
* 2021-09-11 [`466ee31`](https://github.com/nophead/NopSCADlib/commit/466ee31e10e670ff35e22429084a34612f821f7d "show commit") [C.P.](# "Chris Palmer") Added `Jack_4mm_shielded_nut_radius()`.
|
||||
|
||||
* 2021-09-11 [`4c926c5`](https://github.com/nophead/NopSCADlib/commit/4c926c529b199dbe589fb0c43f323db94ffe5597 "show commit") [C.P.](# "Chris Palmer") Fixed axial lead min pitch bug.
|
||||
|
||||
* 2021-09-11 [`edb1ecc`](https://github.com/nophead/NopSCADlib/commit/edb1eccbf156ff4b06723b18f832637328b1c3e0 "show commit") [C.P.](# "Chris Palmer") TFT128x160 LCD display added.
|
||||
|
||||
* 2021-09-11 [`061812c`](https://github.com/nophead/NopSCADlib/commit/061812cc8bc51e5a957d7d3acaffd9bcda14cc15 "show commit") [C.P.](# "Chris Palmer") PMMA1p25 sheet added.
|
||||
|
||||
* 2021-09-11 [`ce0c97b`](https://github.com/nophead/NopSCADlib/commit/ce0c97b45e6e501554e66bcd4140d4dd3f532a1c "show commit") [C.P.](# "Chris Palmer") `7_segment` displays added as PCB component.
|
||||
|
||||
### [v15.25.0](https://github.com/nophead/NopSCADlib/releases/tag/v15.25.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v15.24.0...v15.25.0 "diff with v15.24.0")
|
||||
* 2021-09-05 [`2166a9b`](https://github.com/nophead/NopSCADlib/commit/2166a9be6a6fc75b06f0051971606cd181079e15 "show commit") [C.P.](# "Chris Palmer") `extrusion_corner_bracket_assembly()` and `extrusion_inner_corner_bracket()` can now be passed the extrusion type.
|
||||
E2020t and E4040t thinner extrusions added to work with the brackets.
|
||||
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 108 KiB |
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 105 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 137 KiB |
Before Width: | Height: | Size: 121 KiB After Width: | Height: | Size: 121 KiB |
Before Width: | Height: | Size: 201 KiB After Width: | Height: | Size: 201 KiB |
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 123 KiB |
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 135 KiB |
11
examples/MainsBreakOutBox/platters/all.scad
Normal file
@@ -0,0 +1,11 @@
|
||||
include <NopSCADlib/core.scad>
|
||||
|
||||
*use_stl("socket_box"); // Importing the STL gives a CGAL error although NetFabb finds nothing wrong with it.
|
||||
|
||||
use <../scad/bob_main.scad>
|
||||
|
||||
render() socket_box_stl();
|
||||
|
||||
for(i = [0 : 3])
|
||||
translate([i * 25 - 1.5 * 25, -70])
|
||||
use_stl("foot");
|
@@ -31,7 +31,8 @@
|
||||
//! while its earth is disconnected. Don't be tempted to float the earth of an oscilloscope this way, use a mains isolation transformer to power the DUT instead.
|
||||
//! Earth leakage can be measured Canadian CSA style by disconnected the neutral link from the left socket and linking the central neutral to the live.
|
||||
//
|
||||
$extrusion_width = 0.5;
|
||||
$extrusion_width = 0.4;
|
||||
$layer_height = 0.2;
|
||||
$pp1_colour = "dimgrey";
|
||||
$pp2_colour = [0.9, 0.9, 0.9];
|
||||
|
||||
|
5
examples/MainsBreakOutBox/stls/deps/all.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
socket_box.stl
|
||||
foot.stl
|
||||
foot.stl
|
||||
foot.stl
|
||||
foot.stl
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
87250
examples/MainsBreakOutBox/stls/printed/all.stl
Normal file
Before Width: | Height: | Size: 121 KiB After Width: | Height: | Size: 121 KiB |
BIN
gallery/IOT_LOAD.png
Normal file
After Width: | Height: | Size: 245 KiB |
Before Width: | Height: | Size: 287 KiB After Width: | Height: | Size: 287 KiB |
Before Width: | Height: | Size: 121 KiB After Width: | Height: | Size: 121 KiB |
BIN
gallery/PSU_cover.png
Normal file
After Width: | Height: | Size: 279 KiB |
BIN
gallery/PotBox.png
Normal file
After Width: | Height: | Size: 231 KiB |
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 202 KiB |
@@ -25,6 +25,11 @@ WiFi controllable PSU
|
||||
|
||||

|
||||
|
||||
## IOT LOAD
|
||||
WiFi controllable programmable load
|
||||
|
||||

|
||||
|
||||
## 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
|
||||
|
||||

|
||||
|
||||
## PotBox
|
||||
Potentiometer box with course and fine controls and three 4mm binding posts
|
||||
|
||||

|
||||
|
||||
## SunBot
|
||||
A solar tracker to keep a solar panel pointing at the sun.
|
||||
|
||||
|
@@ -24,23 +24,22 @@
|
||||
// bom defaults to 0
|
||||
// Setting $bom on the command line or in the main file before including lib.scad overrides it everywhere.
|
||||
// Setting $bom after including lib overrides bom in the libs but not in the local file.
|
||||
// Setting $_bom in the local file overrides it in the local file but not in the libs.
|
||||
//
|
||||
rr_green = [0, 146/255, 0]; // RepRap logo colour
|
||||
crimson = [220/255, 20/255, 60/255];
|
||||
|
||||
$_bom = is_undef($bom) ? 0 : $bom; // 0 no bom, 1 assemblies and stls, 2 vitamins as well
|
||||
$exploded = is_undef($explode) ? 0 : $explode; // 1 for exploded view
|
||||
layer_height = is_undef($layer_height) ? 0.25 : $layer_height; // layer height when printing
|
||||
extrusion_width = is_undef($extrusion_width) ? 0.5 : $extrusion_width; // filament width when printing
|
||||
nozzle = is_undef($nozzle) ? 0.45 : $nozzle; // 3D printer nozzle
|
||||
cnc_bit_r = is_undef($cnc_bit_r) ? 1.2 : $cnc_bit_r; // minimum tool radius when milling 2D objects
|
||||
pp1_colour = is_undef($pp1_colour) ? rr_green : $pp1_colour; // printed part colour 1, RepRap logo colour
|
||||
pp2_colour = is_undef($pp2_colour) ? crimson : $pp2_colour; // printed part colour 2
|
||||
pp3_colour = is_undef($pp3_colour) ? "SteelBlue" : $pp3_colour; // printed part colour 3
|
||||
pp4_colour = is_undef($pp4_colour) ? "darkorange" : $pp4_colour;// printed part colour 4
|
||||
show_rays = is_undef($show_rays) ? false : $show_rays; // show camera sight lines and light direction
|
||||
show_threads = is_undef($show_threads) ? false : $show_threads; // show screw threads
|
||||
show_plugs = is_undef($show_plugs) ? false : $show_plugs; // plugs on headers
|
||||
pp1_colour = is_undef($pp1_colour) ? rr_green : $pp1_colour;// printed part colour 1, RepRap logo colour
|
||||
pp2_colour = is_undef($pp2_colour) ? crimson : $pp2_colour;// printed part colour 2
|
||||
pp3_colour = is_undef($pp3_colour) ? "SteelBlue" : $pp3_colour;// printed part colour 3
|
||||
pp4_colour = is_undef($pp4_colour) ? "darkorange" : $pp4_colour;// printed part colour 4
|
||||
|
||||
|
||||
// Minimum wall is about two filaments wide but we extrude it closer to get better bonding
|
||||
squeezed_wall = $preview ? 2 * extrusion_width - layer_height * (1 - PI / 4)
|
||||
@@ -51,13 +50,14 @@ eps = 1/128; // small fudge factor to stop CSG barfing on coincident faces.
|
||||
$fa = 6;
|
||||
$fs = extrusion_width / 2;
|
||||
|
||||
function round_to_layer(z) = ceil(z / layer_height) * layer_height;
|
||||
function round_to_layer(z) = ceil(z / layer_height) * layer_height; //! Round up to a multiple of layer_height.
|
||||
|
||||
// Some additional named colours
|
||||
function grey(n) = [0.01, 0.01, 0.01] * n; //! Generate a shade of grey to pass to color().
|
||||
silver = [0.75, 0.75, 0.75];
|
||||
gold = [255, 215, 0] / 255;
|
||||
brass = [255, 220, 100] / 255;
|
||||
copper = [230, 140, 51] / 255;
|
||||
function grey(n) = [0.01, 0.01, 0.01] * n; //! Generate a shade of grey to pass to color().
|
||||
silver = [0.75, 0.75, 0.75];
|
||||
gold = [255, 215, 0] / 255;
|
||||
brass = [255, 220, 100] / 255;
|
||||
copper = [230, 140, 51] / 255;
|
||||
|
||||
/*
|
||||
* Enums
|
||||
@@ -73,11 +73,6 @@ hs_grub = 4; // pulley set screw
|
||||
hs_cs_cap = 5;
|
||||
hs_dome = 6;
|
||||
//
|
||||
// Hot end descriptions
|
||||
//
|
||||
jhead = 1;
|
||||
e3d = 2;
|
||||
//
|
||||
// Face enumeration
|
||||
//
|
||||
f_bottom = 0;
|
||||
|
BIN
libtest.png
Before Width: | Height: | Size: 931 KiB After Width: | Height: | Size: 943 KiB |
@@ -31,9 +31,11 @@
|
||||
//!
|
||||
//! Normally the side sheets are the same type but they can be overridden individually as long as the substitute has the same thickness.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
use <../vitamins/sheet.scad>
|
||||
use <../vitamins/insert.scad>
|
||||
use <../vitamins/screw.scad>
|
||||
use <../vitamins/washer.scad>
|
||||
use <../utils/quadrant.scad>
|
||||
use <../utils/round.scad>
|
||||
|
||||
@@ -52,8 +54,8 @@ function box_width(type) = type[7]; //! Internal width
|
||||
function box_depth(type) = type[8]; //! Internal depth
|
||||
function box_height(type) = type[9]; //! Internal height
|
||||
|
||||
function box(screw, wall, sheets, top_sheet, base_sheet, size, feet = false, shelf_screw = M3_dome_screw) = //! Construct a property list for a box.
|
||||
concat([screw, shelf_screw, wall, sheets, top_sheet, base_sheet, feet], size);
|
||||
function box(screw, wall, sheets, top_sheet, base_sheet, size, feet = false, shelf_screw = undef) = //! Construct a property list for a box.
|
||||
concat([screw, is_undef(shelf_screw) ? screw : shelf_screw, wall, sheets, top_sheet, base_sheet, feet], size);
|
||||
|
||||
function box_bezel_clearance(type) = bezel_clearance;
|
||||
|
||||
@@ -588,9 +590,26 @@ module box_back_blank(type, sheet = false) { //! Generates a 2D template for the
|
||||
sheet_2D(subst_sheet(type, sheet), box_width(type) - sheet_reduction(type), box_height(type) - sheet_reduction(type), 1);
|
||||
}
|
||||
|
||||
module box_base(type) render_2D_sheet(box_base_sheet(type)) box_base_blank(type); //! Default base, can be overridden to customise
|
||||
module box_top(type) render_2D_sheet(box_top_sheet(type)) box_top_blank(type); //! Default top, can be overridden to customise
|
||||
module box_back(type) render_2D_sheet(box_sheets(type)) box_back_blank(type); //! Default back, can be overridden to customise
|
||||
module box_front(type) render_2D_sheet(box_sheets(type)) box_front_blank(type); //! Default front, can be overridden to customise
|
||||
module box_left(type) render_2D_sheet(box_sheets(type)) box_left_blank(type); //! Default left side, can be overridden to customise
|
||||
module box_right(type) render_2D_sheet(box_sheets(type)) box_right_blank(type); //! Default right side, can be overridden to customise
|
||||
module box_base(type) //! Default base, can be overridden to customise
|
||||
render_2D_sheet(box_base_sheet(type))
|
||||
box_base_blank(type);
|
||||
|
||||
module box_top(type) //! Default top, can be overridden to customise
|
||||
render_2D_sheet(box_top_sheet(type))
|
||||
box_top_blank(type);
|
||||
|
||||
module box_back(type) //! Default back, can be overridden to customise
|
||||
render_2D_sheet(box_sheets(type))
|
||||
box_back_blank(type);
|
||||
|
||||
module box_front(type) //! Default front, can be overridden to customise
|
||||
render_2D_sheet(box_sheets(type))
|
||||
box_front_blank(type);
|
||||
|
||||
module box_left(type) //! Default left side, can be overridden to customise
|
||||
render_2D_sheet(box_sheets(type))
|
||||
box_left_blank(type);
|
||||
|
||||
module box_right(type) //! Default right side, can be overridden to customise
|
||||
render_2D_sheet(box_sheets(type))
|
||||
box_right_blank(type);
|
||||
|
@@ -28,7 +28,7 @@ assembly("box") {
|
||||
|
||||
t = sheet_thickness(box_sheets(type));
|
||||
|
||||
for(corner = [0 : corners - 1]) {
|
||||
for(corner = [0 : 1 : corners - 1]) {
|
||||
x = [-1,1,1,-1][corner];
|
||||
y = [-1,-1,1,1][corner];
|
||||
translate([x * (box_width(type) / 2 + 25 * exploded()), y * (box_depth(type) / 2 + 25 * exploded())])
|
||||
|
@@ -198,12 +198,29 @@ module bbox_back_blank(type, sheet = false) { //! 2D template for the back
|
||||
}
|
||||
}
|
||||
|
||||
module bbox_base(type) render_2D_sheet(bbox_base_sheet(type)) bbox_base_blank(type); //! Default base, can be overridden to customise
|
||||
module bbox_top(type) render_2D_sheet(bbox_top_sheet(type)) bbox_top_blank(type); //! Default top, can be overridden to customise
|
||||
module bbox_back(type) render_2D_sheet(bbox_sheets(type)) bbox_back_blank(type); //! Default back, can be overridden to customise
|
||||
module bbox_front(type) render_2D_sheet(bbox_sheets(type)) bbox_front_blank(type); //! Default front, can be overridden to customise
|
||||
module bbox_left(type) render_2D_sheet(bbox_sheets(type)) bbox_left_blank(type); //! Default left side, can be overridden to customise
|
||||
module bbox_right(type) render_2D_sheet(bbox_sheets(type)) bbox_right_blank(type); //! Default right side, can be overridden to customise
|
||||
module bbox_base(type) //! Default base, can be overridden to customise
|
||||
render_2D_sheet(bbox_base_sheet(type))
|
||||
bbox_base_blank(type);
|
||||
|
||||
module bbox_top(type) //! Default top, can be overridden to customise
|
||||
render_2D_sheet(bbox_top_sheet(type))
|
||||
bbox_top_blank(type);
|
||||
|
||||
module bbox_back(type) //! Default back, can be overridden to customise
|
||||
render_2D_sheet(bbox_sheets(type))
|
||||
bbox_back_blank(type);
|
||||
|
||||
module bbox_front(type) //! Default front, can be overridden to customise
|
||||
render_2D_sheet(bbox_sheets(type))
|
||||
bbox_front_blank(type);
|
||||
|
||||
module bbox_left(type) //! Default left side, can be overridden to customise
|
||||
render_2D_sheet(bbox_sheets(type))
|
||||
bbox_left_blank(type);
|
||||
|
||||
module bbox_right(type) //! Default right side, can be overridden to customise
|
||||
render_2D_sheet(bbox_sheets(type))
|
||||
bbox_right_blank(type);
|
||||
|
||||
module _bbox_assembly(type, top = true, base = true, left = true, right = true, back = true, front = true) { //! The box assembly, wrap with a local copy without parameters
|
||||
width = bbox_width(type);
|
||||
|
@@ -29,7 +29,7 @@ function fan_guard_wall() = extrusion_width - layer_height / 2 + nozzle / 2 + ex
|
||||
function fan_guard_corner_r(type) = washer_diameter(screw_washer(fan_screw(type))) / 2 + 0.5; //! Corner radius of the guard
|
||||
function fan_guard_width(type) = max(2 * (fan_hole_pitch(type) + fan_guard_corner_r(type)), fan_bore(type) + 4 * fan_guard_wall()); //! Width of the guard
|
||||
|
||||
module fan_guard(type, name = false, thickness = fan_guard_thickness(), spokes = 4, finger_width = 7, grill = false) { //! Generate the STL
|
||||
module fan_guard(type, name = false, thickness = fan_guard_thickness(), spokes = 4, finger_width = 7, grill = false, screws = true) { //! Generate the STL
|
||||
if(thickness)
|
||||
stl(name ? name : str("fan_guard_", fan_width(type)));
|
||||
hole_pitch = fan_hole_pitch(type);
|
||||
@@ -54,7 +54,7 @@ module fan_guard(type, name = false, thickness = fan_guard_thickness(), spokes =
|
||||
difference() {
|
||||
rounded_square([width, width], r = width / 2 - hole_pitch);
|
||||
|
||||
fan_holes(type, !grill, !grill, h = 0);
|
||||
fan_holes(type, !grill, !grill && screws, h = 0);
|
||||
}
|
||||
if(spokes) {
|
||||
intersection() {
|
||||
|
@@ -105,7 +105,8 @@ module fixing_block(screw = def_screw) { //! Generate the STL
|
||||
}
|
||||
}
|
||||
|
||||
module fixing_block_assembly(screw = def_screw) pose([55, 180, 25], [0, 4.8, 4.8]) //! Printed part with the inserts inserted
|
||||
module fixing_block_assembly(screw = def_screw) //! Printed part with the inserts inserted
|
||||
pose([55, 180, 25], [0, 4.8, 4.8])
|
||||
assembly(str("fixing_block_M", 20 * screw_radius(screw)), ngb = true) {
|
||||
translate_z(fixing_block_height(screw))
|
||||
rotate([0, 180, 0])
|
||||
|
@@ -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
|
||||
|
@@ -79,7 +79,8 @@ module handle_stl() { //! generate the STL
|
||||
//
|
||||
//! Place inserts in the bottom of the posts and push them home with a soldering iron with a conical bit heated to 200°C.
|
||||
//
|
||||
module handle_assembly() pose([225, 0, 150], [0, 0, 14]) //! Printed part with inserts in place
|
||||
module handle_assembly() //! Printed part with inserts in place
|
||||
pose([225, 0, 150], [0, 0, 14])
|
||||
assembly("handle", ngb = true) {
|
||||
translate_z(handle_height())
|
||||
stl_colour(pp1_colour) vflip() handle_stl();
|
||||
|
@@ -22,7 +22,7 @@
|
||||
//!
|
||||
//! Add solvent or glue to make a permanent fixture.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
|
||||
interference = 0.0;
|
||||
|
||||
|
@@ -26,7 +26,9 @@
|
||||
//!
|
||||
//! It can also have printed feet on the base with the screws doubling up to hold the base on.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
use <../vitamins/screw.scad>
|
||||
use <../vitamins/washer.scad>
|
||||
use <../vitamins/insert.scad>
|
||||
use <foot.scad>
|
||||
|
||||
|
@@ -21,8 +21,8 @@
|
||||
//! Creative Commons - Attribution - Share Alike license (see <https://creativecommons.org/licenses/by-sa/3.0/>)
|
||||
//
|
||||
|
||||
include <../core.scad>
|
||||
include <../vitamins/pulleys.scad>
|
||||
include <../utils/core/core.scad>
|
||||
use <../vitamins/pulley.scad>
|
||||
|
||||
printed_pulley_GT2_profile = [[0.747183,-0.5],[0.747183,0],[0.647876,0.037218],[0.598311,0.130528],[0.578556,0.238423],[0.547158,0.343077],[0.504649,0.443762],[0.451556,0.53975],[0.358229,0.636924],[0.2484,0.707276],[0.127259,0.750044],[0,0.76447],[-0.127259,0.750044],[-0.2484,0.707276],[-0.358229,0.636924],[-0.451556,0.53975],[-0.504797,0.443762],[-0.547291,0.343077],[-0.578605,0.238423],[-0.598311,0.130528],[-0.648009,0.037218],[-0.747183,0],[-0.747183,-0.5]];
|
||||
|
||||
|
@@ -81,8 +81,9 @@ module ribbon_clamp(ways, screw = screw) { //! Generate STL for given number of
|
||||
}
|
||||
}
|
||||
|
||||
module ribbon_clamp_assembly(ways, screw = screw) pose([55, 180, 25]) //! Printed part with inserts in place
|
||||
assembly(let(screw_d = screw_radius(screw) * 2)str("ribbon_clamp_", ways, screw_d != 3 ? str("_", screw_d) : ""), ngb = true) {
|
||||
module ribbon_clamp_assembly(ways, screw = screw) //! Printed part with inserts in place
|
||||
pose([55, 180, 25])
|
||||
assembly(let(screw_d = screw_radius(screw) * 2)str("ribbon_clamp_", ways, screw_d != 3 ? str("_", screw_d) : ""), ngb = true) {
|
||||
h = ribbon_clamp_height(screw);
|
||||
insert = screw_insert(screw);
|
||||
|
||||
|
63
readme.md
@@ -71,8 +71,8 @@ A list of changes classified as breaking, additions or fixes is maintained in [C
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| `7_segment_digit(type, colour = grey(95)` | Draw the specified 7 segment digit |
|
||||
| `7_segment_digits(type, n, colour = grey(70)` | Draw n digits side by side |
|
||||
| `7_segment_digit(type, colour = grey(95), pin_length = 6.4)` | Draw the specified 7 segment digit |
|
||||
| `7_segment_digits(type, n, colour = grey(70), pin_length = 6.4, cutout = false)` | Draw n digits side by side |
|
||||
|
||||

|
||||
|
||||
@@ -343,7 +343,7 @@ Individual teeth are not drawn, instead they are represented by a lighter colour
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| `belt(type, points, belt_colour = grey(20)` | Draw a belt path given a set of points and pitch radii where the pulleys are. Closed loop unless open is specified |
|
||||
| `belt(type, points, belt_colour = grey(20), tooth_colour = grey(50), open = false, twist = undef, auto_twist = false, start_twist = false)` | Draw a belt path given a set of points and pitch radii where the pulleys are. Closed loop unless open is specified |
|
||||
|
||||

|
||||
|
||||
@@ -785,6 +785,7 @@ Various electronic components used in hot ends and heated beds.
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| `TO220_thickness()` | Thickness of the tab of a TO220 |
|
||||
| `TO247_size()` | Body dimensions of a T247, hole offset, lead height and lead wide length |
|
||||
| `fack2spm_bezel_size()` | FACK2SPM Bezel dimensions |
|
||||
| `fack2spm_screw()` | Screw type for FACK2SPM |
|
||||
|
||||
@@ -792,6 +793,7 @@ Various electronic components used in hot ends and heated beds.
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ` TO220(description, leads = 3, lead_length = 16)` | Draw a TO220 package, use `description` to describe what it is |
|
||||
| ` TO247(description, lead_length = 20)` | Draw a TO247 package, use `description` to describe what it is |
|
||||
| `al_clad_resistor(type, value, leads = true)` | Draw an aluminium clad resistor |
|
||||
| `al_clad_resistor_hole_positions(type)` | Position children at the screw holes of an aluminium clad resistor |
|
||||
| `al_clad_resistor_holes(type, h = 100)` | Drill screw holes for an aluminium clad resistor |
|
||||
@@ -812,6 +814,7 @@ Various electronic components used in hot ends and heated beds.
|
||||
| Qty | Module call | BOM entry |
|
||||
| ---:|:--- |:---|
|
||||
| 1 | `TO220("Generic TO220 package")` | Generic TO220 package |
|
||||
| 1 | `TO247("Generic TO247 package")` | Generic TO247 package |
|
||||
| 8 | `tubing(HSHRNK32)` | Heatshrink sleeving ID 3.2mm x 15mm |
|
||||
| 1 | `resistor(RWM04106R80J)` | Resistor RWM04106R80J 6R8 3W vitreous enamel |
|
||||
| 1 | `resistor(RIE1212UB5C5R6)` | Resistor UB5C 5R6F 5R6 3W vitreous enamel |
|
||||
@@ -909,7 +912,7 @@ Dual inline IC packages and sockets
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| `dip(n, part, size, w, pitch, pin)` | Draw DIP package |
|
||||
| `pdip(pins, part, socketed, w = inch(0.3)` | Draw standard 0.1" PDIP IC package |
|
||||
| `pdip(pins, part, socketed, w = inch(0.3), pitch = inch(0.1))` | Draw standard 0.1" PDIP IC package |
|
||||
| `pdip_pin(type, l, end)` | Draw a pin |
|
||||
|
||||

|
||||
@@ -1451,6 +1454,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 |
|
||||
@@ -1523,7 +1527,9 @@ 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 |
|
||||
| `jack_4mm_shielded_nut_radius()` | Largest diameter of 4mm shielded jack |
|
||||
| `post_4mm_diameter()` | Outer diameter of 4mm binding post |
|
||||
@@ -1532,6 +1538,7 @@ E.g. a "brown" socket for mains live needs to be displayed as "sienna" to look r
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| `jack_4mm(colour, thickness, display_colour = false)` | Draw a 4mm jack socket with nut positioned for specified panel thickness |
|
||||
| `jack_4mm_plastic(colour, thickness, display_colour = false)` | Draw a 4mm plastic jack socket with nut positioned for specified panel thickness |
|
||||
| `jack_4mm_shielded(colour, thickness, display_colour = false)` | Draw a 4mm shielded jack |
|
||||
| `post_4mm(colour, thickness, display_colour = false)` | Draw a 4mm binding post |
|
||||
| `post_4mm_hole(h = 100, poly = false)` | Drill hole for 4mm binding post |
|
||||
@@ -1543,6 +1550,7 @@ E.g. a "brown" socket for mains live needs to be displayed as "sienna" to look r
|
||||
| ---:|:--- |:---|
|
||||
| 1 | `post_4mm("red", 3)` | 4mm jack binding post red |
|
||||
| 1 | `jack_4mm("blue", 3, "royalblue")` | 4mm jack socket blue |
|
||||
| 1 | `jack_4mm_plastic("[0.2, 0.2, 0.2]", 3, [0.2, 0.2, 0.2])` | 4mm plastic jack socket [0.2, 0.2, 0.2] |
|
||||
| 1 | `jack_4mm_shielded("brown", 3, "sienna")` | 4mm shielded jack socket brown |
|
||||
|
||||
|
||||
@@ -2345,7 +2353,8 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| `flex(cutout = false)` | Draw flexistrip connector |
|
||||
| `hdmi(type, cutout = false)` | Draw HDMI socket |
|
||||
| `jack(cutout = false)` | Draw 3.5mm jack |
|
||||
| `molex_254(ways, right_angle = 0, skip = undef)` | Draw molex header, set `right_angle` to 1 for normal right angle version or -1 for inverted right angle version. |
|
||||
| `molex_254(ways, right_angle = 0, skip = undef)` | Draw molex KK header, set `right_angle` to 1 for normal right angle version or -1 for inverted right angle version. |
|
||||
| `molex_254_housing(ways)` | Draw a Molex KK housing |
|
||||
| `molex_usb_Ax1(cutout)` | Draw Molex USB A connector suitable for perf board |
|
||||
| `molex_usb_Ax2(cutout)` | Draw Molex dual USB A connector suitable for perf board |
|
||||
| `pcb(type)` | Draw specified PCB |
|
||||
@@ -2489,7 +2498,8 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| `flex(cutout = false)` | Draw flexistrip connector |
|
||||
| `hdmi(type, cutout = false)` | Draw HDMI socket |
|
||||
| `jack(cutout = false)` | Draw 3.5mm jack |
|
||||
| `molex_254(ways, right_angle = 0, skip = undef)` | Draw molex header, set `right_angle` to 1 for normal right angle version or -1 for inverted right angle version. |
|
||||
| `molex_254(ways, right_angle = 0, skip = undef)` | Draw molex KK header, set `right_angle` to 1 for normal right angle version or -1 for inverted right angle version. |
|
||||
| `molex_254_housing(ways)` | Draw a Molex KK housing |
|
||||
| `molex_usb_Ax1(cutout)` | Draw Molex USB A connector suitable for perf board |
|
||||
| `molex_usb_Ax2(cutout)` | Draw Molex dual USB A connector suitable for perf board |
|
||||
| `pcb(type)` | Draw specified PCB |
|
||||
@@ -2535,7 +2545,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| 1 | `pcb(ESP32_DOIT_V1)` | ESP32 DOIT DEV KIT V1 |
|
||||
| 1 | `pcb(EnviroPlus)` | Enviro+ |
|
||||
| 1 | `pcb(ExtruderPCB)` | Extruder connection PCB - not shown |
|
||||
| 1 | `pcb(KY_040)` | KY_-040 rotart encoder breakout |
|
||||
| 1 | `pcb(KY_040)` | KY-040 rotart encoder breakout |
|
||||
| 1 | `pcb(Keyes5p1)` | Keyes5.1 Arduino Uno expansion board - not shown |
|
||||
| 1 | `pcb(LIPO_fuel_gauge)` | LIPO fuel gauge |
|
||||
| 1 | `pcb(MP1584EN)` | MP1584EN 3A buck converter |
|
||||
@@ -2791,6 +2801,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 |
|
||||
@@ -2798,16 +2809,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 |
|
||||
|
||||

|
||||
@@ -2833,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 |
|
||||
@@ -2868,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 |
|
||||
@@ -2878,18 +2892,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>
|
||||
@@ -3010,10 +3024,10 @@ Linear rails with carriages.
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| `carriage(type, end_colour = grey(20)` | Draw the specified carriage |
|
||||
| `carriage(type, end_colour = grey(20), wiper_colour = grey(20))` | Draw the specified carriage |
|
||||
| `carriage_hole_positions(type)` | Position children over screw holes |
|
||||
| `rail(type, length, colour = grey(90)` | Draw the specified rail |
|
||||
| `rail_assembly(carriage, length, pos, carriage_end_colour = grey(20)` | Rail and carriage assembly |
|
||||
| `rail(type, length, colour = grey(90), use_polycircles = false)` | Draw the specified rail |
|
||||
| `rail_assembly(carriage, length, pos, carriage_end_colour = grey(20), carriage_wiper_colour = grey(20))` | Rail and carriage assembly |
|
||||
| `rail_hole_positions(type, length, first = 0, screws = 100, both_ends = true)` | Position children over screw holes |
|
||||
| `rail_screws(type, length, thickness, screws = 100, index_screws = undef)` | Place screws in the rail |
|
||||
|
||||
@@ -4402,7 +4416,7 @@ Normally the side sheets are the same type but they can be overridden individual
|
||||
### Functions
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| `box(screw, wall, sheets, top_sheet, base_sheet, size, feet = false, shelf_screw = M3_dome_screw)` | Construct a property list for a box. |
|
||||
| `box(screw, wall, sheets, top_sheet, base_sheet, size, feet = false, shelf_screw = undef)` | Construct a property list for a box. |
|
||||
| `box_bezel_height(type, bottom)` | Bezel height for top or bottom |
|
||||
| `box_corner_gap(type)` | Gap between box_sheets at the corners to connect inside and outside profiles |
|
||||
| `box_inset(type)` | How much the bezel intrudes on the specified width and length, away from the corners |
|
||||
@@ -4974,7 +4988,7 @@ The ring spacing as well as the number of spokes can be specified, if zero a gas
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| `fan_guard(type, name = false, thickness = fan_guard_thickness()` | Generate the STL |
|
||||
| `fan_guard(type, name = false, thickness = fan_guard_thickness(), spokes = 4, finger_width = 7, grill = false, screws = true)` | Generate the STL |
|
||||
|
||||

|
||||
|
||||
@@ -5181,7 +5195,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 |
|
||||
|
||||
@@ -6312,8 +6326,9 @@ Because the tangents need to be calculated to find the length these can be calcu
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| `circle_tangent(p1, p2)` | Compute the clockwise tangent between two circles represented as [x,y,r] |
|
||||
| `rounded_polygon(points, _tangents = undef)` | Return the rounded polygon from the point list, can pass the tangent list to save it being calculated |
|
||||
| `rounded_polygon_arcs(points, tangents)` | Compute the arcs at the points, for each point [angle, rotate_angle, length] |
|
||||
| `rounded_polygon_length(points, tangents)` | Calculate the length given the point list and the list of tangents computed by ` rounded_polygon_tangents` |
|
||||
| `rounded_polygon_length(points, tangents)` | Calculate the length given the point list and the list of tangents computed by `rounded_polygon_tangents` |
|
||||
| `rounded_polygon_tangents(points)` | Compute the straight sections between a point and the next point, for each section [start_point, end_point, length] |
|
||||
|
||||
### Modules
|
||||
@@ -6463,7 +6478,7 @@ Simple tube or ring
|
||||
| `rectangular_tube(size, center = true, thickness = 1, fillet = 0.5)` | Create a rectangular tube with filleted corners |
|
||||
| `ring(or, ir)` | Create a ring with specified external and internal radii |
|
||||
| `tube(or, ir, h, center = true)` | Create a tube with specified external and internal radii and height `h` |
|
||||
| `woven_tube(or, ir, h, center= true, colour = grey(30)` | Create a woven tube with specified external and internal radii, height `h`, colours, warp and weft |
|
||||
| `woven_tube(or, ir, h, center= true, colour = grey(30), colour2, warp = 2, weft)` | Create a woven tube with specified external and internal radii, height `h`, colours, warp and weft |
|
||||
|
||||

|
||||
|
||||
@@ -6506,7 +6521,7 @@ The `pose()` module allows assembly views in the readme to be posed differently
|
||||
|:--- |:--- |
|
||||
| `arg(value, default, name = "")` | Create string for arg if not default, helper for `vitamin()` |
|
||||
| `bom_mode(n = 1)` | Current BOM mode, 0 = none, 1 = printed and routed parts and assemblies, 2 includes vitamins as well |
|
||||
| `exploded()` | Returns the value of `$exploded` if it is defined, else `0` |
|
||||
| `exploded()` | Returns the value of `$explode` if it is defined, else `0` |
|
||||
| `show_supports()` | True if printed support material should be shown |
|
||||
| `value_string(value)` | Convert `value` to a string or quote it if it is already a string |
|
||||
|
||||
|
@@ -81,7 +81,7 @@ def scrape_code(scad_file):
|
||||
match = re.match(r'^function (.*?\(.*?\)).*?(?://! ?(.*))$', line)
|
||||
if match:
|
||||
functions[match.group(1)] = match.group(2)
|
||||
match = re.match(r'^module (.*?\(.*?\)).*?(?://! ?(.*))$', line)
|
||||
match = re.match(r'^module (.*?\(.*\)).*?(?://! ?(.*))$', line)
|
||||
if match:
|
||||
modules[match.group(1)] = match.group(2)
|
||||
|
||||
|
@@ -139,6 +139,7 @@ def make_parts(target, part_type, parts = None):
|
||||
#
|
||||
part_maker_name = tmp_dir + '/' + part_type + ".scad"
|
||||
with open(part_maker_name, "w") as f:
|
||||
f.write("include <NopSCADlib/global_defs.scad>\n")
|
||||
f.write("use <%s/%s>\n" % (reltmp(dir, target), filename))
|
||||
f.write("%s();\n" % module);
|
||||
t = time.time()
|
||||
|
@@ -94,11 +94,13 @@ def render(target, type):
|
||||
cam = "--camera=0,0,0,70,0,315,500" if type == 'stl' else "--camera=0,0,0,0,0,0,500"
|
||||
render = "--preview" if type == 'stl' or colour != pp1 else "--render"
|
||||
tmp_name = tmp_dir + '/' + part[:-4] + '.png'
|
||||
openscad.run("-o", tmp_name, png_maker_name, colour_scheme, "--projection=p", "--imgsize=4096,4096", cam, render, "--autocenter", "--viewall");
|
||||
dummy_deps_name = tmp_dir + '/tmp.deps' # work around for OpenSCAD issue #3879
|
||||
openscad.run("-o", tmp_name, png_maker_name, colour_scheme, "--projection=p", "--imgsize=4096,4096", cam, render, "--autocenter", "--viewall", "-d", dummy_deps_name)
|
||||
do_cmd(("magick "+ tmp_name + " -trim -resize 280x280 -background %s -gravity Center -extent 280x280 -bordercolor %s -border 10 %s"
|
||||
% (background, background, tmp_name)).split())
|
||||
update_image(tmp_name, png_name)
|
||||
os.remove(png_maker_name)
|
||||
os.remove(dummy_deps_name)
|
||||
#
|
||||
# Remove tmp dir
|
||||
#
|
||||
|
@@ -72,6 +72,8 @@ def update_image(tmp_name, png_name):
|
||||
if pixels < 0 or pixels > threshold:
|
||||
shutil.copyfile(tmp_name, png_name)
|
||||
print(Fore.YELLOW + png_name + " updated" + Fore.WHITE, pixels if pixels > 0 else '')
|
||||
if png_name.endswith('_tn.png') and os.path.isfile(diff_name):
|
||||
os.remove(diff_name)
|
||||
else:
|
||||
os.utime(png_name, None)
|
||||
os.remove(diff_name)
|
||||
|
@@ -25,6 +25,7 @@ import time
|
||||
def mktmpdir(top_dir):
|
||||
tmp_dir = top_dir + 'tmp'
|
||||
if not os.path.isdir(tmp_dir):
|
||||
time.sleep(0.1)
|
||||
os.makedirs(tmp_dir)
|
||||
else:
|
||||
for file in os.listdir(tmp_dir):
|
||||
|
@@ -216,6 +216,7 @@ def views(target, do_assemblies = None):
|
||||
#
|
||||
png_maker_name = tmp_dir + '/png.scad'
|
||||
with open(png_maker_name, "w") as f:
|
||||
f.write("include <NopSCADlib/global_defs.scad>\n")
|
||||
f.write("use <%s/%s>\n" % (reltmp(dir, target), filename))
|
||||
f.write("%s();\n" % module);
|
||||
t = time.time()
|
||||
|
@@ -16,7 +16,7 @@
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
use <../utils/layout.scad>
|
||||
|
||||
include <../vitamins/7_segments.scad>
|
||||
|
@@ -16,7 +16,7 @@
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
use <../vitamins/dip.scad>
|
||||
|
||||
dips = [[6, "OPTO"], [8, "NE555"], [14, "74HC00"], [16, "ULN2003"], [18, "ULN2803"], [20, "74HC245"], [28, "ATMEGA328"]];
|
||||
|
@@ -16,7 +16,7 @@
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
include <../vitamins/ldrs.scad>
|
||||
|
||||
use <../utils/layout.scad>
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
include <../vitamins/ssrs.scad>
|
||||
|
||||
use <../utils/layout.scad>
|
||||
|
@@ -16,7 +16,7 @@
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
use <../utils/layout.scad>
|
||||
|
||||
include <../vitamins/ball_bearings.scad>
|
||||
|
@@ -16,7 +16,7 @@
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
use <../utils/layout.scad>
|
||||
|
||||
use <../printed/camera_housing.scad>
|
||||
|
@@ -42,6 +42,9 @@ module components() {
|
||||
TO220("Generic TO220 package");
|
||||
|
||||
translate([40, 50])
|
||||
TO247("Generic TO247 package");
|
||||
|
||||
translate([40, 80])
|
||||
panel_USBA();
|
||||
|
||||
translate([80, 50])
|
||||
|
@@ -19,7 +19,6 @@
|
||||
|
||||
include <../core.scad>
|
||||
include <../vitamins/pulleys.scad>
|
||||
include <../vitamins/screws.scad>
|
||||
include <../vitamins/stepper_motors.scad>
|
||||
include <../vitamins/washers.scad>
|
||||
|
||||
|
@@ -22,12 +22,15 @@ use <../vitamins/jack.scad>
|
||||
|
||||
module jacks() {
|
||||
translate([0, 0])
|
||||
jack_4mm("blue",3, "royalblue");
|
||||
jack_4mm_plastic("black",3, grey(20));
|
||||
|
||||
translate([20, 0])
|
||||
jack_4mm_shielded("brown", 3, "sienna");
|
||||
jack_4mm("blue",3, "royalblue");
|
||||
|
||||
translate([40, 0])
|
||||
jack_4mm_shielded("brown", 3, "sienna");
|
||||
|
||||
translate([60, 0])
|
||||
post_4mm("red",3);
|
||||
}
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
use <../vitamins/microview.scad>
|
||||
|
||||
microview(!$preview);
|
||||
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 162 KiB After Width: | Height: | Size: 162 KiB |
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 107 KiB |
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 115 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 100 KiB |
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 89 KiB |
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 95 KiB |
Before Width: | Height: | Size: 180 KiB After Width: | Height: | Size: 180 KiB |
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 116 KiB |
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 137 KiB |
Before Width: | Height: | Size: 221 KiB After Width: | Height: | Size: 255 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
@@ -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();
|
||||
|
@@ -16,7 +16,7 @@
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
use <../printed/press_fit.scad>
|
||||
|
||||
module press_fits()
|
||||
|
@@ -42,24 +42,26 @@
|
||||
//! * To get the parameter values make the GUI window square, pose the view with the mouse and then copy the viewport parameters from the Edit menu and paste them into the pose invocation.
|
||||
//! * Two `pose()` modules can be chained to allow different poses for exploded and assembled views.
|
||||
//
|
||||
function bom_mode(n = 1) = $_bom >= n && (is_undef($on_bom) || $on_bom); //! Current BOM mode, 0 = none, 1 = printed and routed parts and assemblies, 2 includes vitamins as well
|
||||
function exploded() = is_undef($exploded_parent) ? $exploded : 0; //! Returns the value of `$exploded` if it is defined, else `0`
|
||||
function bom_mode(n = 1) = (is_undef($bom) ? 0 : $bom) >= n && (is_undef($on_bom) || $on_bom); //! Current BOM mode, 0 = none, 1 = printed and routed parts and assemblies, 2 includes vitamins as well
|
||||
function exploded() = is_undef($exploded_parent) ? is_undef($explode) ? 0 : $explode : 0; //! Returns the value of `$explode` if it is defined, else `0`
|
||||
function show_supports() = !$preview || exploded(); //! True if printed support material should be shown
|
||||
|
||||
module no_explode() let($exploded_parent = true) children(); //! Prevent children being exploded
|
||||
module no_explode() //! Prevent children being exploded
|
||||
let($exploded_parent = true) children();
|
||||
|
||||
module explode(d, explode_children = false, offset = [0,0,0]) { //! Explode children by specified Z distance or vector `d`, option to explode grand children
|
||||
v = is_list(d) ? d : [0, 0, d];
|
||||
o = is_list(offset) ? offset : [0, 0, offset];
|
||||
if($exploded && is_undef($exploded_parent) && norm(v)) {
|
||||
if(exploded() && norm(v)) {
|
||||
translate(o) // Draw the line first in case the child is transparent
|
||||
color("yellow") hull() {
|
||||
sphere(0.2);
|
||||
|
||||
translate(v * $exploded)
|
||||
translate(v * exploded())
|
||||
sphere(0.2);
|
||||
}
|
||||
|
||||
translate(v * $exploded)
|
||||
translate(v * exploded())
|
||||
let($exploded_parent = explode_children ? undef : true)
|
||||
children();
|
||||
}
|
||||
@@ -67,9 +69,10 @@ module explode(d, explode_children = false, offset = [0,0,0]) { //! Explode
|
||||
children();
|
||||
}
|
||||
|
||||
module no_pose() let($posed = true, $zoomed = undef) children(); //! Force children not to be posed even if parent is
|
||||
module no_pose() //! Force children not to be posed even if parent is
|
||||
let($posed = true, $zoomed = undef) children();
|
||||
|
||||
module pose(a = [55, 0, 25], t = [0, 0, 0], exploded = undef, d = undef) //! Pose an STL or assembly for rendering to png by specifying rotation `a`, translation `t` and optionally `d`, `exploded = true for` just the exploded view or `false` for unexploded only.
|
||||
module pose(a = [55, 0, 25], t = [0, 0, 0], exploded = undef, d = undef) //! Pose an STL or assembly for rendering to png by specifying rotation `a`, translation `t` and optionally `d`, `exploded = true for` just the exploded view or `false` for unexploded only.
|
||||
let($zoomed = is_undef(d)
|
||||
? is_undef($zoomed)
|
||||
? undef
|
||||
@@ -107,7 +110,6 @@ module pose_vflip(exploded = undef) //! Pose an STL or assembly for render
|
||||
vflip()
|
||||
children();
|
||||
|
||||
|
||||
module assembly(name, big = undef, ngb = false) { //! Name an assembly that will appear on the BOM, there needs to a module named `<name>_assembly` to make it. `big` can force big or small assembly diagrams.
|
||||
if(bom_mode()) {
|
||||
zoom = is_undef($zoomed) ? 0 : $zoomed;
|
||||
@@ -140,7 +142,7 @@ module stl(name) { //! Name an stl that will appear on the
|
||||
}
|
||||
if($children)
|
||||
if(is_undef($pose))
|
||||
let($in_stl = true)
|
||||
let($in_stl = true, $cnc_bit_r = 0)
|
||||
children();
|
||||
else {
|
||||
path = is_undef($target) ? "/stls/" : str("/", $target, "/stls/");
|
||||
|
@@ -38,10 +38,17 @@ function r2sides(r) = $fn ? $fn : ceil(max(min(360/ $fa, r * 2 * PI / $fs), 5));
|
||||
function r2sides4n(r) = floor((r2sides(r) + 3) / 4) * 4; //! Round up the number of sides to a multiple of 4 to ensure points land on all axes
|
||||
function limit(x, min, max) = max(min(x, max), min); //! Force x in range min <= x <= max
|
||||
|
||||
module translate_z(z) translate([0, 0, z]) children(); //! Shortcut for Z only translations
|
||||
module vflip(flip=true) rotate([flip ? 180 : 0, 0, 0]) children(); //! Invert children by doing a 180° flip around the X axis
|
||||
module hflip(flip=true) rotate([0, flip ? 180: 0, 0]) children(); //! Invert children by doing a 180° flip around the Y axis
|
||||
module ellipse(xr, yr) scale([1, yr / xr]) circle4n(xr); //! Draw an ellipse
|
||||
module translate_z(z) //! Shortcut for Z only translations
|
||||
translate([0, 0, z]) children();
|
||||
|
||||
module vflip(flip=true) //! Invert children by doing a 180° flip around the X axis
|
||||
rotate([flip ? 180 : 0, 0, 0]) children();
|
||||
|
||||
module hflip(flip=true) //! Invert children by doing a 180° flip around the Y axis
|
||||
rotate([0, flip ? 180: 0, 0]) children();
|
||||
|
||||
module ellipse(xr, yr) //! Draw an ellipse
|
||||
scale([1, yr / xr]) circle4n(xr);
|
||||
|
||||
function slice_str(str, start, end, s ="") = start >= end ? s : slice_str(str, start + 1, end, str(s, str[start])); // Helper for slice()
|
||||
|
||||
|
@@ -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,7 +29,7 @@
|
||||
//! 4. The drive pulleys may be offset in the X and Y directions. If this is done, extra idler pulleys are added. This
|
||||
//! allows flexible positioning of the motors.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
include <../vitamins/belts.scad>
|
||||
include <../vitamins/pulleys.scad>
|
||||
|
||||
|
@@ -24,7 +24,7 @@
|
||||
//! Because the tangents need to be calculated to find the length these can be calculated separately and re-used when drawing to save calculating them twice.
|
||||
//
|
||||
include <../utils/core/core.scad>
|
||||
use <../utils/maths.scad>
|
||||
use <maths.scad>
|
||||
|
||||
function circle_tangent(p1, p2) = //! Compute the clockwise tangent between two circles represented as [x,y,r]
|
||||
let(
|
||||
@@ -49,14 +49,14 @@ function rounded_polygon_arcs(points, tangents) = //! Compute the arcs at the po
|
||||
v2 = p2 - p,
|
||||
sr = points[i][2],
|
||||
r = abs(sr),
|
||||
a = r < 0.001 ? 0 : let( aa = acos((v1 * v2) / sqr(r)) ) cross(v1, v2) * sign(sr) <= 0 ? aa : 360 - aa,
|
||||
a = r < 0.001 ? 0 : let( aa = acos(limit((v1 * v2) / sqr(r), -1, 1)) ) cross(v1, v2) * sign(sr) <= 0 ? aa : 360 - aa,
|
||||
l = PI * a * r / 180,
|
||||
v0 = [r, 0],
|
||||
v = let (
|
||||
vv = norm(v0 - v2) < 0.001 ? 0 : abs(v2.y) < 0.001 ? 180 :
|
||||
let( aa = acos((v0 * v2) / sqr(r)) ) cross(v0, v2) * sign(sr) <= 0 ? aa : 360 - aa
|
||||
let( aa = acos( limit((v0 * v2) / sqr(r), -1, 1)) ) cross(v0, v2) * sign(sr) <= 0 ? aa : 360 - aa
|
||||
) sr > 0 ? 360 - vv : vv - a
|
||||
) [a, v, l]
|
||||
) [a, v % 360, l]
|
||||
];
|
||||
|
||||
function rounded_polygon_tangents(points) = //! Compute the straight sections between a point and the next point, for each section [start_point, end_point, length]
|
||||
@@ -67,36 +67,29 @@ function rounded_polygon_tangents(points) = //! Compute the straight sections be
|
||||
];
|
||||
|
||||
// the cross product of 2D vectors is the area of the parallelogram between them. We use the sign of this to decide if the angle is bigger than 180.
|
||||
function rounded_polygon_length(points, tangents) = //! Calculate the length given the point list and the list of tangents computed by ` rounded_polygon_tangents`
|
||||
function rounded_polygon_length(points, tangents) = //! Calculate the length given the point list and the list of tangents computed by `rounded_polygon_tangents`
|
||||
let(
|
||||
arcs = rounded_polygon_arcs(points, tangents)
|
||||
) sumv( map( concat(tangents, arcs), function(e) e[2] ) );
|
||||
|
||||
module rounded_polygon(points, _tangents = undef) { //! Draw the rounded polygon from the point list, can pass the tangent list to save it being calculated
|
||||
len = len(points);
|
||||
indices = [0 : len - 1];
|
||||
tangents = _tangents ? _tangents : rounded_polygon_tangents(points);
|
||||
function rounded_polygon(points, _tangents = undef) = //! Return the rounded polygon from the point list, can pass the tangent list to save it being calculated
|
||||
let(
|
||||
len = len(points),
|
||||
tangents = _tangents ? _tangents : rounded_polygon_tangents(points),
|
||||
arcs = rounded_polygon_arcs(points, tangents)
|
||||
) [for(i = [0 : len - 1], last = (i - 1 + len) % len, R = points[i][2]) each [
|
||||
vec2(tangents[last][1]), // End of last tangent
|
||||
if(R) // If rounded
|
||||
let(r = abs(R), // Get radius
|
||||
n = r2sides4n(r), // Decide number of vertices
|
||||
step = 360 / n, // Angular step
|
||||
arc = arcs[i], // Get corner arc details
|
||||
start = ceil(arc[1] / step + eps), // Starting index
|
||||
end = floor((arc[0] + arc[1]) / step - eps), // Ending index
|
||||
c = vec2(points[i]) // Centre of arc
|
||||
) for(j = R > 0 ? [end : -1 : start] : [start : 1 : end], a = j * step) c + r * [cos(a), sin(a)], // Points on the arc
|
||||
vec2(tangents[i][0])] // Start of next tangent
|
||||
];
|
||||
|
||||
difference() {
|
||||
union() {
|
||||
for(i = indices, last = (i - 1 + len) % len)
|
||||
if(points[i][2] > 0)
|
||||
hull() {
|
||||
translate(vec2(points[i]))
|
||||
circle(points[i][2]);
|
||||
|
||||
polygon([vec2(tangents[last][1]), vec2(tangents[i][0]), vec2(points[i])]);
|
||||
}
|
||||
|
||||
polygon([for(t = tangents) each(vec2(t))], convexity = points);
|
||||
}
|
||||
for(i = indices, last = (i - 1 + len) % len)
|
||||
if(points[i][2] < 0)
|
||||
hull() {
|
||||
translate(vec2(points[i]))
|
||||
circle(-points[i][2]);
|
||||
|
||||
polygon([vec2(tangents[last][1]), vec2(tangents[i][0]), vec2(points[i])]);
|
||||
}
|
||||
}
|
||||
}
|
||||
module rounded_polygon(points, _tangents = undef) //! Draw the rounded polygon from the point list, can pass the tangent list to save it being calculated
|
||||
polygon(rounded_polygon(points, _tangents), convexity = len(points));
|
||||
|
@@ -54,9 +54,9 @@ module resistor(type) { //! Draw specified type of resitor
|
||||
for(side= [-1,1])
|
||||
translate([side * dia / 6, 0, length / 2])
|
||||
rotate([0, splay_angle * side, 0])
|
||||
cylinder(r = resistor_wire_diameter(type) / 2, h = resistor_wire_length(type), center = false);
|
||||
cylinder(r = resistor_wire_diameter(type) / 2, h = resistor_wire_length(type), center = false, $fn = 16);
|
||||
else
|
||||
cylinder(r = resistor_wire_diameter(type) / 2, h = length + 2 * resistor_wire_length(type), center = true);
|
||||
cylinder(r = resistor_wire_diameter(type) / 2, h = length + 2 * resistor_wire_length(type), center = true, $fn = 16);
|
||||
//
|
||||
// Sleeving
|
||||
//
|
||||
@@ -66,7 +66,7 @@ module resistor(type) { //! Draw specified type of resitor
|
||||
for(side= [-1, 1])
|
||||
translate([side * resistor_diameter(type) / 6, 0, length / 2]) {
|
||||
rotate([0, splay_angle * side, 0])
|
||||
cylinder(r = resistor_wire_diameter(type) / 2 + 0.1, h = resistor_wire_length(type) - 5, center = false); }
|
||||
cylinder(r = resistor_wire_diameter(type) / 2 + 0.1, h = resistor_wire_length(type) - 5, center = false, $fn = 16); }
|
||||
//
|
||||
// Body
|
||||
//
|
||||
@@ -223,7 +223,7 @@ module TO220(description, leads = 3, lead_length = 16) { //! Draw a TO220 packa
|
||||
body = 8;
|
||||
hole_y = 2.9;
|
||||
|
||||
vitamin(str("TO220(\"", description, "\"", arg(leads, 3, "leads"), arg(lead_length, 16, "lead_length"), "): ", description));
|
||||
vitamin(str("TO220(\"", description, "\"", arg(leads, 3, "leads"), "): ", description));
|
||||
|
||||
translate([0, -length + hole_y]) {
|
||||
color("silver") {
|
||||
@@ -257,6 +257,79 @@ module TO220(description, leads = 3, lead_length = 16) { //! Draw a TO220 packa
|
||||
children();
|
||||
}
|
||||
|
||||
function TO247_size() = [15.7, 20.82, 4.82, 5.58, 2.5, 3.8]; //! Body dimensions of a T247, hole offset, lead height and lead wide length
|
||||
|
||||
module TO247(description, lead_length = 20) { //! Draw a TO247 package, use `description` to describe what it is
|
||||
size = TO247_size();
|
||||
hole_y = size[3];
|
||||
lead_height = size[4];
|
||||
lead_l = size[5];
|
||||
metal = [12.81, 13.08, 1.5];
|
||||
metal_y_offset = 1.35;
|
||||
hole = 3.5;
|
||||
metal_hole = 6.85;
|
||||
lead_t = 0.61;
|
||||
lead_w2 = 2.5;
|
||||
lead_w = 1.25;
|
||||
lead_pitch = 5.56;
|
||||
|
||||
vitamin(str("TO247(\"", description, "\"): ", description));
|
||||
|
||||
module body_shape()
|
||||
difference() {
|
||||
translate([-size.x / 2, 0])
|
||||
square([size.x, size.y]);
|
||||
|
||||
translate([0, size.y - hole_y])
|
||||
circle(d = hole);
|
||||
}
|
||||
|
||||
translate([0, -size.y + hole_y]) {
|
||||
color("silver") {
|
||||
linear_extrude(metal.z)
|
||||
difference() {
|
||||
translate([-metal.x / 2, size.y - metal.y - metal_y_offset])
|
||||
square([metal.x, metal.y]);
|
||||
|
||||
translate([0, size.y - hole_y])
|
||||
circle(d = metal_hole);
|
||||
}
|
||||
|
||||
translate_z(lead_height)
|
||||
linear_extrude(lead_t)
|
||||
intersection() {
|
||||
for(i = [-1 : 1]) {
|
||||
length = is_list(lead_length) ? lead_length[i + 1] : lead_length;
|
||||
translate([lead_pitch * i, -length / 2, lead_height])
|
||||
square([lead_w, length], center = true);
|
||||
|
||||
translate([lead_pitch * i, -lead_l / 2, lead_height])
|
||||
square([lead_w2, lead_l], center = true);
|
||||
}
|
||||
square([2 * lead_pitch + lead_w, 100], center = true);
|
||||
}
|
||||
}
|
||||
|
||||
color("dimgrey")
|
||||
translate_z(eps) {
|
||||
linear_extrude(metal.z - 2 * eps)
|
||||
body_shape();
|
||||
|
||||
linear_extrude(size.z)
|
||||
difference() {
|
||||
body_shape();
|
||||
|
||||
for(side = [-1, 1])
|
||||
translate([side * size.x / 2, size.y - hole_y])
|
||||
circle(d = 5);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
translate_z(size.z)
|
||||
children();
|
||||
}
|
||||
|
||||
panel_USBA_pitch = 30;
|
||||
|
||||
module panel_USBA_hole_positions() //! Place children at hole positions
|
||||
|
@@ -27,7 +27,7 @@ RIE1212UB5C5R6 = [ "RIE1212UB5C5R6", "Resistor UB5C 5R6F 5R6 3W vitreous enamel"
|
||||
//
|
||||
Honewell = [ "Honewell", "Thermistor Honeywell 135-104LAC-J01 100K 1%", 4.75, 1.8, 0.5, 28.6, 2, "red", false];
|
||||
Epcos = [ "Epcos", "Thermistor Epcos B57560G104F 100K 1%", 4.6, 2.5, 0.3, 67, 2.5, [0.8, 0.8, 0.8, 0.25], true, false];
|
||||
EpcosBlue = [ "EpcosBlue", "Thermistor Epcos B57861S104F40 100K 1%", 6.5, 2.41,0.25, 43.5,2.5, "black", true, true];
|
||||
EpcosBlue = [ "EpcosBlue", "Thermistor Epcos B57861S104F40 100K 1%", 4.5, 2.41,0.25, 43.5,2.5, "black", true, true];
|
||||
|
||||
resistors = [Honewell, Epcos, EpcosBlue, RWM04106R80J, RIE1212UB5C5R6];
|
||||
//
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -28,7 +28,11 @@ use <../utils/thread.scad>
|
||||
module fuseholder_hole(h = 100) //! Hole with flats for fuseholder
|
||||
extrude_if(h)
|
||||
intersection() {
|
||||
circle(d = 12);
|
||||
r = 12 / 2;
|
||||
if(cnc_bit_r)
|
||||
drill(r, 0);
|
||||
else
|
||||
poly_circle(r);
|
||||
|
||||
square([100, 11], center = true);
|
||||
}
|
||||
@@ -64,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);
|
||||
|
||||
@@ -75,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);
|
||||
}
|
||||
//
|
||||
|
@@ -22,8 +22,6 @@
|
||||
//!
|
||||
//! Needs updating as mostly obsolete versions.
|
||||
//
|
||||
include <../core.scad>
|
||||
|
||||
function hot_end_style(type) = type[1]; //! Basic type, jhead or e3d
|
||||
function hot_end_part(type) = type[2]; //! Description
|
||||
function hot_end_total_length(type) = type[3]; //! Length from nozzle tip to the top
|
||||
@@ -35,7 +33,7 @@ function hot_end_groove_dia(type) = type[8]; //! Groove internal diam
|
||||
function hot_end_groove(type) = type[9]; //! Groove length
|
||||
function hot_end_duct_radius(type) = type[10]; //! Require radius to clear the heater block
|
||||
function hot_end_duct_offset(type) = type[11]; //! Offset of circular duct centre from the nozzle
|
||||
function hot_end_need_cooling(type) = hot_end_style(type) != e3d; //! Has own fan so don't need cooling hole in the duct
|
||||
function hot_end_need_cooling(type) = hot_end_style(type) != "e3d"; //! Has own fan so don't need cooling hole in the duct
|
||||
function hot_end_duct_height_nozzle(type) = type[12]; //! Duct height at nozzle end
|
||||
function hot_end_duct_height_fan(type) = type[13]; //! Duct height at fan end
|
||||
|
||||
@@ -45,9 +43,10 @@ use <jhead.scad>
|
||||
use <e3d.scad>
|
||||
|
||||
module hot_end(type, filament, naked = false, resistor_wire_rotate = [0,0,0], bowden = false) { //! Draw specified hot end
|
||||
if(hot_end_style(type) == jhead)
|
||||
if(hot_end_style(type) == "jhead")
|
||||
jhead_hot_end_assembly(type, filament, naked);
|
||||
|
||||
if(hot_end_style(type) == e3d)
|
||||
else if(hot_end_style(type) == "e3d")
|
||||
e3d_hot_end_assembly(type, filament, naked, resistor_wire_rotate, bowden);
|
||||
else
|
||||
assert(false, "Invalid hotend style");
|
||||
}
|
||||
|
@@ -33,10 +33,10 @@
|
||||
// h t s t t t
|
||||
// h
|
||||
//
|
||||
JHeadMk5 = ["JHeadMk5", jhead, "JHead MK5", 51.2, 4.75,16, 40, grey(20), 12, 4.64, 13, [0, 2.38, -5], 20, 20];
|
||||
E3Dv5 = ["E3Dv5", e3d, "E3D V5 direct", 70, 3.7, 16, 50.1, "silver", 12, 6, 15, [1, 5, -4.5], 14.5, 28];
|
||||
E3Dv6 = ["E3Dv6", e3d, "E3D V6 direct", 62, 3.7, 16, 42.7, "silver", 12, 6, 15, [1, 5, -4.5], 14, 21];
|
||||
E3D_clone = ["E3D_clone", e3d, "E3D clone aliexpress",66, 6.8, 16, 46, "silver", 12, 5.6, 15, [1, 5, -4.5], 14.5, 21];
|
||||
JHeadMk5 = ["JHeadMk5", "jhead","JHead MK5", 51.2, 4.75,16, 40, grey(20), 12, 4.64, 13, [0, 2.38, -5], 20, 20];
|
||||
E3Dv5 = ["E3Dv5", "e3d", "E3D V5 direct", 70, 3.7, 16, 50.1, "silver", 12, 6, 15, [1, 5, -4.5], 14.5, 28];
|
||||
E3Dv6 = ["E3Dv6", "e3d", "E3D V6 direct", 62, 3.7, 16, 42.7, "silver", 12, 6, 15, [1, 5, -4.5], 14, 21];
|
||||
E3D_clone = ["E3D_clone", "e3d", "E3D clone aliexpress",66, 6.8, 16, 46, "silver", 12, 5.6, 15, [1, 5, -4.5], 14.5, 21];
|
||||
|
||||
hot_ends = [JHeadMk5, E3Dv5, E3Dv6, E3D_clone];
|
||||
|
||||
|
@@ -20,7 +20,7 @@
|
||||
//
|
||||
//! IEC mains inlets and outlet.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
use <screw.scad>
|
||||
use <nut.scad>
|
||||
use <washer.scad>
|
||||
@@ -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;
|
||||
|
@@ -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>
|
||||
|
@@ -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,11 +78,86 @@ 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 && exploded())
|
||||
female_metric_thread(thread_d, thread_p, nut_t, false, colour = silver);
|
||||
}
|
||||
}
|
||||
|
||||
function jack_4mm_plastic_flange_radius() = 11.66 / 2; //! 4mm plastic jack socket flange radius
|
||||
|
||||
module jack_4mm_plastic(colour, thickness, display_colour = false) { //! Draw a 4mm plastic jack socket with nut positioned for specified panel thickness
|
||||
vitamin(str("jack_4mm_plastic(\"", colour, "\", 3", arg(display_colour, false), "): 4mm plastic jack socket ", colour));
|
||||
flange_r2 = jack_4mm_plastic_flange_radius();
|
||||
flange_d1 = 10.75;
|
||||
flange_t = 4;
|
||||
flange_id1 = 7.66;
|
||||
flange_id2 = 5.12;
|
||||
|
||||
length = 19.6;
|
||||
sleaved_d = 6.4;
|
||||
thread = 16;
|
||||
thread_d = 8;
|
||||
thread_p = 0.75;
|
||||
|
||||
barrel_d = 5.4;
|
||||
barrel = 18.5;
|
||||
|
||||
solder_bucket = [3.75 / 2, 2.4 / 2, 5.6];
|
||||
|
||||
nut_d = 10.8;
|
||||
nut_t = 3;
|
||||
|
||||
colour = display_colour ? display_colour : colour;
|
||||
explode(length, offset = -length + flange_t) {
|
||||
color(colour) rotate_extrude() difference() {
|
||||
union() {
|
||||
polygon([
|
||||
[flange_id2 / 2, -eps],
|
||||
[flange_id1 / 2, flange_t],
|
||||
[flange_d1 / 2, flange_t],
|
||||
[flange_r2, -eps],
|
||||
]);
|
||||
|
||||
translate([0, -length])
|
||||
square([sleaved_d / 2, length]);
|
||||
|
||||
translate([0, -thread])
|
||||
square([(thread_d - (show_threads ? thread_p : 0)) / 2, thread]);
|
||||
}
|
||||
square([4.1, 2 * length +1], center = true);
|
||||
}
|
||||
color(silver) rotate_extrude() {
|
||||
difference() {
|
||||
translate([0, -length + eps])
|
||||
square([barrel_d / 2, length]);
|
||||
|
||||
square([4, 2 * (barrel - 1)], center = true);
|
||||
}
|
||||
translate([solder_bucket.y, -length - solder_bucket.z])
|
||||
square([solder_bucket.x - solder_bucket.y, solder_bucket.z]);
|
||||
}
|
||||
if(show_threads)
|
||||
color(colour)
|
||||
translate_z(-thread)
|
||||
male_metric_thread(thread_d, thread_p, thread, false, solid = false);
|
||||
|
||||
}
|
||||
translate_z(-thickness)
|
||||
explode(-length)
|
||||
vflip() {
|
||||
color(silver)
|
||||
linear_extrude(nut_t)
|
||||
difference() {
|
||||
circle(d = nut_d, $fn = 6);
|
||||
|
||||
circle(d = thread_d);
|
||||
}
|
||||
|
||||
if(show_threads)
|
||||
female_metric_thread(thread_d, thread_p, nut_t, false, colour = silver);
|
||||
}
|
||||
|
@@ -20,7 +20,9 @@
|
||||
//
|
||||
//! Random screw down modules. Currently just DROK buck converters.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../utils/core/core.scad>
|
||||
use <screw.scad>
|
||||
use <nut.scad>
|
||||
|
||||
function mod_part(type) = type[1]; //! Description
|
||||
function mod_length(type) = type[2]; //! Body length
|
||||
|
@@ -116,7 +116,7 @@ module wingnut(type) { //! Draw a wingnut
|
||||
polygon([
|
||||
[hole_rad, 0],
|
||||
[bottom_rad, 0],
|
||||
[top_rad,, thickness],
|
||||
[top_rad, thickness],
|
||||
[hole_rad, thickness]
|
||||
]);
|
||||
for(rot = [0, 180])
|
||||
|
@@ -859,7 +859,28 @@ module terminal_35(ways, colour = "blue") { //! Draw 3.5mm terminal block
|
||||
single();
|
||||
}
|
||||
|
||||
module molex_254(ways, right_angle = 0, skip = undef) { //! Draw molex header, set `right_angle` to 1 for normal right angle version or -1 for inverted right angle version.
|
||||
module molex_254_housing(ways) { //! Draw a Molex KK housing
|
||||
vitamin(str("molex_254_housing(", ways, "): Molex KK housing ", ways, " way"));
|
||||
pitch = 2.54;
|
||||
width = ways * pitch + 0.6;
|
||||
depth = 4.9;
|
||||
height = 12.8;
|
||||
header_depth = 6.35;
|
||||
tab = [1.73, 0.96, 2.15];
|
||||
|
||||
color("white")
|
||||
translate([(header_depth - depth) / 2, 0]) {
|
||||
linear_extrude(height)
|
||||
square([depth, width], center = true);
|
||||
|
||||
for(side = [-1, 1])
|
||||
translate([-depth / 2 - tab.x / 2, side * (pitch / 2 - tab.y / 4) * ways, tab.z / 2])
|
||||
cube(tab, center = true);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
module molex_254(ways, right_angle = 0, skip = undef) { //! Draw molex KK header, set `right_angle` to 1 for normal right angle version or -1 for inverted right angle version.
|
||||
vitamin(str("molex_254(", ways, "): Molex KK header ", ways, " way"));
|
||||
pitch = 2.54;
|
||||
width = ways * pitch - 0.1;
|
||||
@@ -872,10 +893,11 @@ module molex_254(ways, right_angle = 0, skip = undef) { //! Draw molex header, s
|
||||
pin_w = 0.64;
|
||||
r = 1;
|
||||
a = right_angle ? width / 2 - r - pin_w / 2 : above;
|
||||
ra_offset = 2.72;
|
||||
ra_offset = 2.2;
|
||||
|
||||
color("white")
|
||||
translate(right_angle ? [-ra_offset, 0, depth / 2] : [ 0, 0, 0])
|
||||
rotate(right_angle ? right_angle > 0 ? [180, 90, 0] : [0, -90, 0] : [ 0, 0, 0])
|
||||
rotate(right_angle ? right_angle > 0 ? [180, 90, 0] : [0, -90, 0] : [ 0, 0, 0]) {
|
||||
union() {
|
||||
translate([ -depth / 2, -width / 2,])
|
||||
cube([depth, width, base]);
|
||||
@@ -885,6 +907,11 @@ module molex_254(ways, right_angle = 0, skip = undef) { //! Draw molex header, s
|
||||
cube([back, w, height]);
|
||||
}
|
||||
|
||||
if(show_plugs)
|
||||
translate_z(base + 0.1)
|
||||
molex_254_housing(ways);
|
||||
}
|
||||
|
||||
color("silver")
|
||||
for(i = [0 : ways -1])
|
||||
if(is_undef(skip) || !in(skip, i))
|
||||
@@ -1007,9 +1034,11 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
|
||||
function param(n, default = 0) = len(comp) > n ? comp[n] : default;
|
||||
rotate(comp.z) {
|
||||
// Components that have a cutout parameter go in this section
|
||||
if(show(comp, "2p54header")) pin_header(2p54header, comp[4], comp[5], param(6, false), param(8, false), cutouts, colour = param(7, undef));
|
||||
if(show(comp, "2p54header")) let($show_plugs = show_plugs && param(9, true))
|
||||
pin_header(2p54header, comp[4], comp[5], param(6, false), param(8, false), cutouts, colour = param(7, undef));
|
||||
if(show(comp, "2p54joiner")) pin_header(2p54joiner, comp[4], comp[5], param(6, false), param(8, false), cutouts, colour = param(7, undef));
|
||||
if(show(comp, "2p54boxhdr")) box_header(2p54header, comp[4], comp[5], param(6, false), cutouts);
|
||||
if(show(comp, "2p54boxhdr")) let($show_plugs = show_plugs && param(7, true))
|
||||
box_header(2p54header, comp[4], comp[5], param(6, false), cutouts);
|
||||
if(show(comp, "2p54socket")) pin_socket(2p54header, comp[4], comp[5], param(6, false), param(7, 0), param(8, false), cutouts, param(9, undef));
|
||||
if(show(comp, "chip")) chip(comp[4], comp[5], comp[6], param(7, grey(30)), cutouts);
|
||||
if(show(comp, "rj45")) rj45(cutouts);
|
||||
@@ -1109,7 +1138,8 @@ module pcb_grid_components(type, components, cutouts = false, angle = undef) //!
|
||||
}
|
||||
|
||||
|
||||
module pcb_cutouts(type, angle = undef) pcb_components(type, true, angle); //! Make cut outs to clear components on a PCB
|
||||
module pcb_cutouts(type, angle = undef) //! Make cut outs to clear components on a PCB
|
||||
pcb_components(type, true, angle);
|
||||
|
||||
module pcb_grid_positions(type) {
|
||||
grid = pcb_grid(type);
|
||||
@@ -1196,9 +1226,10 @@ module pcb(type) { //! Draw specified PCB
|
||||
}
|
||||
if(fr4 && len(grid) < 3 && pcb_holes(type)) { // oval lands at the ends
|
||||
screw_x = pcb_coord(type, pcb_holes(type)[0]).x;
|
||||
both_ends = len(pcb_holes(type)) > 2;
|
||||
y0 = pcb_grid(type).y;
|
||||
rows = round((pcb_width(type) - 2 * y0) / inch(0.1));
|
||||
for(end = [-1, 1], y = [1 : rows - 1])
|
||||
for(end = both_ends ? [-1, 1] : [1], y = [1 : rows - 1])
|
||||
translate([end * screw_x, y0 + y * inch(0.1) - pcb_width(type) / 2])
|
||||
hull()
|
||||
for(x = [-1, 1])
|
||||
|
@@ -856,7 +856,7 @@ ArduinoNano = let(l = 43.18, w = 17.78, pitch = inch(0.6), pins = 15, poffset =
|
||||
[ // components
|
||||
[l / 2 + poffset, w / 2 - pitch / 2, 0, "-2p54joiner", pins, 1],
|
||||
[l / 2 + poffset, w / 2 + pitch / 2, 0, "-2p54joiner", pins, 1],
|
||||
[l / 2 + poffset + inch(0.75), w / 2, 0, "2p54header", 2, 3],
|
||||
[l / 2 + poffset + inch(0.75), w / 2, 0, "2p54header", 2, 3, false, undef, false, false],
|
||||
[1.75, w / 2, 180, "usb_uA" ],
|
||||
[l / 2 - inch(0.25), w / 2, 45, "chip", 7, 7, 1.3],
|
||||
[l / 2 + poffset + inch(0.15), w / 2, 0, "chip", 3.5, 6, 1.8, silver ], // mock button
|
||||
@@ -868,7 +868,7 @@ ArduinoNano = let(l = 43.18, w = 17.78, pitch = inch(0.6), pins = 15, poffset =
|
||||
[(l - inch(pins - 1) / 10) / 2 + poffset, (w - pitch) / 2, pins, 2, silver, 2.54, pitch], // 15x2 grid of holes
|
||||
];
|
||||
|
||||
KY_040 = ["KY_040", "KY_-040 rotart encoder breakout",
|
||||
KY_040 = ["KY_040", "KY-040 rotart encoder breakout",
|
||||
26.3, 19.5, 1.6, 0, 3, 0, grey(20), false,
|
||||
[
|
||||
[3.23 + 1.5, 1.3 + 1.5],
|
||||
|
@@ -21,6 +21,8 @@ include <../utils/core/core.scad>
|
||||
use <../utils/dogbones.scad>
|
||||
|
||||
panel_clearance = 0.2;
|
||||
housing_height = 14.12; // measured height of a Dupont connector.
|
||||
housing_colour = grey(25);
|
||||
|
||||
function hdr_pitch(type) = type[1]; //! Header pitch
|
||||
function hdr_pin_length(type) = type[2]; //! Header pin length
|
||||
@@ -96,7 +98,7 @@ module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cu
|
||||
}
|
||||
// Insulator
|
||||
translate([0, right_angle ? -ra_offset - (rows - 1) * pitch / 2 : 0, right_angle ? width / 2 : 0])
|
||||
rotate([right_angle ? 90 : 0, 0, 0])
|
||||
rotate([right_angle ? 90 : 0, 0, 0]) {
|
||||
color(base_colour)
|
||||
linear_extrude(h)
|
||||
for(x = [0 : cols - 1], y = [0 : rows - 1])
|
||||
@@ -107,12 +109,18 @@ module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cu
|
||||
|
||||
square([pitch - chamfer, pitch + eps], center = true);
|
||||
}
|
||||
if(show_plugs && hdr_pin_length(type) > 7)
|
||||
color(housing_colour)
|
||||
translate_z(h + eps)
|
||||
linear_extrude(housing_height)
|
||||
square([cols * pitch , rows * pitch], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module box_header(type, cols = 1, rows = 1, smt = false, cutout = false) { //! Draw box header
|
||||
pitch = hdr_pitch(type);
|
||||
pitch = hdr_pitch(type);
|
||||
size = hdr_box_size(type);
|
||||
w = cols * pitch + 7.62;
|
||||
l = rows * pitch + 3.52;
|
||||
@@ -144,6 +152,11 @@ module box_header(type, cols = 1, rows = 1, smt = false, cutout = false) { //! D
|
||||
square([4.5, 4.5], center = true);
|
||||
}
|
||||
}
|
||||
if(show_plugs)
|
||||
color(housing_colour)
|
||||
translate_z(base)
|
||||
linear_extrude(housing_height)
|
||||
square([cols * pitch, rows * pitch], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
|
@@ -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];
|
||||
|
@@ -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]));
|
||||
}
|
||||
|
@@ -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>
|
||||
|