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

Compare commits

...

81 Commits

Author SHA1 Message Date
Chris Palmer
494002aebe Added test to MP1584EN PCB. 2023-01-24 09:21:58 +00:00
Chris Palmer
77e948f43c Added can bus connectors to OpenGrab model.
Tweaked some PCB component positions.
2023-01-24 09:21:14 +00:00
Chris Palmer
543cdb4e01 Incresed the clearance of holes made for pin header. 2023-01-24 09:19:32 +00:00
Chris Palmer
2e25932d5c Updated changelog. 2023-01-12 23:02:31 +00:00
Chris Palmer
ebd50bae53 Added SMD diodes, inductors and potentiometers.
Complete set of components added to MP1584EN buck regulator.
2023-01-12 23:00:21 +00:00
Chris
8e47270607 Updated changelog. 2023-01-07 11:12:43 +00:00
Chris
ec3e752fc5 Added missing documentation for hinge_female() module. 2023-01-07 11:09:46 +00:00
Chris
de17726d20 Updated changelog. 2023-01-07 11:03:12 +00:00
Chris
8587d52d1b Added screw_keyhole() module. 2023-01-07 10:50:32 +00:00
Chris
cec8c3a107 Added printed LED bezels. 2023-01-07 10:49:45 +00:00
Chris
848dcb86b9 Added 8mm LED. 2023-01-07 10:08:05 +00:00
Chris
a31f6f100c Revised LED dimensions. 2023-01-07 09:24:04 +00:00
Chris
b3dd635889 Fixed duplicated dxf() calls in printed box and butt_box.
Client code now calls dxf() so that the generated files can be used to speed up assembly views.
2023-01-07 09:21:04 +00:00
Chris Palmer
3c9004f12d Updated changelog. 2022-12-06 17:14:54 +00:00
Chris Palmer
e256801206 Added comment to indicate the .py suffix may be needed on linux and OSX. 2022-12-06 17:07:40 +00:00
Chris
4080179a74 Merge pull request #246 from majekw/include-terminals
Include terminal.scad in lib.scad to allow use of terminal_block().
2022-12-05 20:42:44 +00:00
Marek Wodzinski
9dc8062bef Include terminal.scad in lib.scad to allow use of terminal_block(). 2022-12-05 13:34:16 +01:00
Chris
c2e85a5833 Merge pull request #245 from drf5n/patch-1
update nuts.scad table comment
2022-10-26 13:37:41 +01:00
drf5n
f2313a3f0c update nuts.scad table comment
Change comment about nut sizes from radius to diameter.
2022-10-20 10:57:06 -04:00
Chris
d95e1e64ed Udated changelog. 2022-09-29 12:00:53 +01:00
Chris
4eaaee6a4d Merge branch 'jeroenrnl-nuthousing' 2022-09-29 11:58:06 +01:00
Chris
f1737d257b Updated images and readme. 2022-09-29 11:57:49 +01:00
Jeroen Roos
ce258d6d4f Leadnuts: add nuthousing 2022-09-27 21:50:28 +02:00
Chris
272b7efd45 Updated changelog. 2022-09-27 01:12:59 +01:00
Chris
e84b5721d7 Merge branch 'jeroenrnl-SC_flex' 2022-09-27 01:10:40 +01:00
Chris
ec85cc5d4c Updated images and readme. 2022-09-27 01:10:23 +01:00
Chris
264e4366f6 Merge branch 'SC_flex' of https://github.com/jeroenrnl/NopSCADlib into jeroenrnl-SC_flex 2022-09-27 00:35:19 +01:00
Chris
233fba275d Updated changelog. 2022-09-27 00:18:08 +01:00
Chris
c9ac393c0c Printed corner blocks now have a short_insert option. 2022-09-27 00:09:49 +01:00
Chris
208334a585 Printed box now has a short insert option. 2022-09-27 00:09:15 +01:00
Chris
3a17b89d5c Added short inserts and M5 inserts.
screw_insert() now takes a short flag.
screw_length() can now be passed an insert object.
2022-09-27 00:07:23 +01:00
Chris
0f36c02b5e Added layer_height0 global variable and updated round_to_layer() to handle it.
Moved functions from global_defs.scad to global.scad so they get documented.
2022-09-25 18:22:29 +01:00
Jeroen Roos
fb6695471f Shaft coupling: Add flexible SC / 6x8 flexible SC
Added the possibility for shaft couplings to be flexible and added a 6x8
example of such a coupling.
2022-09-24 14:17:15 +02:00
Chris
87b794d4a2 Updated changelog. 2022-08-30 22:20:24 +01:00
Chris
75262efe3a Merge branch 'ChemicalXandco-l9110s' 2022-08-30 22:18:36 +01:00
Chris
c1e4625382 Replaced generic chips with SOIC8.
Updated images and readme.
2022-08-30 22:18:24 +01:00
ChemicalXandco
6059c5f556 add L9110S 2-Channel motor driver module 2022-08-29 11:17:21 +01:00
Chris
a5a55533e1 Updated changelog. 2022-08-03 07:52:37 +01:00
Chris
4ceb6bd863 Fixed a gap in printed hinges. 2022-08-03 07:50:05 +01:00
Chris
e0df0f31a5 Updated changelog. 2022-07-16 08:23:31 +01:00
Chris
664d04ad93 Now logs the time taken to run non OpenSCAD commands in cmd_times.txt 2022-07-16 08:21:17 +01:00
Chris
78b8c2031e Updated changelog. 2022-07-15 11:56:49 +01:00
Chris
2001de2408 Merge branch 'martinbudden-bldc_includes' 2022-07-15 11:55:01 +01:00
Chris
64fb562f58 Merge branch 'bldc_includes' of https://github.com/martinbudden/NopSCADlib into martinbudden-bldc_includes 2022-07-15 11:30:10 +01:00
Chris
bf163587fa Merge branch 'martinbudden-typos' 2022-07-15 11:29:37 +01:00
Chris
1238dba90a Updated readme. 2022-07-15 11:29:27 +01:00
Chris
f40a7d19a9 Merge branch 'typos' of https://github.com/martinbudden/NopSCADlib into martinbudden-typos 2022-07-15 09:13:36 +01:00
Chris
a054eb8216 Updated changelog. 2022-07-04 10:17:29 +01:00
Chris
05edd923b8 Merge branch 'MS3FGX-SOIC' 2022-07-04 10:16:04 +01:00
Chris
b58a59dab7 Updated images and readme. 2022-07-04 10:15:39 +01:00
Chris
6b6ffb2b74 Added SOICs to tests. 2022-07-04 10:15:01 +01:00
Chris
1e30ad24e8 Added smd_soic to pcb_component(). 2022-07-04 10:14:22 +01:00
Chris
dc715ff2b7 Tweaked SOIC text size. 2022-07-04 10:13:11 +01:00
MS3FGX
c57c202e31 Adjust lead sizing 2022-07-04 00:42:36 -04:00
MS3FGX
26bfe96614 Add SOIC SMD Package 2022-07-02 20:10:35 -04:00
Chris
fa49ae09fa Updated changelog. 2022-07-02 23:38:55 +01:00
Chris
974457eabd Merge branch 'MS3FGX-LED1206' 2022-07-02 23:37:01 +01:00
Chris
2cc3c6ec7c Updated images and readme. 2022-07-02 23:36:40 +01:00
Chris
633843d45e Added LED1206 example to PCB test. 2022-07-02 23:35:59 +01:00
MS3FGX
1a472c8ed5 Add 1206 SMD LED 2022-07-02 18:12:31 -04:00
Martin Budden
f44d9ae424 Made includes relative in bldc_motors. 2022-06-30 13:34:32 +01:00
Chris Palmer
4f0c443c8e Updated changelog. 2022-06-23 18:26:22 +01:00
Chris Palmer
ecd534b577 Added NEMA_connection_pos().
Changed motor wire colours and tweaked wire position and size,
2022-06-23 18:24:44 +01:00
Martin Budden
aec72118fa Fixed typos. 2022-06-22 06:02:36 +01:00
Chris Palmer
0d828f8f7f Updated changelog. 2022-06-21 12:35:00 +01:00
Chris Palmer
28c36a4e96 rounded_polygon() now copes with the degenrate case when tangents intersect to form a sharp corner with no arc.
Added an offset() function with some limitations.
2022-06-21 12:29:57 +01:00
Chris Palmer
1ddfb35bda Updated changelog. 2022-06-21 11:59:32 +01:00
Chris Palmer
235caa4101 Merge branch 'martinbudden-extrusion1515_dimensions' 2022-06-21 11:48:46 +01:00
Chris Palmer
6a9af0af8a Updates images 2022-06-21 11:48:15 +01:00
Chris Palmer
f066b1b8ae Merge branch 'extrusion1515_dimensions' of https://github.com/martinbudden/NopSCADlib into martinbudden-extrusion1515_dimensions 2022-06-21 11:39:31 +01:00
Chris Palmer
4be7b2f0ea Merge branch 'martinbudden-typos' 2022-06-21 11:14:45 +01:00
Chris Palmer
3cc3c52b54 Merge branch 'typos' of https://github.com/martinbudden/NopSCADlib into martinbudden-typos 2022-06-21 10:37:27 +01:00
Chris Palmer
7f1634ef06 Merge branch 'martinbudden-image_size' 2022-06-21 10:28:08 +01:00
Chris Palmer
34c8c31cae Merge branch 'image_size' of https://github.com/martinbudden/NopSCADlib into martinbudden-image_size 2022-06-21 10:26:03 +01:00
Martin Budden
a6a08088d9 Fixed dimensions of E1515 extrusion. 2022-06-21 08:32:13 +01:00
Martin Budden
06443a558b Standardised setting of imgsize in scripts. 2022-06-21 07:19:11 +01:00
Martin Budden
bcf9fb38df Fixed typos. 2022-06-21 06:54:08 +01:00
Chris Palmer
18f3d43780 Added convexity parameter to clip(). 2022-06-14 15:13:21 +01:00
Chris Palmer
eda88cc8d7 Fixed vero() constructor documentation.
Fixed missing space in veroboard vitamin decription.
2022-06-14 15:10:59 +01:00
Chris Palmer
630268d71a Changed screw_knob() facets to be suitable for 3D printing.
Fixed knob_height() so it can take a screw as a type.
2022-06-14 15:08:20 +01:00
Chris
66f793b00b Updated changelog. 2022-05-31 17:22:27 +01:00
67 changed files with 1313 additions and 306 deletions

1
.gitignore vendored
View File

@@ -11,3 +11,4 @@ options.json
times.txt
*_diff.png
*.echo
cmd_times.txt

View File

@@ -3,6 +3,136 @@
This changelog is generated by `changelog.py` using manually added semantic version tags to classify commits as breaking changes, additions or fixes.
### [v20.19.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.19.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.18.1...v20.19.0 "diff with v20.18.1")
* 2023-01-12 [`ebd50ba`](https://github.com/nophead/NopSCADlib/commit/ebd50bae535283b94b310ee74c9b98b2e3b7f8be "show commit") [C.P.](# "Chris Palmer") Added SMD diodes, inductors and potentiometers.
Complete set of components added to MP1584EN buck regulator.
#### [v20.18.1](https://github.com/nophead/NopSCADlib/releases/tag/v20.18.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v20.18.0...v20.18.1 "diff with v20.18.0")
* 2023-01-07 [`ec3e752`](https://github.com/nophead/NopSCADlib/commit/ec3e752fc5b5586ef5ac838c709ab4b704dac817 "show commit") [C.](# "Chris") Added missing documentation for `hinge_female()` module.
### [v20.18.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.18.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.17.0...v20.18.0 "diff with v20.17.0")
* 2023-01-07 [`8587d52`](https://github.com/nophead/NopSCADlib/commit/8587d52d1b87dc9932c7e458798d4a6f3722a371 "show commit") [C.](# "Chris") Added `screw_keyhole()` module.
### [v20.17.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.17.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.16.0...v20.17.0 "diff with v20.16.0")
* 2023-01-07 [`cec8c3a`](https://github.com/nophead/NopSCADlib/commit/cec8c3a107b81f8badb4e2077a318cc36fcdd481 "show commit") [C.](# "Chris") Added printed LED bezels.
### [v20.16.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.16.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.15.2...v20.16.0 "diff with v20.15.2")
* 2023-01-07 [`848dcb8`](https://github.com/nophead/NopSCADlib/commit/848dcb86b9f1d9a164366208da76faea6d6050f1 "show commit") [C.](# "Chris") Added 8mm LED.
#### [v20.15.2](https://github.com/nophead/NopSCADlib/releases/tag/v20.15.2 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v20.15.1...v20.15.2 "diff with v20.15.1")
* 2023-01-07 [`a31f6f1`](https://github.com/nophead/NopSCADlib/commit/a31f6f100ce18168594b02a25d5229536f02a65c "show commit") [C.](# "Chris") Revised LED dimensions.
* 2023-01-07 [`b3dd635`](https://github.com/nophead/NopSCADlib/commit/b3dd635889f7ed4f779ee9408ff81ac64cb1f7ec "show commit") [C.](# "Chris") Fixed duplicated `dxf()` calls in printed box and `butt_box`.
Client code now calls `dxf()` so that the generated files can be used to speed up assembly views.
#### [v20.15.1](https://github.com/nophead/NopSCADlib/releases/tag/v20.15.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v20.15.0...v20.15.1 "diff with v20.15.0")
* 2022-12-06 [`e256801`](https://github.com/nophead/NopSCADlib/commit/e256801206189eafcf020cc7fdb50fff4314c397 "show commit") [C.P.](# "Chris Palmer") Added comment to indicate the `.py` suffix may be needed on linux and OSX.
### [v20.15.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.15.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.14.1...v20.15.0 "diff with v20.14.1")
* 2022-12-05 [`9dc8062`](https://github.com/nophead/NopSCADlib/commit/9dc8062befa72c6650b17d34428bfe39e709fdc2 "show commit") [M.W.](# "Marek Wodzinski") Include `terminal.scad` in `lib.scad` to allow use of `terminal_block()`.
#### [v20.14.1](https://github.com/nophead/NopSCADlib/releases/tag/v20.14.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v20.14.0...v20.14.1 "diff with v20.14.0")
* 2022-10-20 [`f2313a3`](https://github.com/nophead/NopSCADlib/commit/f2313a3f0ccbb130a7bd974b9a02f5ef6841f39e "show commit") [D.](# "drf5n") update `nuts.scad` table comment
* Change comment about nut sizes from radius to diameter.
* 2022-09-29 [`d95e1e6`](https://github.com/nophead/NopSCADlib/commit/d95e1e64edba4ef51852a1e72d00497154c80c88 "show commit") [C.](# "Chris") Udated changelog.
### [v20.14.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.14.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.13.0...v20.14.0 "diff with v20.13.0")
* 2022-09-29 [`f1737d2`](https://github.com/nophead/NopSCADlib/commit/f1737d257b54957772ab6faea102f8ddb829119b "show commit") [C.](# "Chris") Updated images and readme.
* 2022-09-27 [`ce258d6`](https://github.com/nophead/NopSCADlib/commit/ce258d6d4f1de5fbdda76a78b0ad2cbf1b41a3f9 "show commit") [J.R.](# "Jeroen Roos") Leadnuts: add nuthousing
### [v20.13.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.13.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.12.0...v20.13.0 "diff with v20.12.0")
* 2022-09-27 [`ec85cc5`](https://github.com/nophead/NopSCADlib/commit/ec85cc5d4c76baedae670a5652194bd1799a7094 "show commit") [C.](# "Chris") Updated images and readme.
* 2022-09-24 [`fb66954`](https://github.com/nophead/NopSCADlib/commit/fb6695471f935057a0949e55f70a39911ac81f4c "show commit") [J.R.](# "Jeroen Roos") Shaft coupling: Add flexible SC `/` 6x8 flexible SC
* Added the possibility for shaft couplings to be flexible and added a 6x8
example of such a coupling.
### [v20.12.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.12.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.11.0...v20.12.0 "diff with v20.11.0")
* 2022-09-27 [`c9ac393`](https://github.com/nophead/NopSCADlib/commit/c9ac393c0c7b025b3e6ad9e1030d1b13f8b879c3 "show commit") [C.](# "Chris") Printed corner blocks now have a `short_insert` option.
* 2022-09-27 [`208334a`](https://github.com/nophead/NopSCADlib/commit/208334a585ed0605bf7dbaab1050c060aa15edb7 "show commit") [C.](# "Chris") Printed box now has a short insert option.
* 2022-09-27 [`3a17b89`](https://github.com/nophead/NopSCADlib/commit/3a17b89d5ceb69834b23ff6bc46523f2dfb15f99 "show commit") [C.](# "Chris") Added short inserts and M5 inserts.
`screw_insert()` now takes a short flag.
`screw_length()` can now be passed an insert object.
* 2022-09-25 [`0f36c02`](https://github.com/nophead/NopSCADlib/commit/0f36c02b5e34b0b45d258ff8e6ed4536f0601d92 "show commit") [C.](# "Chris") Added `layer_height0` global variable and updated `round_to_layer()` to handle it.
* Moved functions from `global_defs.scad` to `global.scad` so they get documented.
### [v20.11.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.11.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.10.3...v20.11.0 "diff with v20.10.3")
* 2022-08-30 [`c1e4625`](https://github.com/nophead/NopSCADlib/commit/c1e4625382646faf6a00e78ac01e495a88169b35 "show commit") [C.](# "Chris") Replaced generic chips with SOIC8.
Updated images and readme.
* 2022-08-29 [`6059c5f`](https://github.com/nophead/NopSCADlib/commit/6059c5f5569a9fc2ba08e448bbf90328fb985ed3 "show commit") [C.](# "ChemicalXandco") add L9110S 2-Channel motor driver module
#### [v20.10.3](https://github.com/nophead/NopSCADlib/releases/tag/v20.10.3 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v20.10.2...v20.10.3 "diff with v20.10.2")
* 2022-08-03 [`4ceb6bd`](https://github.com/nophead/NopSCADlib/commit/4ceb6bd8639cd39ac39798b3eccd178526a56c13 "show commit") [C.](# "Chris") Fixed a gap in printed hinges.
#### [v20.10.2](https://github.com/nophead/NopSCADlib/releases/tag/v20.10.2 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v20.10.1...v20.10.2 "diff with v20.10.1")
* 2022-07-16 [`664d04a`](https://github.com/nophead/NopSCADlib/commit/664d04ad93c28c2614d5991e2b8dfa78964f6a99 "show commit") [C.](# "Chris") Now logs the time taken to run non OpenSCAD commands in `cmd_times.txt`
#### [v20.10.1](https://github.com/nophead/NopSCADlib/releases/tag/v20.10.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v20.10.0...v20.10.1 "diff with v20.10.0")
* 2022-06-30 [`f44d9ae`](https://github.com/nophead/NopSCADlib/commit/f44d9ae424f407baa4f8b5187819b43b30800257 "show commit") [M.B.](# "Martin Budden") Made includes relative in `bldc_motors`.
* 2022-07-15 [`1238dba`](https://github.com/nophead/NopSCADlib/commit/1238dba90ac5c48ba01abb9e7926a064353489de "show commit") [C.](# "Chris") Updated readme.
* 2022-06-22 [`aec7211`](https://github.com/nophead/NopSCADlib/commit/aec72118fac218ca033264fa7b28db2bff7db10a "show commit") [M.B.](# "Martin Budden") Fixed typos.
### [v20.10.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.10.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.9.0...v20.10.0 "diff with v20.9.0")
* 2022-07-04 [`b58a59d`](https://github.com/nophead/NopSCADlib/commit/b58a59dab70bb414dd90dc5a9055d6bf3b4f6144 "show commit") [C.](# "Chris") Updated images and readme.
* 2022-07-04 [`6b6ffb2`](https://github.com/nophead/NopSCADlib/commit/6b6ffb2b74cc89ffecbcad7c304c3c4f047a8805 "show commit") [C.](# "Chris") Added SOICs to tests.
* 2022-07-04 [`1e30ad2`](https://github.com/nophead/NopSCADlib/commit/1e30ad24e802dc6e075fd73185551202101d4793 "show commit") [C.](# "Chris") Added `smd_soic` to `pcb_component()`.
* 2022-07-04 [`dc715ff`](https://github.com/nophead/NopSCADlib/commit/dc715ff2b70ae98615ee43750f3bb7613b481f7b "show commit") [C.](# "Chris") Tweaked SOIC text size.
* 2022-07-04 [`c57c202`](https://github.com/nophead/NopSCADlib/commit/c57c202e31c70351f38ef6299c60b0deb54bd296 "show commit") [M.](# "MS3FGX") Adjust lead sizing
* 2022-07-02 [`26bfe96`](https://github.com/nophead/NopSCADlib/commit/26bfe96614741206c8da6d126edfa9eb5326cb8f "show commit") [M.](# "MS3FGX") Add SOIC SMD Package
### [v20.9.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.9.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.8.0...v20.9.0 "diff with v20.8.0")
* 2022-07-02 [`2cc3c6e`](https://github.com/nophead/NopSCADlib/commit/2cc3c6ec7c9d8ee285d49111559d40fb2a3112e1 "show commit") [C.](# "Chris") Updated images and readme.
* 2022-07-02 [`633843d`](https://github.com/nophead/NopSCADlib/commit/633843d45eacd42619581a4619752700e1cd687b "show commit") [C.](# "Chris") Added LED1206 example to PCB test.
* 2022-07-02 [`1a472c8`](https://github.com/nophead/NopSCADlib/commit/1a472c8ed549e230f7df93989f3e1db729b4b281 "show commit") [M.](# "MS3FGX") Add 1206 SMD LED
### [v20.8.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.8.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.7.0...v20.8.0 "diff with v20.7.0")
* 2022-06-23 [`ecd534b`](https://github.com/nophead/NopSCADlib/commit/ecd534b5773928b9987023bd4370f661cc750fbd "show commit") [C.P.](# "Chris Palmer") Added `NEMA_connection_pos()`.
Changed motor wire colours and tweaked wire position and size,
### [v20.7.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.7.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.6.1...v20.7.0 "diff with v20.6.1")
* 2022-06-21 [`28c36a4`](https://github.com/nophead/NopSCADlib/commit/28c36a4e966cceccbbdc330cf9a6fdeaa0283889 "show commit") [C.P.](# "Chris Palmer") `rounded_polygon()` now copes with the degenerate case when tangents intersect to form a sharp corner with no arc.
Added an `offset()` function with some limitations.
#### [v20.6.1](https://github.com/nophead/NopSCADlib/releases/tag/v20.6.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v20.6.0...v20.6.1 "diff with v20.6.0")
* 2022-06-21 [`6a9af0a`](https://github.com/nophead/NopSCADlib/commit/6a9af0af8aef68978b8be248810d07c85150341b "show commit") [C.P.](# "Chris Palmer") Updates images
* 2022-06-21 [`a6a0808`](https://github.com/nophead/NopSCADlib/commit/a6a08088d986dbcbc4d01c06e0475176ec8bc76f "show commit") [M.B.](# "Martin Budden") Fixed dimensions of E1515 extrusion.
* 2022-06-21 [`bcf9fb3`](https://github.com/nophead/NopSCADlib/commit/bcf9fb38dfabaf93508a380b85b12e3b23f28cf8 "show commit") [M.B.](# "Martin Budden") Fixed typos.
* 2022-06-21 [`06443a5`](https://github.com/nophead/NopSCADlib/commit/06443a558b407292a1e73f60c24cc90ec618d511 "show commit") [M.B.](# "Martin Budden") Standardised setting of imgsize in scripts.
### [v20.6.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.6.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.5.1...v20.6.0 "diff with v20.5.1")
* 2022-06-14 [`18f3d43`](https://github.com/nophead/NopSCADlib/commit/18f3d43780d7e083fc3b21290db2049fb4364a46 "show commit") [C.P.](# "Chris Palmer") Added convexity parameter to `clip()`.
#### [v20.5.1](https://github.com/nophead/NopSCADlib/releases/tag/v20.5.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v20.5.0...v20.5.1 "diff with v20.5.0")
* 2022-06-14 [`eda88cc`](https://github.com/nophead/NopSCADlib/commit/eda88cc8d75eb4c0cb59b368b4e2ad3db2115834 "show commit") [C.P.](# "Chris Palmer") Fixed `vero()` constructor documentation.
Fixed missing space in veroboard vitamin description.
* 2022-06-14 [`630268d`](https://github.com/nophead/NopSCADlib/commit/630268d71a0b478c28b6bde2a7c3ff9074c7a8fb "show commit") [C.P.](# "Chris Palmer") Changed `screw_knob()` facets to be suitable for 3D printing.
Fixed `knob_height()` so it can take a screw as a type.
### [v20.5.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.5.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.4.0...v20.5.0 "diff with v20.4.0")
* 2022-05-31 [`cc5654d`](https://github.com/nophead/NopSCADlib/commit/cc5654d7d756287f5311e35104003f38a4a94475 "show commit") [C.](# "Chris") Added `usb_miniA()`.
### [v20.4.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.4.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.3.1...v20.4.0 "diff with v20.3.1")
* 2022-04-01 [`d46913c`](https://github.com/nophead/NopSCADlib/commit/d46913ce4f64656889fd29dccc0709d84d4d9c49 "show commit") [C.P.](# "Chris Palmer") Printed `screw_knob()` is now fully customisable by passing a parameter
list, constructed by `screw_knob(),` in place of the screw.

View File

@@ -28,6 +28,8 @@ by downloading https://github.com/nophead/NopSCADlib/archive/master.zip and unzi
The `NopSCADlib/scripts` directory needs to be added to the executable search path, `PATH` on Windows and `path` on Linux and Mac.
Note that on Linux and OSX the full file name including the `.py` will be needed.
The installation can be tested by opening `NopSCADlib/libtest.scad` in the OpenSCAD GUI. It should render all the objects in the library in about 1 minute.
Running `tests` from the command line will run all the tests in the `tests` directory and build the `readme.md` catalog for GitHub and render it to `readme.html`

View File

@@ -29,6 +29,7 @@ rr_green = [0, 146/255, 0]; // Rep
crimson = [220/255, 20/255, 60/255];
layer_height = is_undef($layer_height) ? 0.25 : $layer_height; // layer height when printing
layer_height0 = is_undef($layer_height0) ? layer_height : $layer_height0; // height of first layer if different
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
@@ -51,10 +52,7 @@ 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; //! 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;

View File

@@ -63,6 +63,7 @@ include <vitamins/spools.scad>
include <vitamins/ssrs.scad>
include <vitamins/stepper_motors.scad>
include <vitamins/swiss_clips.scad>
include <vitamins/terminal.scad>
include <vitamins/toggles.scad>
include <vitamins/transformers.scad>
include <vitamins/tubings.scad>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 985 KiB

After

Width:  |  Height:  |  Size: 998 KiB

View File

@@ -74,6 +74,7 @@ use <tests/LDRs.scad>
use <tests/LEDs.scad>
use <tests/light_strips.scad>
use <tests/linear_bearings.scad>
use <tests/LED_bezel.scad>
use <tests/LED_meters.scad>
use <tests/magnets.scad>
use <tests/microswitches.scad>
@@ -149,6 +150,9 @@ cable_grommets_y = 0;
translate([x5, cable_grommets_y])
cable_grommets();
translate([x5, cable_grommets_y + 30])
led_bezels();
translate([x5 + 50, cable_grommets_y])
ribbon_clamps();
@@ -279,6 +283,9 @@ translate([x0, pulleys_y])
translate([x0, leadnuts_y])
leadnuts();
translate([x0 + 120, leadnuts_y])
leadnuthousings();
translate([x0, linear_bearings_y]) {
linear_bearings();
rods();

View File

@@ -453,8 +453,6 @@ module box_screw_hole_positions(type) {
}
module box_base_blank(type) { //! Generates a 2D template for the base sheet
dxf(str(box_name(type), "_base"));
difference() {
sheet_2D(box_base_sheet(type), box_width(type), box_depth(type), box_sheet_r(type));
@@ -464,8 +462,6 @@ module box_base_blank(type) { //! Generates a 2D template for the base sheet
}
module box_top_blank(type) { //! Generates a 2D template for the top sheet
dxf(str(box_name(type), "_top"));
difference() {
sheet_2D(box_top_sheet(type), box_width(type), box_depth(type), box_sheet_r(type));
@@ -479,8 +475,6 @@ function subst_sheet(type, sheet) =
sheet ? assert(sheet_thickness(sheet) == sheet_thickness(s)) sheet : s;
module box_shelf_blank(type, sheet = false) { //! Generates a 2D template for a shelf sheet
dxf(str(box_name(type), "_shelf"));
difference() {
sheet_2D(subst_sheet(type, sheet), box_width(type) - bezel_clearance, box_depth(type) - bezel_clearance, 1);
@@ -579,50 +573,44 @@ module box_shelf_bracket_section(type, rows, cols, x, y) { //! Generates section
children();
}
module box_left_blank(type, sheet = false) { //! Generates a 2D template for the left sheet, `sheet` can be set to override the type
dxf(str(box_name(type), "_left"));
module box_left_blank(type, sheet = false) //! Generates a 2D template for the left sheet, `sheet` can be set to override the type
sheet_2D(subst_sheet(type, sheet), box_depth(type) - sheet_reduction(type), box_height(type) - sheet_reduction(type), 1);
}
module box_right_blank(type, sheet = false) { //! Generates a 2D template for the right sheet, `sheet` can be set to override the type
dxf(str(box_name(type), "_right"));
module box_right_blank(type, sheet = false) //! Generates a 2D template for the right sheet, `sheet` can be set to override the type
sheet_2D(subst_sheet(type, sheet), box_depth(type) - sheet_reduction(type), box_height(type) - sheet_reduction(type), 1);
}
module box_front_blank(type, sheet = false) { //! Generates a 2D template for the front sheet, `sheet` can be set to override the type
dxf(str(box_name(type), "_front"));
module box_front_blank(type, sheet = false) //! Generates a 2D template for the front sheet, `sheet` can be set to override the type
sheet_2D(subst_sheet(type, sheet), box_width(type) - sheet_reduction(type), box_height(type) - sheet_reduction(type), 1);
}
module box_back_blank(type, sheet = false) { //! Generates a 2D template for the back sheet, `sheet` can be set to override the type
dxf(str(box_name(type), "_back"));
module box_back_blank(type, sheet = false) //! Generates a 2D template for the back sheet, `sheet` can be set to override the type
sheet_2D(subst_sheet(type, sheet), box_width(type) - sheet_reduction(type), box_height(type) - sheet_reduction(type), 1);
}
module box_base(type) //! Default base, can be overridden to customise
render_2D_sheet(box_base_sheet(type))
box_base_blank(type);
dxf(str(box_name(type), "_base"))
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);
dxf(str(box_name(type), "_top"))
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);
dxf(str(box_name(type), "_back"))
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);
dxf(str(box_name(type), "_front"))
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);
dxf(str(box_name(type), "_left"))
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);
dxf(str(box_name(type), "_right"))
box_right_blank(type);

View File

@@ -120,8 +120,6 @@ module bbox_drill_holes(type, t)
drill(screw_clearance_radius(bbox_screw(type)), 0);
module bbox_base_blank(type) { //! 2D template for the base
dxf(str(bbox_name(type), "_base"));
difference() {
sheet_2D(bbox_base_sheet(type), bbox_width(type), bbox_depth(type), 1);
@@ -130,8 +128,6 @@ module bbox_base_blank(type) { //! 2D template for the base
}
module bbox_top_blank(type) { //! 2D template for the top
dxf(str(bbox_name(type), "_top"));
t = sheet_thickness(bbox_sheets(type));
difference() {
@@ -147,8 +143,6 @@ function subst_sheet(type, sheet) =
sheet ? assert(sheet_thickness(sheet) == sheet_thickness(s)) sheet : s;
module bbox_left_blank(type, sheet = false) { //! 2D template for the left side
dxf(str(bbox_name(type), "_left"));
t = sheet_thickness(bbox_sheets(type));
bb = sheet_thickness(bbox_base_sheet(type));
@@ -161,8 +155,6 @@ module bbox_left_blank(type, sheet = false) { //! 2D template for the left side
}
module bbox_right_blank(type, sheet = false) { //! 2D template for the right side
dxf(str(bbox_name(type), "_right"));
t = sheet_thickness(bbox_sheets(type));
bb = sheet_thickness(bbox_base_sheet(type));
@@ -175,8 +167,6 @@ module bbox_right_blank(type, sheet = false) { //! 2D template for the right sid
}
module bbox_front_blank(type, sheet = false, width = 0) { //! 2D template for the front
dxf(str(bbox_name(type), "_front"));
t = sheet_thickness(bbox_sheets(type));
bb = sheet_thickness(bbox_base_sheet(type));
bt = sheet_thickness(bbox_top_sheet(type));
@@ -190,8 +180,6 @@ module bbox_front_blank(type, sheet = false, width = 0) { //! 2D template for th
}
module bbox_back_blank(type, sheet = false) { //! 2D template for the back
dxf(str(bbox_name(type), "_back"));
bb = sheet_thickness(bbox_base_sheet(type));
t = sheet_thickness(bbox_sheets(type));
@@ -205,27 +193,33 @@ module bbox_back_blank(type, sheet = false) { //! 2D template for the back
module bbox_base(type) //! Default base, can be overridden to customise
render_2D_sheet(bbox_base_sheet(type))
bbox_base_blank(type);
dxf(str(bbox_name(type), "_base"))
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);
dxf(str(bbox_name(type), "_top"))
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);
dxf(str(bbox_name(type), "_back"))
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);
dxf(str(bbox_name(type), "_front"))
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);
dxf(str(bbox_name(type), "_left"))
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);
dxf(str(bbox_name(type), "_right"))
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);

View File

@@ -23,7 +23,6 @@
include <../core.scad>
include <../vitamins/cameras.scad>
use <../vitamins/pcb.scad>
use <../vitamins/insert.scad>
wall = 1.75;
min_wall = 2 * extrusion_width;

View File

@@ -44,47 +44,49 @@ overshoot = 2; // how far screw can overshoot the insert
function corner_block_screw() = def_screw; //! Default screw type
function corner_block_hole_offset(screw = def_screw) = //! Hole offset from the edge
let(insert = screw_insert(screw))
function corner_block_hole_offset(screw = def_screw, short_insert = false) = //! Hole offset from the edge
let(insert = screw_insert(screw, short_insert))
insert_length(insert) + max(overshoot + screw_clearance_radius(screw), insert_hole_radius(insert)) + 1;
function corner_block_width(screw = def_screw, short_insert = false) = //! Block width, depth and height
corner_block_hole_offset(screw, short_insert) + insert_outer_d(screw_insert(screw, short_insert)) / 2 + wall;
function corner_block_width(screw = def_screw) = //! Block width, depth and height
corner_block_hole_offset(screw) + insert_outer_d(screw_insert(screw)) / 2 + wall;
function corner_block_v_hole(screw = def_screw, short_insert = false) = //! Transform to bottom hole
let(offset = corner_block_hole_offset(screw, short_insert))
translate([offset, offset]) * rotate([180, 0, 0]);
function corner_block_v_hole(screw = def_screw) = let(offset = corner_block_hole_offset(screw)) translate([offset, offset]) * rotate([180, 0, 0]); //! Transform to bottom hole
function corner_block_h_holes(screw = def_screw) = //! List of transforms to side holes
let(offset = corner_block_hole_offset(screw))
function corner_block_h_holes(screw = def_screw, short_insert = false) = //! List of transforms to side holes
let(offset = corner_block_hole_offset(screw, short_insert))
[translate([offset, 0, offset]) * rotate([90, 0, 0]),
translate([0, offset, offset - layer_height]) * rotate([90, 0, -90])];
function corner_block_holes(screw) = concat([corner_block_v_hole(screw)], corner_block_h_holes(screw)); //! List of transforms to all holes
function corner_block_holes(screw, short_insert = false) = //! List of transforms to all holes
concat([corner_block_v_hole(screw, short_insert)], corner_block_h_holes(screw, short_insert));
module corner_block_v_hole(screw = def_screw) //! Place children at the bottom screw hole
multmatrix(corner_block_v_hole(screw))
module corner_block_v_hole(screw = def_screw, short_insert = false) //! Place children at the bottom screw hole
multmatrix(corner_block_v_hole(screw, short_insert))
children();
module corner_block_h_holes(screw = def_screw, index = undef) //! Place children at the side screw holes
for(p = !is_undef(index) ? [corner_block_h_holes(screw)[index]] : corner_block_h_holes(screw))
module corner_block_h_holes(screw = def_screw, index = undef, short_insert = false) //! Place children at the side screw holes
for(p = !is_undef(index) ? [corner_block_h_holes(screw, short_insert)[index]] : corner_block_h_holes(screw, short_insert))
multmatrix(p)
children();
module corner_block_holes(screw = def_screw) //! Place children at all the holes
for(p = corner_block_holes(screw))
module corner_block_holes(screw = def_screw, short_insert = false) //! Place children at all the holes
for(p = corner_block_holes(screw, short_insert))
multmatrix(p)
children();
module corner_block(screw = def_screw, name = false) { //! Generate the STL for a printed corner block
module corner_block(screw = def_screw, name = false, short_insert = false) { //! Generate the STL for a printed corner block
r = 1;
cb_width = corner_block_width(screw);
cb_width = corner_block_width(screw, short_insert);
cb_height = cb_width;
cb_depth = cb_width;
insert = screw_insert(screw);
insert = screw_insert(screw, short_insert);
corner_rad = insert_outer_d(insert) / 2 + wall;
offset = corner_block_hole_offset(screw);
offset = corner_block_hole_offset(screw, short_insert);
stl(name ? name : str("corner_block", "_M", screw_radius(screw) * 20))
stl(name ? name : str("corner_block", "_M", screw_radius(screw) * 20, short_insert ? "_s": ""))
difference() {
hull() {
translate([r, r])
@@ -110,53 +112,54 @@ module corner_block(screw = def_screw, name = false) { //! Generate the STL for
rotate([0, 90, 180])
rounded_cylinder(r = corner_rad, h = r, r2 = r);
}
corner_block_v_hole(screw)
corner_block_v_hole(screw, short_insert)
insert_hole(insert, overshoot);
corner_block_h_holes(screw)
corner_block_h_holes(screw, short_insert = short_insert)
insert_hole(insert, overshoot, true);
children();
}
}
module corner_block_assembly(screw = def_screw, name = false) //! The printed block with inserts
assembly(name ? name : str("corner_block_M", 20 * screw_radius(screw)), ngb = true) {
insert = screw_insert(screw);
module corner_block_assembly(screw = def_screw, name = false, short_insert = false) //! The printed block with inserts
assembly(name ? name : str("corner_block_M", 20 * screw_radius(screw), short_insert ? "_s": ""), ngb = true) {
insert = screw_insert(screw, short_insert);
stl_colour(name ? pp2_colour : pp1_colour)
render() corner_block(screw, name) children();
render() corner_block(screw, name, short_insert) children();
corner_block_h_holes(screw)
corner_block_h_holes(screw, short_insert = short_insert)
insert(insert);
corner_block_v_hole(screw)
corner_block_v_hole(screw, short_insert)
insert(insert);
}
module fastened_corner_block_assembly(thickness, screw = def_screw, thickness_below = undef, thickness_side2 = undef, name = false, show_block = true, star_washers = true) { //! Printed block with all fasteners
module fastened_corner_block_assembly(thickness, screw = def_screw, thickness_below = undef, thickness_side2 = undef, name = false, show_block = true, star_washers = true, short_insert = false) { //! Printed block with all fasteners
thickness2 = !is_undef(thickness_below) ? thickness_below : thickness;
thickness3 = !is_undef(thickness_side2) ? thickness_side2 : thickness;
function screw_len(t) = screw_length(screw, t + overshoot, star_washers ? 2 : 1, true);
insert = screw_insert(screw, short_insert);
function screw_len(t) = screw_length(screw, t + overshoot, star_washers ? 2 : 1, insert);
screw_length = screw_len(thickness);
screw_length2 = screw_len(thickness2);
screw_length3 = screw_len(thickness3);
if(show_block)
corner_block_assembly(screw, name) children();
corner_block_assembly(screw, name, short_insert) children();
if(thickness)
corner_block_h_holes(screw, 0)
corner_block_h_holes(screw, 0, short_insert)
translate_z(thickness)
screw_and_washer(screw, screw_length, star_washers);
if(thickness3)
corner_block_h_holes(screw, 1)
corner_block_h_holes(screw, 1, short_insert)
translate_z(thickness3)
screw_and_washer(screw, screw_length3, star_washers);
if(thickness2)
corner_block_v_hole(screw)
corner_block_v_hole(screw, short_insert)
translate_z(thickness2)
screw_and_washer(screw, screw_length2, star_washers);
}
@@ -165,6 +168,10 @@ module corner_block_M20_stl() corner_block(M2_cap_screw);
module corner_block_M25_stl() corner_block(M2p5_cap_screw);
module corner_block_M30_stl() corner_block(M3_cap_screw);
module corner_block_M40_stl() corner_block(M4_cap_screw);
module corner_block_M20_s_stl() corner_block(M2_cap_screw, short_insert = true);
module corner_block_M25_s_stl() corner_block(M2p5_cap_screw, short_insert = true);
module corner_block_M30_s_stl() corner_block(M3_cap_screw, short_insert = true);
module corner_block_M40_s_stl() corner_block(M4_cap_screw, short_insert = true);
//
//! 1. Lay the blocks out and place an M2 insert in each upward facing hole.
//! 1. Push them home with a soldering iron with a conical bit heated to 200&deg;C.
@@ -197,36 +204,69 @@ module corner_block_M30_assembly() corner_block_assembly(M3_cap_screw);
//
module corner_block_M40_assembly() corner_block_assembly(M4_cap_screw);
function 2screw_block_width(screw = def_screw) = //! 2 screw block width is narrower, height and depth are as corner_block
insert_outer_d(screw_insert(screw)) + 2 * wall;
//
//! 1. Lay the blocks out and place an M2 insert in each upward facing hole.
//! 1. Push them home with a soldering iron with a conical bit heated to 200&deg;C.
//! When removing the iron it helps to twist it a little anti-clockwise to release it from the thread.
//! 1. Lay the blocks on each of their other two flat sides and repeat.
//
module corner_block_M20_s_assembly() corner_block_assembly(M2_cap_screw, short_insert = true);
function 2screw_block_v_hole(screw = def_screw) = translate([0, corner_block_hole_offset(screw)]) * rotate([180, 0, 0]); //! Transform to bottom hole
function 2screw_block_h_hole(screw = def_screw) = translate([0, 0, corner_block_hole_offset(screw)]) * rotate([90, 0, 0]); //! Transform to front hole
function 2screw_block_holes(screw) = concat([2screw_block_v_hole(screw)], [2screw_block_h_hole(screw)]); //! List of transforms to both holes
//
//! 1. Lay the blocks out and place an M2.5 insert in each upward facing hole.
//! 1. Push them home with a soldering iron with a conical bit heated to 200&deg;C.
//! When removing the iron it helps to twist it a little anti-clockwise to release it from the thread.
//! 1. Lay the blocks on each of their other two flat sides and repeat.
//
module corner_block_M25_s_assembly() corner_block_assembly(M2p5_cap_screw, short_insert = true);
module 2screw_block_v_hole(screw = def_screw) //! Place children at the bottom screw hole
multmatrix(2screw_block_v_hole(screw))
//
//! 1. Lay the blocks out and place an M3 insert in each upward facing hole.
//! 1. Push them home with a soldering iron with a conical bit heated to 200&deg;C.
//! When removing the iron it helps to twist it a little anti-clockwise to release it from the thread.
//! 1. Lay the blocks on each of their other two flat sides and repeat.
//
module corner_block_M30_s_assembly() corner_block_assembly(M3_cap_screw, short_insert = true);
//
//! 1. Lay the blocks out and place an M4 insert in each upward facing hole.
//! 1. Push them home with a soldering iron with a conical bit heated to 200&deg;C.
//! When removing the iron it helps to twist it a little anti-clockwise to release it from the thread.
//! 1. Lay the blocks on each of their other two flat sides and repeat.
//
module corner_block_M40_s_assembly() corner_block_assembly(M4_cap_screw, short_insert = true);
function 2screw_block_width(screw = def_screw, short_insert = false) = //! 2 screw block width is narrower, height and depth are as corner_block
insert_outer_d(screw_insert(screw, short_insert)) + 2 * wall;
function 2screw_block_v_hole(screw = def_screw, short_insert = false) = translate([0, corner_block_hole_offset(screw, short_insert)]) * rotate([180, 0, 0]); //! Transform to bottom hole
function 2screw_block_h_hole(screw = def_screw, short_insert = false) = translate([0, 0, corner_block_hole_offset(screw, short_insert)]) * rotate([90, 0, 0]); //! Transform to front hole
function 2screw_block_holes(screw, short_insert = false) = concat([2screw_block_v_hole(screw, short_insert)], [2screw_block_h_hole(screw, short_insert)]); //! List of transforms to both holes
module 2screw_block_v_hole(screw = def_screw, short_insert = false) //! Place children at the bottom screw hole
multmatrix(2screw_block_v_hole(screw, short_insert))
children();
module 2screw_block_h_hole(screw = def_screw) //! Place children at the front screw hole
multmatrix(2screw_block_h_hole(screw))
module 2screw_block_h_hole(screw = def_screw, short_insert = false) //! Place children at the front screw hole
multmatrix(2screw_block_h_hole(screw, short_insert))
children();
module 2screw_block_holes(screw = def_screw) //! Place children at both screw holes
for(p = 2screw_block_holes(screw))
module 2screw_block_holes(screw = def_screw, short_insert = false) //! Place children at both screw holes
for(p = 2screw_block_holes(screw, short_insert))
multmatrix(p)
children();
module 2screw_block(screw = def_screw, name = false) { //! Generate the STL for a printed 2screw block
module 2screw_block(screw = def_screw, name = false, short_insert = false) { //! Generate the STL for a printed 2screw block
r = 1;
cb_width = 2screw_block_width(screw);
cb_height = corner_block_width(screw);
cb_width = 2screw_block_width(screw, short_insert);
cb_height = corner_block_width(screw, short_insert);
cb_depth = cb_height;
insert = screw_insert(screw);
insert = screw_insert(screw, short_insert);
corner_rad = insert_outer_d(insert) / 2 + wall;
offset = corner_block_hole_offset(screw);
offset = corner_block_hole_offset(screw, short_insert);
stl(name ? name : str("2screw_block", "_M", screw_radius(screw) * 20))
stl(name ? name : str("2screw_block", "_M", screw_radius(screw) * 20, short_insert ? "_s" : ""))
difference() {
hull() {
translate([-cb_width / 2 + r, r])
@@ -245,43 +285,44 @@ module 2screw_block(screw = def_screw, name = false) { //! Generate the STL for
rotate([-90, 0, 180])
rounded_cylinder(r = corner_rad, h = r, r2 = r);
}
2screw_block_v_hole(screw)
2screw_block_v_hole(screw, short_insert)
insert_hole(insert, overshoot);
2screw_block_h_hole(screw)
2screw_block_h_hole(screw, short_insert)
insert_hole(insert, overshoot, true);
children();
}
}
module 2screw_block_assembly(screw = def_screw, name = false) //! The printed block with inserts
assembly(name ? name : str("2screw_block_M", 20 * screw_radius(screw)), ngb = true) {
insert = screw_insert(screw);
module 2screw_block_assembly(screw = def_screw, name = false, short_insert = false) //! The printed block with inserts
assembly(name ? name : str("2screw_block_M", 20 * screw_radius(screw), short_insert ? "_s" :""), ngb = true) {
insert = screw_insert(screw, short_insert);
stl_colour(name ? pp2_colour : pp1_colour)
render() 2screw_block(screw, name) children();
render() 2screw_block(screw, name, short_insert) children();
2screw_block_holes(screw)
2screw_block_holes(screw, short_insert)
insert(insert);
}
module fastened_2screw_block_assembly(thickness, screw = def_screw, thickness_below = undef, name = false, show_block = true, star_washers = true) { //! Printed block with fasteners
module fastened_2screw_block_assembly(thickness, screw = def_screw, thickness_below = undef, name = false, show_block = true, star_washers = true, short_insert = false) { //! Printed block with fasteners
thickness2 = !is_undef(thickness_below) ? thickness_below : thickness;
function screw_len(t) = screw_length(screw, t + overshoot, star_washers ? 2 : 1, true);
insert = screw_insert(screw, short_insert);
function screw_len(t) = screw_length(screw, t + overshoot, star_washers ? 2 : 1, insert);
screw_length = screw_len(thickness);
screw_length2 = screw_len(thickness2);
if(show_block)
2screw_block_assembly(screw, name) children();
2screw_block_assembly(screw, name, short_insert) children();
if(thickness)
2screw_block_h_hole(screw)
2screw_block_h_hole(screw, short_insert)
translate_z(thickness)
screw_and_washer(screw, screw_length, star_washers);
if(thickness2)
2screw_block_v_hole(screw)
2screw_block_v_hole(screw, short_insert)
translate_z(thickness2)
screw_and_washer(screw, screw_length2, star_washers);
}
@@ -289,6 +330,11 @@ module 2screw_block_M20_stl() 2screw_block(M2_cap_screw);
module 2screw_block_M25_stl() 2screw_block(M2p5_cap_screw);
module 2screw_block_M30_stl() 2screw_block(M3_cap_screw);
module 2screw_block_M40_stl() 2screw_block(M4_cap_screw);
module 2screw_block_M20_s_stl() 2screw_block(M2_cap_screw, short_insert = true);
module 2screw_block_M25_s_stl() 2screw_block(M2p5_cap_screw, short_insert = true);
module 2screw_block_M30_s_stl() 2screw_block(M3_cap_screw, short_insert = true);
module 2screw_block_M40_s_stl() 2screw_block(M4_cap_screw, short_insert = true);
//
//! 1. Lay the blocks out and place an M2 insert in the forward facing hole.
//! 1. Push them home with a soldering iron with a conical bit heated to 200&deg;C.
@@ -297,6 +343,14 @@ module 2screw_block_M40_stl() 2screw_block(M4_cap_screw);
//
module 2screw_block_M20_assembly() 2screw_block_assembly(M2_cap_screw);
//
//! 1. Lay the blocks out and place an M2 insert in the forward facing hole.
//! 1. Push them home with a soldering iron with a conical bit heated to 200&deg;C.
//! When removing the iron it helps to twist it a little anti-clockwise to release it from the thread.
//! 1. Lay the blocks on each of their other flat side and repeat.
//
module 2screw_block_M20_s_assembly() 2screw_block_assembly(M2_cap_screw, short_insert = true);
//
//! 1. Lay the blocks out and place an M2.5 insert in the forward facing hole.
//! 1. Push them home with a soldering iron with a conical bit heated to 200&deg;C.
@@ -305,6 +359,14 @@ module 2screw_block_M20_assembly() 2screw_block_assembly(M2_cap_screw);
//
module 2screw_block_M25_assembly() 2screw_block_assembly(M2p5_cap_screw);
//
//! 1. Lay the blocks out and place an M2.5 insert in the forward facing hole.
//! 1. Push them home with a soldering iron with a conical bit heated to 200&deg;C.
//! When removing the iron it helps to twist it a little anti-clockwise to release it from the thread.
//! 1. Lay the blocks on each of their other flat side and repeat.
//
module 2screw_block_M25_s_assembly() 2screw_block_assembly(M2p5_cap_screw, short_insert = true);
//
//! 1. Lay the blocks out and place an M3 insert in the forward facing hole.
//! 1. Push them home with a soldering iron with a conical bit heated to 200&deg;C.
@@ -313,6 +375,14 @@ module 2screw_block_M25_assembly() 2screw_block_assembly(M2p5_cap_screw);
//
module 2screw_block_M30_assembly() 2screw_block_assembly(M3_cap_screw);
//
//! 1. Lay the blocks out and place an M3 insert in the forward facing hole.
//! 1. Push them home with a soldering iron with a conical bit heated to 200&deg;C.
//! When removing the iron it helps to twist it a little anti-clockwise to release it from the thread.
//! 1. Lay the blocks on each of their other flat side and repeat.
//
module 2screw_block_M30_s_assembly() 2screw_block_assembly(M3_cap_screw, short_insert = true);
//
//! 1. Lay the blocks out and place an M4 insert in the forward facing hole.
//! 1. Push them home with a soldering iron with a conical bit heated to 200&deg;C.
@@ -320,3 +390,11 @@ module 2screw_block_M30_assembly() 2screw_block_assembly(M3_cap_screw);
//! 1. Lay the blocks on each of their other flat side and repeat.
//
module 2screw_block_M40_assembly() 2screw_block_assembly(M4_cap_screw);
//
//! 1. Lay the blocks out and place an M4 insert in the forward facing hole.
//! 1. Push them home with a soldering iron with a conical bit heated to 200&deg;C.
//! When removing the iron it helps to twist it a little anti-clockwise to release it from the thread.
//! 1. Lay the blocks on each of their other flat side and repeat.
//
module 2screw_block_M40_s_assembly() 2screw_block_assembly(M4_cap_screw, short_insert = true);

View File

@@ -111,15 +111,16 @@ module hinge_male(type, female = false) { //! The half with the stationary
rotate(180)
teardrop(r = kr, h = 0);
translate([-kr - 1, -kr])
square(1);
translate([-kr - inset - eps, -kr])
square([eps, t]);
}
teardrop_plus(r = pr + (female ? gap : 0), h = 0);
}
}
}
module hinge_female(type) hinge_male(type, true);
module hinge_female(type) //! The half without the pin
hinge_male(type, true);
module hinge_both(type) { //! Both parts together for printing
hinge_male(type);

85
printed/led_bezel.scad Normal file
View File

@@ -0,0 +1,85 @@
//
// NopSCADlib Copyright Chris Palmer 2022
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
//
//! Printed LED bezels for panel mounting
//
include <../core.scad>
use <../vitamins/led.scad>
function led_bezel(led, flange = 1, flange_h = 1, wall = 1, height = 8) = [led, flange, flange_h, wall, height]; //! Constructor
function led_bezel_led(type) = type[0]; //! The LED
function led_bezel_flange(type) = type[1]; //! Flange width
function led_bezel_flange_t(type) = type[2]; //! Flange thickness
function led_bezel_wall(type) = type[3]; //! Wall thickness
function led_bezel_height(type) = type[4]; //! Total height
function led_bezel_r(type) = //! Radius of the tube
corrected_radius(led_rim_dia(led_bezel_led(type)) / 2) + led_bezel_wall(type);
function led_bezel_hole_r(type) = //! Panel hole radius
led_bezel_r(type) + 0.1;
module led_bezel(type) { //! Makes the STL for the bezel
led = led_bezel_led(type);
stl(str(led[0],"_bezel")) {
rl = led_diameter(led) / 2;
rr = led_rim_dia(led) / 2;
wall = led_bezel_wall(type);
poly_tube(or = rr + wall + led_bezel_flange(type), ir = rl, h = led_bezel_flange_t(type)); // Flange
poly_tube(or = rl + wall, ir = rl, h = led_height(led) - rl - led_rim_t(led)); // Tube up to LED flange
poly_tube(or = corrected_radius(rr) + wall, ir = rr, h = led_bezel_height(type)); // Tube beyond the flange
}
}
module led_bezel_retainer(type) { //! Makes the STL for the retaining ring
led = led_bezel_led(type);
stl(str(led[0],"_bezel_retainer")) {
ir = led_bezel_r(type);
poly_tube(or = ir + led_bezel_wall(type), ir = ir, h = 4);
}
}
module led_bezel_assembly(type, colour = "red") {//! Led bezel with LED
led = led_bezel_led(type);
assembly(str(led[0], "_", colour, "_bezel")) {
translate_z(led_bezel_flange_t(type)) {
vflip()
stl_colour(pp1_colour)
led_bezel(type);
translate_z(-led_height(led) + led_diameter(led) / 2)
explode(-20)
led(led, colour);
}
}
}
module led_bezel_fastened_assembly(type, t, colour = "red") //! Led bezel fitted to panel with and retaining ring
{
explode(20)
led_bezel_assembly(type, colour);
translate_z(-t)
vflip()
stl_colour(pp2_colour)
explode(60)
led_bezel_retainer(type);
}

View File

@@ -32,8 +32,8 @@ use <../vitamins/washer.scad>
use <../vitamins/insert.scad>
use <foot.scad>
function pbox(name, wall, top_t, base_t, radius, size, foot = false, screw = false, ridges = [0, 0]) //! Construct a printed box property list
= concat([name, wall, top_t, base_t, foot, screw, radius, ridges], size);
function pbox(name, wall, top_t, base_t, radius, size, foot = false, screw = false, short_insert = false, ridges = [0, 0]) //! Construct a printed box property list
= concat([name, wall, top_t, base_t, foot, screw, short_insert, radius, ridges], size);
function pbox_name(type) = type[0]; //! Name to allow more than one box in a project
function pbox_wall(type) = type[1]; //! Wall thickness
@@ -41,11 +41,12 @@ function pbox_top(type) = type[2]; //! Top thickness
function pbox_base(type) = type[3]; //! Base thickness, can be zero for no base
function pbox_foot(type) = type[4]; //! Printed foot, can be false to suppress feet
function pbox_base_screw(type) = type[5]; //! Screw type if no feet
function pbox_radius(type) = type[6]; //! Internal corner radius
function pbox_ridges(type) = type[7]; //! Ridge wavelength and amplitude
function pbox_width(type) = type[8]; //! Internal width
function pbox_depth(type) = type[9]; //! Internal depth
function pbox_height(type) = type[10]; //! Internal height
function pbox_short_insert(type)=type[6]; //! Use short inserts
function pbox_radius(type) = type[7]; //! Internal corner radius
function pbox_ridges(type) = type[8]; //! Ridge wavelength and amplitude
function pbox_width(type) = type[9]; //! Internal width
function pbox_depth(type) = type[10]; //! Internal depth
function pbox_height(type) = type[11]; //! Internal height
base_outset = 1; // How much the base overlaps the inner dimensions
base_overlap = 2; // The width of ledge the base sits on
@@ -63,12 +64,12 @@ function pbox_total_height(type) = //! Total height including base overlap
function pbox_screw(type) = //! Foot screw if got feet else base_screw
let(foot = pbox_foot(type)) foot ? foot_screw(foot) : pbox_base_screw(type);
function pbox_insert(type) = screw_insert(pbox_screw(type)); //! The insert for the base screws
function pbox_insert(type) = screw_insert(pbox_screw(type), short = pbox_short_insert(type)); //! The insert for the base screws
function pbox_washer(type) = screw_washer(pbox_screw(type)); //! The washer for the base screws
function pbox_screw_length(type, panel_thickness = 0) = //! Length of the base screw
let(foot = pbox_foot(type), screw = pbox_screw(type))
screw_length(screw, pbox_base(type) + (foot ? foot_thickness(foot) : panel_thickness), 1, true);
screw_length(screw, pbox_base(type) + (foot ? foot_thickness(foot) : panel_thickness), 1, pbox_insert(type));
function pbox_mid_offset(type) = pbox_ridges(type).y + pbox_wall(type) / 2; // Offset to wall midpoint

View File

@@ -19,6 +19,8 @@
//
//! Knob with embedded hex head screw.
//!
//! Most aspects can be customised, e.g. the flange thickness and radius. It can also be solid or just a wall and be wavey edged or fluted.
//
include <../core.scad>
use <../utils/hanging_hole.scad>
@@ -37,10 +39,12 @@ function screw_knob(screw, wall = 2, stem_h = 6, flange_t = 4, flange_r = 9, sol
[screw, wall, stem_h, flange_t, flange_r, solid, waves, wave_amp, fluted];
function knob_nut_trap_depth(screw) = round_to_layer(screw_head_height(screw));
function knob_height(type) = screw_knob_stem_h(type) + screw_knob_flange_t(type); //! Total height of the knob
function knob_height(type) = //! Total height of the knob
let(type = !is_list(type[0]) ? screw_knob(type) : type)
screw_knob_stem_h(type) + screw_knob_flange_t(type);
module screw_knob(type) { //! Generate the STL for a knob to fit the specified hex screw
type = !is_list(type[0]) ? screw_knob(type) : type; // Allow just the screw to be specified for backwards compatability
type = !is_list(type[0]) ? screw_knob(type) : type; // Allow just the screw to be specified for backwards compatibility
screw = screw_knob_screw(type);
wall = screw_knob_wall(type);
trap_r = nut_trap_radius(screw_nut(screw));
@@ -52,13 +56,14 @@ module screw_knob(type) { //! Generate the STL for a knob to fit the specified h
waves = screw_knob_waves(type);
function wave(a) = flange_r - amp / 2 + sin(a * waves) * amp / 2;
points = [for(a = [0 : 359]) wave(a) * [sin(a), cos(a)]];
fn = r2sides(flange_r);
points = [for(i = [0 : fn - 1], a = i * 360 / fn) wave(a) * [sin(a), cos(a)]];
solid = screw_knob_solid(type);
module shape()
if(screw_knob_fluted(type))
difference() {
circle(flange_r, $fn = 360);
circle4n(flange_r);
c = flange_r * sin(90 / waves); // Flute half chord
d = flange_r - flange_r * cos(90 / waves); // Distance from chord to perimeter
@@ -67,7 +72,7 @@ module screw_knob(type) { //! Generate the STL for a knob to fit the specified h
for(i = [0 : waves - 1])
rotate(360 * i / waves)
translate([0, flange_r - amp + flute_r])
circle(flute_r, $fn = 360);
circle4n(flute_r);
}
else
polygon(points);

311
readme.md
View File

@@ -37,16 +37,17 @@ A list of changes classified as breaking, additions or fixes is maintained in [C
<tr><td> <a href = "#Circlips">Circlips</a> </td><td> <a href = "#Modules">Modules</a> </td><td> <a href = "#Spools">Spools</a> </td><td> <a href = "#Foot">Foot</a> </td><td> <a href = "#Round">Round</a> </td><td></td></tr>
<tr><td> <a href = "#Components">Components</a> </td><td> <a href = "#Nuts">Nuts</a> </td><td> <a href = "#Springs">Springs</a> </td><td> <a href = "#Handle">Handle</a> </td><td> <a href = "#Rounded_cylinder">Rounded_cylinder</a> </td><td></td></tr>
<tr><td> <a href = "#DIP">DIP</a> </td><td> <a href = "#O_ring">O_ring</a> </td><td> <a href = "#Stepper_motors">Stepper_motors</a> </td><td> <a href = "#Knob">Knob</a> </td><td> <a href = "#Rounded_polygon">Rounded_polygon</a> </td><td></td></tr>
<tr><td> <a href = "#D_connectors">D_connectors</a> </td><td> <a href = "#Opengrab">Opengrab</a> </td><td> <a href = "#Swiss_clips">Swiss_clips</a> </td><td> <a href = "#PCB_mount">PCB_mount</a> </td><td> <a href = "#Rounded_triangle">Rounded_triangle</a> </td><td></td></tr>
<tr><td> <a href = "#Displays">Displays</a> </td><td> <a href = "#PCB">PCB</a> </td><td> <a href = "#Terminals">Terminals</a> </td><td> <a href = "#PSU_shroud">PSU_shroud</a> </td><td> <a href = "#Sector">Sector</a> </td><td></td></tr>
<tr><td> <a href = "#Extrusion_brackets">Extrusion_brackets</a> </td><td> <a href = "#PCBs">PCBs</a> </td><td> <a href = "#Toggles">Toggles</a> </td><td> <a href = "#Pocket_handle">Pocket_handle</a> </td><td> <a href = "#Sweep">Sweep</a> </td><td></td></tr>
<tr><td> <a href = "#Extrusions">Extrusions</a> </td><td> <a href = "#PSUs">PSUs</a> </td><td> <a href = "#Transformers">Transformers</a> </td><td> <a href = "#Press_fit">Press_fit</a> </td><td> <a href = "#Thread">Thread</a> </td><td></td></tr>
<tr><td> <a href = "#Fans">Fans</a> </td><td> <a href = "#Panel_meters">Panel_meters</a> </td><td> <a href = "#Tubings">Tubings</a> </td><td> <a href = "#Printed_box">Printed_box</a> </td><td> <a href = "#Tube">Tube</a> </td><td></td></tr>
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#Pillars">Pillars</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td> <a href = "#Printed_pulleys">Printed_pulleys</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#Pillow_blocks">Pillow_blocks</a> </td><td> <a href = "#Veroboard">Veroboard</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Green_terminals">Green_terminals</a> </td><td> <a href = "#Pin_headers">Pin_headers</a> </td><td> <a href = "#Washers">Washers</a> </td><td> <a href = "#SSR_shroud">SSR_shroud</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Potentiometers">Potentiometers</a> </td><td> <a href = "#Wire">Wire</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Hygrometer">Hygrometer</a> </td><td> <a href = "#Pulleys">Pulleys</a> </td><td> <a href = "#Zipties">Zipties</a> </td><td> <a href = "#Socket_box">Socket_box</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#D_connectors">D_connectors</a> </td><td> <a href = "#Opengrab">Opengrab</a> </td><td> <a href = "#Swiss_clips">Swiss_clips</a> </td><td> <a href = "#LED_bezel">LED_bezel</a> </td><td> <a href = "#Rounded_triangle">Rounded_triangle</a> </td><td></td></tr>
<tr><td> <a href = "#Displays">Displays</a> </td><td> <a href = "#PCB">PCB</a> </td><td> <a href = "#Terminals">Terminals</a> </td><td> <a href = "#PCB_mount">PCB_mount</a> </td><td> <a href = "#Sector">Sector</a> </td><td></td></tr>
<tr><td> <a href = "#Extrusion_brackets">Extrusion_brackets</a> </td><td> <a href = "#PCBs">PCBs</a> </td><td> <a href = "#Toggles">Toggles</a> </td><td> <a href = "#PSU_shroud">PSU_shroud</a> </td><td> <a href = "#Sweep">Sweep</a> </td><td></td></tr>
<tr><td> <a href = "#Extrusions">Extrusions</a> </td><td> <a href = "#PSUs">PSUs</a> </td><td> <a href = "#Transformers">Transformers</a> </td><td> <a href = "#Pocket_handle">Pocket_handle</a> </td><td> <a href = "#Thread">Thread</a> </td><td></td></tr>
<tr><td> <a href = "#Fans">Fans</a> </td><td> <a href = "#Panel_meters">Panel_meters</a> </td><td> <a href = "#Tubings">Tubings</a> </td><td> <a href = "#Press_fit">Press_fit</a> </td><td> <a href = "#Tube">Tube</a> </td><td></td></tr>
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#Pillars">Pillars</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td> <a href = "#Printed_box">Printed_box</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#Pillow_blocks">Pillow_blocks</a> </td><td> <a href = "#Veroboard">Veroboard</a> </td><td> <a href = "#Printed_pulleys">Printed_pulleys</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Green_terminals">Green_terminals</a> </td><td> <a href = "#Pin_headers">Pin_headers</a> </td><td> <a href = "#Washers">Washers</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Potentiometers">Potentiometers</a> </td><td> <a href = "#Wire">Wire</a> </td><td> <a href = "#SSR_shroud">SSR_shroud</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Hygrometer">Hygrometer</a> </td><td> <a href = "#Pulleys">Pulleys</a> </td><td> <a href = "#Zipties">Zipties</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td> <a href = "#Socket_box">Socket_box</a> </td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td> <a href = "#Strap_handle">Strap_handle</a> </td><td></td><td></td></tr>
</table>
@@ -371,7 +372,7 @@ Individual teeth are not drawn, instead they are represented by a lighter colour
| 1 | `belt(T2p5x6, [ ... ])` | Belt T2.5 x 6mm x 130mm |
| 1 | `belt(T5x10, [ ... ])` | Belt T5 x 10mm x 130mm |
| 1 | `belt(T5x6, [ ... ])` | Belt T5 x 6mm x 130mm |
| 2 | `insert(F1BM3)` | Heatfit insert M3 |
| 2 | `insert(F1BM3)` | Heatfit insert M3 x 5.8mm |
| 2 | `pulley(GT2x16_toothed_idler)` | Pulley GT2 idler 16 teeth |
| 4 | `pulley(GT2x20_toothed_idler)` | Pulley GT2 idler 20 teeth |
| 6 | `pulley(GT2x16_plain_idler)` | Pulley GT2 idler smooth 9.63mm |
@@ -1528,10 +1529,14 @@ Heatfit threaded inserts. Can be pushed into thermoplastics using a soldering ir
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `insert(F1BM2)` | Heatfit insert M2 |
| 1 | `insert(F1BM2p5)` | Heatfit insert M2.5 |
| 1 | `insert(F1BM3)` | Heatfit insert M3 |
| 1 | `insert(F1BM4)` | Heatfit insert M4 |
| 2 | `insert(F1BM2)` | Heatfit insert M2 x 4mm |
| 1 | `insert(CNCKM2p5)` | Heatfit insert M2.5 x 4mm |
| 1 | `insert(F1BM2p5)` | Heatfit insert M2.5 x 5.8mm |
| 1 | `insert(CNCKM3)` | Heatfit insert M3 x 3mm |
| 1 | `insert(F1BM3)` | Heatfit insert M3 x 5.8mm |
| 1 | `insert(CNCKM4)` | Heatfit insert M4 x 4mm |
| 1 | `insert(F1BM4)` | Heatfit insert M4 x 8.2mm |
| 2 | `insert(CNCKM5)` | Heatfit insert M5 x 5.8mm |
<a href="#top">Top</a>
@@ -1646,6 +1651,16 @@ Nuts for leadscrews.
| `leadnut_od(type)` | Outer diameter of the shank |
| `leadnut_pitch(type)` | Screw pitch |
| `leadnut_screw(type)` | The type of the fixing screws |
| `leadnuthousing_height(type)` | Height of housing |
| `leadnuthousing_hole_pos(type)` | Offset from center for nut hole |
| `leadnuthousing_length(type)` | Length of housing |
| `leadnuthousing_mount_screw(type)` | Mounting screw |
| `leadnuthousing_mount_screw_len(type)` | Mounting screw length |
| `leadnuthousing_nut(type)` | Nut type this is suitable for |
| `leadnuthousing_nut_screw_length(type)` | Length of mounting screw for nut |
| `leadnuthousing_screw_dist_l(type)` | Distance between mounting holes length |
| `leadnuthousing_screw_dist_w(type)` | Distance between mounting holes width |
| `leadnuthousing_width(type)` | Width of housing |
### Functions
| Function | Description |
@@ -1657,15 +1672,21 @@ Nuts for leadscrews.
|:--- |:--- |
| `leadnut(type)` | Draw specified leadnut |
| `leadnut_screw_positions(type)` | Position children at the screw holes |
| `leadnuthousing(type)` | Nut housing, to connect a lead nut to another object |
| `leadnuthousing_nut_position(type)` | The position of the nut may be off-center, use this to get the position |
| `leadnuthousing_nut_screw_positions(type)` | get screw positions to mount the nut to the nut housing |
| `leadnuthousing_screw_positions(type)` | Get screw positions to mount the leadnut housing |
![leadnuts](tests/png/leadnuts.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `leadnut(LSN8x2)` | Leadscrew nut 8 x 2 |
| 1 | `nuthousing(LNHT8x2)` | Lead Screw Nut Housing T8 |
| 2 | `leadnut(LSN8x2)` | Leadscrew nut 8 x 2 |
| 1 | `leadnut(LSN8x8)` | Leadscrew nut 8 x 8 RobotDigg |
| 1 | `leadnut(SFU1610)` | Leadscrew nut for SFU1610 |
| 4 | `screw(M3_cap_screw, 15)` | Screw M3 cap x 15mm |
<a href="#top">Top</a>
@@ -1768,9 +1789,10 @@ Standard domed through hole LEDs. Can specify colour and lead length.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `led(LED10mm)` | LED 10 mm red |
| 1 | `led(LED10mm, "orange")` | LED 10 mm orange |
| 1 | `led(LED3mm, "green")` | LED 3 mm green |
| 1 | `led(LED5mm, "blue")` | LED 5 mm blue |
| 1 | `led(LED8mm)` | LED 8 mm red |
<a href="#top">Top</a>
@@ -2416,14 +2438,17 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `box_header(2p54header, 4, 2)` | Box header 4 x 2 |
| 1 | `d_plug(DCONN9, pcb = true)` | D-type 9 way PCB mount plug |
| 1 | `dil_socket(12, 15.24)` | DIL socket 24 x 0.6" |
| 1 | `smd_diode(DO241AC)` | DO241AC package SS34 |
| 1 | `hdmi(hdmi_full)` | HDMI socket |
| 1 | `pdip(24, 27C32, w = 15.24)` | IC 27C32 PDIP24 |
| 1 | `pdip(8, NE555)` | IC NE555 PDIP8 |
| 1 | `idc_transition(2p54header, 5)` | IDC transition header 5 x 2 |
| 1 | `smd_inductor(IND2525)` | IND2525 package 4R7 |
| 1 | `potentiometer(KY_040_encoder)` | KY_040_encoder |
| 1 | `led(LED10mm, "yellow")` | LED 10 mm yellow |
| 1 | `led(LED3mm)` | LED 3 mm red |
| 1 | `led(LED5mm, "orange")` | LED 5 mm orange |
| 1 | `led(LED8mm, "blue")` | LED 8 mm blue |
| 1 | `microswitch(small_microswitch)` | Microswitch DM1-00P-110-3 |
| 1 | `hdmi(hdmi_mini)` | Mini HDMI socket |
| 1 | `molex_254(2)` | Molex KK header 2 way |
@@ -2440,16 +2465,21 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `ax_res(res1_8, 1e+6, tol = 1)` | Resistor 1e+6 Ohms 1% 0.125W |
| 1 | `smd_led(LED0603, orange)` | SMD LED 0603 orange |
| 1 | `smd_led(LED0805, red)` | SMD LED 0805 red |
| 1 | `smd_led(LED1206, blue)` | SMD LED 1306 blue |
| 1 | `smd_capacitor(CAP0603)` | SMD capacitor 0603 |
| 1 | `smd_capacitor(CAP0805)` | SMD capacitor 0805 |
| 1 | `smd_capacitor(CAP1206)` | SMD capacitor 1206 |
| 1 | `smd_resistor(RES0603, 1K)` | SMD resistor 0603 1K 0.1W |
| 1 | `smd_resistor(RES0805, 1K)` | SMD resistor 0805 1K 0.125W |
| 1 | `smd_resistor(RES1206, 1K)` | SMD resistor 1206 1K 0.25W |
| 1 | `smd_soic(SOIC16)` | SOIC16 package ICL323 |
| 1 | `smd_soic(SOIC18)` | SOIC18 package PIC18F88 |
| 1 | `smd_soic(SOIC8)` | SOIC8 package M34063 |
| 1 | `smd_sot(SOT223)` | SOT223 package LM117 |
| 1 | `smd_sot(SOT23)` | SOT23 package 2N7000 |
| 1 | `square_button(button_4p5mm)` | Square button 4.5mm |
| 1 | `square_button(button_6mm)` | Square button 6mm |
| 1 | `smd_pot(TC33X1)` | TC33X1 package 10K |
| 1 | `pcb(TMC2130)` | TMC2130 |
| 1 | `green_terminal(gt_5p08, 2)` | Terminal block 2 way 0.2" |
| 2 | `green_terminal(gt_6p35, 2)` | Terminal block 2 way 0.25" |
@@ -2581,6 +2611,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `pcb(ExtruderPCB)` | Extruder connection PCB - not shown |
| 1 | `pcb(KY_040)` | KY-040 rotart encoder breakout |
| 1 | `pcb(Keyes5p1)` | Keyes5.1 Arduino Uno expansion board - not shown |
| 1 | `pcb(L9110S)` | L9110S 2-Channel motor driver module |
| 1 | `pcb(LIPO_fuel_gauge)` | LIPO fuel gauge |
| 1 | `pcb(MP1584EN)` | MP1584EN 3A buck converter |
| 1 | `pcb(MT3608)` | MT3608 boost converter module |
@@ -2591,7 +2622,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `molex_254(3)` | Molex KK header 3 way - not shown |
| 20 | `nut(M2_nut, nyloc = true)` | Nut M2 x 1.6mm nyloc |
| 30 | `nut(M2p5_nut, nyloc = true)` | Nut M2.5 x 2.2mm nyloc |
| 32 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc |
| 36 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc |
| 8 | `nut(M4_nut, nyloc = true)` | Nut M4 x 3.2mm nyloc |
| 1 | `pcb(PI_IO)` | PI_IO V2 - not shown |
| 1 | `pcb(PSU12V1A)` | PSU 12V 1A - not shown |
@@ -2614,10 +2645,12 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 8 | `screw(M2p5_cap_screw, 30)` | Screw M2.5 cap x 30mm |
| 4 | `screw(M2p5_pan_screw, 20)` | Screw M2.5 pan x 20mm |
| 8 | `screw(M2p5_pan_screw, 25)` | Screw M2.5 pan x 25mm |
| 10 | `screw(M3_cap_screw, 16)` | Screw M3 cap x 16mm |
| 13 | `screw(M3_cap_screw, 30)` | Screw M3 cap x 30mm |
| 9 | `screw(M3_cap_screw, 35)` | Screw M3 cap x 35mm |
| 8 | `screw(M4_cap_screw, 35)` | Screw M4 cap x 35mm |
| 8 | `screw(M3_cap_screw, 16)` | Screw M3 cap x 16mm |
| 6 | `screw(M3_cap_screw, 20)` | Screw M3 cap x 20mm |
| 8 | `screw(M3_cap_screw, 30)` | Screw M3 cap x 30mm |
| 14 | `screw(M3_cap_screw, 35)` | Screw M3 cap x 35mm |
| 4 | `screw(M4_cap_screw, 35)` | Screw M4 cap x 35mm |
| 4 | `screw(M4_cap_screw, 40)` | Screw M4 cap x 40mm |
| 1 | `pcb(XIAO)` | Seeeduino XIAO |
| 1 | `pcb(TP4056)` | TP4056 Li-lon Battery charger module |
| 3 | `terminal_35(2)` | Terminal block 2 way 3.5mm - not shown |
@@ -2626,34 +2659,37 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `pcb(WD2002SJ)` | WD2002SJ Buck Boost DC-DC converter |
| 20 | `washer(M2_washer)` | Washer M2 x 5mm x 0.3mm |
| 30 | `washer(M2p5_washer)` | Washer M2.5 x 5.9mm x 0.5mm |
| 32 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
| 36 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
| 8 | `washer(M4_washer)` | Washer M4 x 9mm x 0.8mm |
| 1 | `pcb(ZC_A0591)` | ZC-A0591 ULN2003 driver PCB |
### Printed
| Qty | Filename |
| ---:|:--- |
| 8 | pcb_spacer20100.stl |
| 4 | pcb_spacer20100.stl |
| 4 | pcb_spacer20110.stl |
| 4 | pcb_spacer2070.stl |
| 4 | pcb_spacer2080.stl |
| 4 | pcb_spacer2090.stl |
| 4 | pcb_spacer25120.stl |
| 4 | pcb_spacer25130.stl |
| 4 | pcb_spacer25140_2.stl |
| 4 | pcb_spacer25140.stl |
| 4 | pcb_spacer25150_2.stl |
| 4 | pcb_spacer25170.stl |
| 4 | pcb_spacer25160_2.stl |
| 4 | pcb_spacer25180.stl |
| 4 | pcb_spacer25190.stl |
| 2 | pcb_spacer2550.stl |
| 4 | pcb_spacer2580.stl |
| 4 | pcb_spacer30160.stl |
| 4 | pcb_spacer30190.stl |
| 5 | pcb_spacer30200.stl |
| 4 | pcb_spacer2590.stl |
| 4 | pcb_spacer30170.stl |
| 4 | pcb_spacer30200.stl |
| 5 | pcb_spacer30210.stl |
| 4 | pcb_spacer30220.stl |
| 5 | pcb_spacer30220.stl |
| 4 | pcb_spacer30230.stl |
| 4 | pcb_spacer3050.stl |
| 6 | pcb_spacer3060.stl |
| 4 | pcb_spacer40230.stl |
| 4 | pcb_spacer3060.stl |
| 2 | pcb_spacer3070.stl |
| 4 | pcb_spacer3080.stl |
| 4 | pcb_spacer40240.stl |
| 4 | pcb_spacer40250.stl |
<a href="#top">Top</a>
@@ -3303,6 +3339,7 @@ For an explanation of `screw_polysink()` see <https://hydraraptor.blogspot.com/2
|:--- |:--- |
| `screw_boss_diameter(type)` | Boss big enough for nut trap and washer |
| `screw_head_depth(type, d = 0)` | How far a counter sink head will go into a straight hole diameter d |
| `screw_insert(screw, short = false, i = 0)` | Find insert to fit specified screw, defaults to longest but can specify the shortest |
| `screw_length(screw, thickness, washers, insert = false, nyloc = false, nut = false, longer = false)` | Returns the length of the longest or shortest screw that will got through `thickness` and `washers` and possibly an `insert`, `nut` or `nyloc` |
| `screw_longer_than(x)` | Returns the length of the shortest screw length longer or equal to x |
| `screw_nut_radius(type)` | Radius of matching nut |
@@ -3315,6 +3352,7 @@ For an explanation of `screw_polysink()` see <https://hydraraptor.blogspot.com/2
| `screw(type, length, hob_point = 0, nylon = false)` | Draw specified screw, optionally hobbed or nylon |
| `screw_and_washer(type, length, star = false, penny = false)` | Screw with a washer which can be standard or penny and an optional star washer on top |
| `screw_countersink(type, drilled = true)` | Countersink shape |
| `screw_keyhole(type, h = 0)` | Make keyhole slot to accept and retain screw head |
| `screw_polysink(type, h = 100, alt = false, sink = 0)` | A countersink hole made from stacked polyholes for printed parts, default is flush, `sink` can be used to recess the head |
![screws](tests/png/screws.png)
@@ -3466,6 +3504,7 @@ Shaft couplings
| `sc_diameter(type)` | Coupling outer diameter |
| `sc_diameter1(type)` | Diameter of smaller shaft |
| `sc_diameter2(type)` | Diameter of larger shaft |
| `sc_flexible(type)` | Flexible coupling |
| `sc_length(type)` | Coupling length |
### Modules
@@ -3479,6 +3518,7 @@ Shaft couplings
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `shaft_coupling(SC_5x8_rigid)` | Shaft coupling SC_5x8_rigid |
| 1 | `shaft_coupling(SC_6x8_flex)` | Shaft coupling SC_6x8_flex |
<a href="#top">Top</a>
@@ -3542,7 +3582,7 @@ When woven sheets (e.g. carbon fibre) are rendered it is necessary to specify th
| 1 | `sheet(AL3, 30, 30, 2)` | Aluminium tooling plate 30mm x 30mm x 3mm |
| 1 | `sheet(AL6, 30, 30, 2)` | Aluminium tooling plate 30mm x 30mm x 6mm |
| 1 | `sheet(AL8, 30, 30, 2)` | Aluminium tooling plate 30mm x 30mm x 8mm |
| 1 | `sheet(Spring05, 30, 30, 2)` | Bi-metal saw blade 30mm x 30mm x 0.5mm |
| 1 | `sheet(Spring08, 30, 30, 2)` | Bi-metal saw blade 30mm x 30mm x 0.8mm |
| 1 | `sheet(Cardboard, 30, 30, 2)` | Corrugated cardboard 30mm x 30mm x 5mm |
| 1 | `sheet(Foam20, 30, 30, 2)` | Foam sponge 30mm x 30mm x 20mm |
| 1 | `sheet(DiBond, 30, 30, 2)` | Sheet DiBond 30mm x 30mm x 3mm |
@@ -3638,11 +3678,31 @@ Surface mount components for PCBs.
|:--- |:--- |
| `smd_cap_end_cap(type)` | End cap width |
| `smd_cap_size(type)` | Body length, width |
| `smd_diode_lead_z(type)` | Top of lead frame from top |
| `smd_diode_leads(type)` | Lead extent in x, width, thickness and gap |
| `smd_diode_size(type)` | Body length, width and height |
| `smd_diode_z(type)` | Height above PCB surface |
| `smd_inductor_colour(type)` | Body colour |
| `smd_inductor_lead_z(type)` | Top of lead frame from top |
| `smd_inductor_leads(type)` | Lead extent in x, width, thickness and gap |
| `smd_inductor_size(type)` | Body length, width and height |
| `smd_inductor_z(type)` | Height above PCB surface |
| `smd_led_lens(type)` | Lens length width and height |
| `smd_led_size(type)` | Body length, width and height |
| `smd_pot_contacts(type)` | Contacts width, depth, pitch and width, depth, gap for center contact |
| `smd_pot_cross(type)` | Cross head slot for screwdriver |
| `smd_pot_flat(type)` | Flat at the back of the wiper |
| `smd_pot_size(type)` | Base length, width and height |
| `smd_pot_wiper(type)` | Wiper diameter, offset, thickness, height, d1, d2, d3, d4 |
| `smd_res_end_cap(type)` | End cap width |
| `smd_res_power(type)` | Power rating in Watts |
| `smd_res_size(type)` | Body length, width and height |
| `smd_soic_lead_pitch(type)` | Lead pitch |
| `smd_soic_lead_size(type)` | Lead width, foot depth, lead thickness |
| `smd_soic_lead_span(type)` | Total span of leads |
| `smd_soic_lead_z(type)` | Top of lead frame from top |
| `smd_soic_size(type)` | Body length, width and height |
| `smd_soic_z(type)` | Height above PCB surface |
| `smd_sot_lead_pitch(type)` | Lead pitch |
| `smd_sot_lead_size(type)` | Lead width, foot depth, lead thickness |
| `smd_sot_lead_span(type)` | Total span of leads |
@@ -3662,8 +3722,12 @@ Surface mount components for PCBs.
| Module | Description |
|:--- |:--- |
| `smd_capacitor(type, height, value = undef)` | Draw an SMD capacitor with specified height |
| `smd_diode(type, value)` | Draw an SMD diode |
| `smd_inductor(type, value)` | Draw an SMD inductor |
| `smd_led(type, colour, cutout)` | Draw an SMD LED with specified `colour` |
| `smd_pot(type, value)` | Draw an SMD pot |
| `smd_resistor(type, value)` | Draw an SMD resistor with specified value |
| `smd_soic(type, value)` | Draw an SMD SOIC |
| `smd_sot(type, value)` | Draw an SMD transistor |
![smds](tests/png/smds.png)
@@ -3671,16 +3735,23 @@ Surface mount components for PCBs.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `smd_diode(DO241AC)` | DO241AC package SS34 |
| 1 | `smd_inductor(IND2525)` | IND2525 package 4R7 |
| 1 | `smd_led(LED0603, green)` | SMD LED 0603 green |
| 1 | `smd_led(LED0805, blue)` | SMD LED 0805 blue |
| 1 | `smd_led(LED1206, red)` | SMD LED 1306 red |
| 1 | `smd_capacitor(CAP0603)` | SMD capacitor 0603 |
| 1 | `smd_capacitor(CAP0805)` | SMD capacitor 0805 |
| 1 | `smd_capacitor(CAP1206)` | SMD capacitor 1206 |
| 1 | `smd_resistor(RES0603, 1R0)` | SMD resistor 0603 1R0 0.1W |
| 1 | `smd_resistor(RES0805, 10M)` | SMD resistor 0805 10M 0.125W |
| 1 | `smd_resistor(RES1206, 100K)` | SMD resistor 1206 100K 0.25W |
| 1 | `smd_soic(SOIC16)` | SOIC16 package SOIC16 |
| 1 | `smd_soic(SOIC18)` | SOIC18 package SOIC18 |
| 1 | `smd_soic(SOIC8)` | SOIC8 package SOIC8 |
| 1 | `smd_sot(SOT223)` | SOT223 package FZT851 |
| 1 | `smd_sot(SOT23)` | SOT23 package 2N7000 |
| 1 | `smd_pot(TC33X1)` | TC33X1 package 10K |
<a href="#top">Top</a>
@@ -3887,6 +3958,7 @@ NEMA stepper motor model.
| Function | Description |
|:--- |:--- |
| `NEMA_big_hole(type)` | Clearance hole for the big boss |
| `NEMA_connection_pos(type, jst_connector = false)` | Position of the wires or the connector |
| `NEMA_holes(type)` | Screw positions for for loop |
### Modules
@@ -4246,7 +4318,7 @@ Veroboard with mounting holes, track breaks, removed tracks, solder points and c
### Functions
| Function | Description |
|:--- |:--- |
| `vero(name, assembly, holes, strips, pitch = inch(0.1)` | Constructor |
| `vero(name, assembly, holes, strips, pitch = 2.54, fr4 = false, screw = M3_cap_screw, mounting_holes = [], breaks = [], no_tracks = [], components = [], joints = [])` | Constructor |
| `vero_length(type)` | Length of the board |
| `vero_size(type)` | Board size |
| `vero_thickness(type)` | Thickness of the substrate |
@@ -4274,7 +4346,7 @@ Veroboard with mounting holes, track breaks, removed tracks, solder points and c
| 4 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc |
| 4 | `screw(M3_dome_screw, 25)` | Screw M3 dome x 25mm |
| 2 | `green_terminal(gt_2p54, 10)` | Terminal block 10 way 0.1" |
| 2 | `veroboard(z_vb)` | Veroboard 5 holes x 22strips |
| 2 | `veroboard(z_vb)` | Veroboard 5 holes x 22 strips |
| 8 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
### Printed
@@ -4557,7 +4629,7 @@ The top bezel can have an optional child, which is subtracted to allow modificat
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 8 | `insert(F1BM3)` | Heatfit insert M3 |
| 8 | `insert(F1BM3)` | Heatfit insert M3 x 5.8mm |
| 4 | `screw(M3_dome_screw, 16)` | Screw M3 dome x 16mm |
| 4 | `screw(M3_dome_screw, 20)` | Screw M3 dome x 20mm |
| 2 | `sheet(DiBond, 143, 63, 1)` | Sheet DiBond 143mm x 63mm x 3mm |
@@ -4661,7 +4733,7 @@ fixing_blocks along the sides.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 60 | `insert(F1BM3)` | Heatfit insert M3 |
| 60 | `insert(F1BM3)` | Heatfit insert M3 x 5.8mm |
| 44 | `screw(M3_dome_screw, 10)` | Screw M3 dome x 10mm |
| 4 | `screw(M3_dome_screw, 12)` | Screw M3 dome x 12mm |
| 12 | `screw(M3_dome_screw, 16)` | Screw M3 dome x 16mm |
@@ -4907,42 +4979,42 @@ high lateral rigidity is not required.
### Functions
| Function | Description |
|:--- |:--- |
| `2screw_block_h_hole(screw = def_screw)` | Transform to front hole |
| `2screw_block_holes(screw)` | List of transforms to both holes |
| `2screw_block_v_hole(screw = def_screw)` | Transform to bottom hole |
| `2screw_block_width(screw = def_screw)` | 2 screw block width is narrower, height and depth are as corner_block |
| `corner_block_h_holes(screw = def_screw)` | List of transforms to side holes |
| `corner_block_hole_offset(screw = def_screw)` | Hole offset from the edge |
| `corner_block_holes(screw)` | List of transforms to all holes |
| `2screw_block_h_hole(screw = def_screw, short_insert = false)` | Transform to front hole |
| `2screw_block_holes(screw, short_insert = false)` | List of transforms to both holes |
| `2screw_block_v_hole(screw = def_screw, short_insert = false)` | Transform to bottom hole |
| `2screw_block_width(screw = def_screw, short_insert = false)` | 2 screw block width is narrower, height and depth are as corner_block |
| `corner_block_h_holes(screw = def_screw, short_insert = false)` | List of transforms to side holes |
| `corner_block_hole_offset(screw = def_screw, short_insert = false)` | Hole offset from the edge |
| `corner_block_holes(screw, short_insert = false)` | List of transforms to all holes |
| `corner_block_screw()` | Default screw type |
| `corner_block_v_hole(screw = def_screw)` | Transform to bottom hole |
| `corner_block_width(screw = def_screw)` | Block width, depth and height |
| `corner_block_v_hole(screw = def_screw, short_insert = false)` | Transform to bottom hole |
| `corner_block_width(screw = def_screw, short_insert = false)` | Block width, depth and height |
### Modules
| Module | Description |
|:--- |:--- |
| `2screw_block(screw = def_screw, name = false)` | Generate the STL for a printed 2screw block |
| `2screw_block_assembly(screw = def_screw, name = false)` | The printed block with inserts |
| `2screw_block_h_hole(screw = def_screw)` | Place children at the front screw hole |
| `2screw_block_holes(screw = def_screw)` | Place children at both screw holes |
| `2screw_block_v_hole(screw = def_screw)` | Place children at the bottom screw hole |
| `corner_block(screw = def_screw, name = false)` | Generate the STL for a printed corner block |
| `corner_block_assembly(screw = def_screw, name = false)` | The printed block with inserts |
| `corner_block_h_holes(screw = def_screw, index = undef)` | Place children at the side screw holes |
| `corner_block_holes(screw = def_screw)` | Place children at all the holes |
| `corner_block_v_hole(screw = def_screw)` | Place children at the bottom screw hole |
| `fastened_2screw_block_assembly(thickness, screw = def_screw, thickness_below = undef, name = false, show_block = true, star_washers = true)` | Printed block with fasteners |
| `fastened_corner_block_assembly(thickness, screw = def_screw, thickness_below = undef, thickness_side2 = undef, name = false, show_block = true, star_washers = true)` | Printed block with all fasteners |
| `2screw_block(screw = def_screw, name = false, short_insert = false)` | Generate the STL for a printed 2screw block |
| `2screw_block_assembly(screw = def_screw, name = false, short_insert = false)` | The printed block with inserts |
| `2screw_block_h_hole(screw = def_screw, short_insert = false)` | Place children at the front screw hole |
| `2screw_block_holes(screw = def_screw, short_insert = false)` | Place children at both screw holes |
| `2screw_block_v_hole(screw = def_screw, short_insert = false)` | Place children at the bottom screw hole |
| `corner_block(screw = def_screw, name = false, short_insert = false)` | Generate the STL for a printed corner block |
| `corner_block_assembly(screw = def_screw, name = false, short_insert = false)` | The printed block with inserts |
| `corner_block_h_holes(screw = def_screw, index = undef, short_insert = false)` | Place children at the side screw holes |
| `corner_block_holes(screw = def_screw, short_insert = false)` | Place children at all the holes |
| `corner_block_v_hole(screw = def_screw, short_insert = false)` | Place children at the bottom screw hole |
| `fastened_2screw_block_assembly(thickness, screw = def_screw, thickness_below = undef, name = false, show_block = true, star_washers = true, short_insert = false)` | Printed block with fasteners |
| `fastened_corner_block_assembly(thickness, screw = def_screw, thickness_below = undef, thickness_side2 = undef, name = false, show_block = true, star_washers = true, short_insert = false)` | Printed block with all fasteners |
![corner_block](tests/png/corner_block.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 5 | `insert(F1BM2)` | Heatfit insert M2 |
| 5 | `insert(F1BM2p5)` | Heatfit insert M2.5 |
| 5 | `insert(F1BM3)` | Heatfit insert M3 |
| 5 | `insert(F1BM4)` | Heatfit insert M4 |
| 5 | `insert(F1BM2)` | Heatfit insert M2 x 4mm |
| 5 | `insert(F1BM2p5)` | Heatfit insert M2.5 x 5.8mm |
| 5 | `insert(F1BM3)` | Heatfit insert M3 x 5.8mm |
| 5 | `insert(F1BM4)` | Heatfit insert M4 x 8.2mm |
| 5 | `screw(M2_cap_screw, 8)` | Screw M2 cap x 8mm |
| 5 | `screw(M2p5_pan_screw, 10)` | Screw M2.5 pan x 10mm |
| 5 | `screw(M3_dome_screw, 10)` | Screw M3 dome x 10mm |
@@ -5231,10 +5303,10 @@ Star washers can be omitted by setting `star_washers` to false.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 3 | `insert(F1BM2)` | Heatfit insert M2 |
| 3 | `insert(F1BM2p5)` | Heatfit insert M2.5 |
| 3 | `insert(F1BM3)` | Heatfit insert M3 |
| 3 | `insert(F1BM4)` | Heatfit insert M4 |
| 3 | `insert(F1BM2)` | Heatfit insert M2 x 4mm |
| 3 | `insert(F1BM2p5)` | Heatfit insert M2.5 x 5.8mm |
| 3 | `insert(F1BM3)` | Heatfit insert M3 x 5.8mm |
| 3 | `insert(F1BM4)` | Heatfit insert M4 x 8.2mm |
| 3 | `screw(M2_cap_screw, 8)` | Screw M2 cap x 8mm |
| 3 | `screw(M2p5_pan_screw, 10)` | Screw M2.5 pan x 10mm |
| 3 | `screw(M3_dome_screw, 10)` | Screw M3 dome x 10mm |
@@ -5309,6 +5381,7 @@ This allows the hinges and one set of screws to belong to one assembly and the o
|:--- |:--- |
| `hinge_both(type)` | Both parts together for printing |
| `hinge_fastened_assembly(type, thickness1, thickness2, angle, show_hinge = true)` | Assembled hinge with its fasteners |
| `hinge_female(type)` | The half without the pin |
| `hinge_male(type, female = false)` | The half with the stationary pin |
| `hinge_screw_positions(type)` | Place children at the screw positions |
@@ -5381,7 +5454,7 @@ inserts don't grip well in rubber.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `insert(F1BM3)` | Heatfit insert M3 |
| 1 | `insert(F1BM3)` | Heatfit insert M3 x 5.8mm |
| 1 | `nut(M4_nut, nyloc = true)` | Nut M4 x 3.2mm nyloc |
| 1 | `screw(M3_cap_screw, 8)` | Screw M3 cap x 8mm |
| 1 | `screw(M4_cap_screw, 16)` | Screw M4 cap x 16mm |
@@ -5434,7 +5507,7 @@ Printed handle that can be printed without needing support material due to its t
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 2 | `insert(F1BM4)` | Heatfit insert M4 |
| 2 | `insert(F1BM4)` | Heatfit insert M4 x 8.2mm |
| 2 | `screw(M4_cap_screw, 16)` | Screw M4 cap x 16mm |
| 2 | `washer(M4_washer)` | Washer M4 x 9mm x 0.8mm |
| 2 | `star_washer(M4_washer)` | Washer star M4 x 0.8mm |
@@ -5519,6 +5592,72 @@ The STL includes a support membrane that needs to be cut out and a thread needs
| 1 | metric_pot_knob.stl |
<a href="#top">Top</a>
---
<a name="LED_bezel"></a>
## LED_bezel
Printed LED bezels for panel mounting
[printed/led_bezel.scad](printed/led_bezel.scad) Implementation.
[tests/LED_bezel.scad](tests/LED_bezel.scad) Code for this example.
### Properties
| Function | Description |
|:--- |:--- |
| `led_bezel_flange(type)` | Flange width |
| `led_bezel_flange_t(type)` | Flange thickness |
| `led_bezel_height(type)` | Total height |
| `led_bezel_led(type)` | The LED |
| `led_bezel_wall(type)` | Wall thickness |
### Functions
| Function | Description |
|:--- |:--- |
| `led_bezel(led, flange = 1, flange_h = 1, wall = 1, height = 8)` | Constructor |
| `led_bezel_hole_r(type)` | Panel hole radius |
| `led_bezel_r(type)` | Radius of the tube |
### Modules
| Module | Description |
|:--- |:--- |
| `led_bezel(type)` | Makes the STL for the bezel |
| `led_bezel_assembly(type, colour = "red")` | Led bezel with LED |
| `led_bezel_fastened_assembly(type, t, colour = "red")` | Led bezel fitted to panel with and retaining ring |
| `led_bezel_retainer(type)` | Makes the STL for the retaining ring |
![led_bezel](tests/png/led_bezel.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `led(LED10mm, "orange")` | LED 10 mm orange |
| 1 | `led(LED3mm, "yellow")` | LED 3 mm yellow |
| 1 | `led(LED5mm, "blue")` | LED 5 mm blue |
| 1 | `led(LED8mm)` | LED 8 mm red |
### Printed
| Qty | Filename |
| ---:|:--- |
| 1 | LED10mm_bezel.stl |
| 1 | LED10mm_bezel_retainer.stl |
| 1 | LED3mm_bezel.stl |
| 1 | LED3mm_bezel_retainer.stl |
| 1 | LED5mm_bezel.stl |
| 1 | LED5mm_bezel_retainer.stl |
| 1 | LED8mm_bezel.stl |
| 1 | LED8mm_bezel_retainer.stl |
### Assemblies
| Qty | Name |
| ---:|:--- |
| 1 | LED10mm_orange_bezel_assembly |
| 1 | LED3mm_yellow_bezel_assembly |
| 1 | LED5mm_blue_bezel_assembly |
| 1 | LED8mm_red_bezel_assembly |
<a href="#top">Top</a>
---
@@ -5666,6 +5805,7 @@ It can also have printed feet on the base with the screws doubling up to hold th
| `pbox_name(type)` | Name to allow more than one box in a project |
| `pbox_radius(type)` | Internal corner radius |
| `pbox_ridges(type)` | Ridge wavelength and amplitude |
| `pbox_short_insert(type)` | Use short inserts |
| `pbox_top(type)` | Top thickness |
| `pbox_wall(type)` | Wall thickness |
| `pbox_width(type)` | Internal width |
@@ -5673,7 +5813,7 @@ It can also have printed feet on the base with the screws doubling up to hold th
### Functions
| Function | Description |
|:--- |:--- |
| `pbox(name, wall, top_t, base_t, radius, size, foot = false, screw = false, ridges = [0, 0])` | Construct a printed box property list |
| `pbox(name, wall, top_t, base_t, radius, size, foot = false, screw = false, short_insert = false, ridges = [0, 0])` | Construct a printed box property list |
| `pbox_inclusion(type)` | How far the ledge for the base extends inwards |
| `pbox_insert(type)` | The insert for the base screws |
| `pbox_screw(type)` | Foot screw if got feet else base_screw |
@@ -5697,8 +5837,8 @@ It can also have printed feet on the base with the screws doubling up to hold th
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 4 | `insert(F1BM2)` | Heatfit insert M2 |
| 4 | `insert(F1BM3)` | Heatfit insert M3 |
| 4 | `insert(F1BM2)` | Heatfit insert M2 x 4mm |
| 4 | `insert(F1BM3)` | Heatfit insert M3 x 5.8mm |
| 4 | `screw(M2_cap_screw, 6)` | Screw M2 cap x 6mm |
| 3 | `screw(M3_pan_screw, 6)` | Screw M3 pan x 6mm |
| 4 | `screw(M3_pan_screw, 10)` | Screw M3 pan x 10mm |
@@ -5827,7 +5967,7 @@ The stl and assembly must be given a name and parameterless wrappers for the stl
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 6 | `insert(F1BM3)` | Heatfit insert M3 |
| 6 | `insert(F1BM3)` | Heatfit insert M3 x 5.8mm |
| 6 | `screw(M3_cap_screw, 10)` | Screw M3 cap x 10mm |
| 6 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
| 6 | `star_washer(M3_washer)` | Washer star M3 x 0.5mm |
@@ -5883,8 +6023,8 @@ Clamp for ribbon cable and polypropylene strip or one or more ribbon cables.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 2 | `insert(F1BM2)` | Heatfit insert M2 |
| 2 | `insert(F1BM3)` | Heatfit insert M3 |
| 2 | `insert(F1BM2)` | Heatfit insert M2 x 4mm |
| 2 | `insert(F1BM3)` | Heatfit insert M3 x 5.8mm |
| 1 | | Ribbon cable 20 way 100mm |
| 1 | | Ribbon cable 8 way 100mm |
| 2 | `screw(M2_dome_screw, 8)` | Screw M2 dome x 8mm |
@@ -5916,6 +6056,8 @@ Clamp for ribbon cable and polypropylene strip or one or more ribbon cables.
## Screw_knob
Knob with embedded hex head screw.
Most aspects can be customised, e.g. the flange thickness and radius. It can also be solid or just a wall and be wavey edged or fluted.
[printed/screw_knob.scad](printed/screw_knob.scad) Implementation.
[tests/screw_knob.scad](tests/screw_knob.scad) Code for this example.
@@ -6000,7 +6142,7 @@ UK 13A socket and printed backbox with earth terminal for the panel it is mounte
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 4 | `insert(F1BM3)` | Heatfit insert M3 |
| 4 | `insert(F1BM3)` | Heatfit insert M3 x 5.8mm |
| 1 | `mains_socket(Contactum)` | Mains socket 13A |
| 1 | `mains_socket(MKLOGIC)` | Mains socket 13A, switched |
| 2 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc |
@@ -6057,7 +6199,7 @@ The STL and assembly must be given a name and parameterless wrappers for the stl
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 4 | `insert(F1BM3)` | Heatfit insert M3 |
| 4 | `insert(F1BM3)` | Heatfit insert M3 x 5.8mm |
| 4 | `screw(M3_cap_screw, 10)` | Screw M3 cap x 10mm |
| 4 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
| 4 | `star_washer(M3_washer)` | Washer star M3 x 0.5mm |
@@ -6119,7 +6261,7 @@ be fully customised by passing a list of properties.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 2 | `insert(F1BM3)` | Heatfit insert M3 |
| 2 | `insert(F1BM3)` | Heatfit insert M3 x 5.8mm |
| 2 | `screw(M3_pan_screw, 8)` | Screw M3 pan x 8mm |
| 2 | `washer(M3_penny_washer)` | Washer penny M3 x 12mm x 0.8mm |
| 2 | `star_washer(M3_washer)` | Washer star M3 x 0.5mm |
@@ -6606,6 +6748,8 @@ 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] |
| `line_intersection(l0, l1)` | Return the point where two 2D lines intersect or undef if they don't. |
| `offset(points, offset)` | Offset a 2D polygon, breaks for concave shapes and negative offsets if the offset is more than half the smallest feature size. |
| `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` |
@@ -6694,7 +6838,7 @@ Each vertex, apart from the first and the last, has an associated radius and the
| `rounded_path_vertices(path)` | Show the unrounded version of a rounded_path for debug |
| `segmented_path(path, min_segment)` | Add points to a path to enforce a minimum segment length |
| `skin_faces(points, npoints, facets, loop, offset = 0)` | Create the mesh for the swept volume without end caps |
| `spiral_paths(path, n, r, twists, start_angle)` | Create a new paths which sprial around the given path. Use for making twisted cables |
| `spiral_paths(path, n, r, twists, start_angle)` | Create a new paths which spiral around the given path. Use for making twisted cables |
| `sweep(path, profile, loop = false, twist = 0)` | Generate the point list and face list of the swept volume |
### Modules
@@ -6839,7 +6983,7 @@ The `pose()` module allows assembly views in the readme to be posed differently
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `insert(F1BM3)` | Heatfit insert M3 |
| 1 | `insert(F1BM3)` | Heatfit insert M3 x 5.8mm |
| 1 | `widget(3)` | Rivet like thing for 3mm sheets |
| 1 | `screw(M3_cap_screw, 8)` | Screw M3 cap x 8mm |
| 1 | `sheet(PMMA3, 20, 20, 1)` | Sheet acrylic 20mm x 20mm x 3mm |
@@ -6881,7 +7025,7 @@ Original version by Doug Moen on the OpenSCAD forum
| Module | Description |
|:--- |:--- |
| `box(xmin, ymin, zmin, xmax, ymax, zmax)` | Construct a box given its bounds |
| `clip(xmin = -inf, ymin = -inf, zmin = -inf, xmax = inf, ymax = inf, zmax = inf)` | Clip child to specified boundaries |
| `clip(xmin = -inf, ymin = -inf, zmin = -inf, xmax = inf, ymax = inf, zmax = inf, convexity = 1)` | Clip child to specified boundaries |
![clip](tests/png/clip.png)
@@ -6892,6 +7036,7 @@ Original version by Doug Moen on the OpenSCAD forum
<a name="Global"></a>
## Global
Global constants, functions and modules. This file is used directly or indirectly in every scad file.
See [global_defs.scad](../../global_defs.scad) for a list of global constants.
[utils/core/global.scad](utils/core/global.scad) Implementation.
@@ -6904,6 +7049,7 @@ Global constants, functions and modules. This file is used directly or indirectl
| `cm(x)` | cm to mm conversion |
| `echoit(x)` | Echo expression and return it, useful for debugging |
| `foot(x)` | Foot to mm conversion |
| `grey(n)` | Generate a shade of grey to pass to color(). |
| `in(list, x)` | Returns true if `x` is an element in the `list` |
| `inch(x)` | Inch to mm conversion (For fractional inches, 'inch(1 + 7/8)' will work as expected.) |
| `limit(x, min, max)` | Force x in range min <= x <= max |
@@ -6912,6 +7058,7 @@ Global constants, functions and modules. This file is used directly or indirectl
| `no_point(str)` | Replace decimal point in string with 'p' |
| `r2sides(r)` | Replicates the OpenSCAD logic to calculate the number of sides from the radius |
| `r2sides4n(r)` | Round up the number of sides to a multiple of 4 to ensure points land on all axes |
| `round_to_layer(z)` | Round up to a layer boundary using `layer_height0` for the first layer and `layer_height` for subsequent layers. |
| `slice(list, start = 0, end = undef)` | Slice a list or string with Python type semantics |
| `sqr(x)` | Returns the square of `x` |
| `yard(x)` | Yard to mm conversion |

View File

@@ -157,7 +157,7 @@ if __name__ == '__main__':
break
j += 1
# Print verson info
# Print version info
print('%s [%s](%s "show release") %s %s' % ('#' * (level + 1), ver, url + '/releases/tag/' + ver, type, diff), file = file)
# Print commits excluding merges

View File

@@ -26,7 +26,7 @@ from set_config import *
from exports import bom_to_parts
import os
import openscad
from tests import do_cmd, update_image, colour_scheme, background
from tests import do_cmd, update_image, colour_scheme, background, image_size
from deps import mtime
from colorama import init
import json
@@ -95,7 +95,7 @@ def render(target, type):
render = "--preview" if type == 'stl' or colour != pp1 else "--render"
tmp_name = tmp_dir + '/' + part[:-4] + '.png'
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)
openscad.run("-o", tmp_name, png_maker_name, colour_scheme, "--projection=p", image_size, 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)

View File

@@ -57,13 +57,13 @@ def set_config(target, usage = None):
sys.exit(1)
if not targets:
print("Not a muli-configuration project (no config_<target>.scad files found)")
print("Not a multi-configuration project (no config_<target>.scad files found)")
if usage:
usage()
sys.exit(1)
if not target in targets:
print(target + " is not a configuration, avaliable configurations are: " + valid_targets_string())
print(target + " is not a configuration, available configurations are: " + valid_targets_string())
if usage:
usage()
sys.exit(1)

View File

@@ -36,8 +36,7 @@ from blurb import *
from colorama import Fore
from tmpdir import *
w = 4096
h = w
image_size = "--imgsize=4096,4096"
threshold = 20 # Image comparison allowed number of different pixels
fuzz = 5 # Image comparison allowed percentage error in pixel value
@@ -48,7 +47,12 @@ def do_cmd(cmd, output = sys.stdout):
for arg in cmd:
print(arg, end = " ")
print()
return subprocess.call(cmd, stdout = output, stderr = output)
t = time.time()
rv = subprocess.call(cmd, stdout = output, stderr = output)
elapsed = time.time() - t
with open("cmd_times.txt", 'at') as f:
print(cmd[0], cmd[-1], elapsed, file = f)
return rv
def compare_images(a, b, c):
if not os.path.isfile(b):
@@ -119,7 +123,7 @@ def tests(tests):
libtest = True
lib_blurb = scrape_blurb(scad_name)
if not os.path.isfile(png_name):
openscad.run(scad_name, "-o", png_name, colour_scheme, "--projection=p", "--imgsize=%d,%d" % (w, h), "--camera=0,0,0,50,0,340,500", "--autocenter", "--viewall");
openscad.run(scad_name, "-o", png_name, colour_scheme, "--projection=p", image_size, "--camera=0,0,0,50,0,340,500", "--autocenter", "--viewall");
do_cmd(["magick", png_name, "-trim", "-resize", "1280", "-bordercolor", background, "-border", "10", png_name])
else:
#
@@ -240,7 +244,7 @@ def tests(tests):
print(changed)
t = time.time()
tmp_name = tmp_dir + '/tmp.png'
openscad.run_list([scad_name, "-o", tmp_name] + options.list() + ["-D$bom=2", colour_scheme, "--projection=p", "--imgsize=%d,%d" % (w, h), "--camera=0,0,0,70,0,315,500", "--autocenter", "--viewall", "-d", dname]);
openscad.run_list([scad_name, "-o", tmp_name] + options.list() + ["-D$bom=2", colour_scheme, "--projection=p", image_size, "--camera=0,0,0,70,0,315,500", "--autocenter", "--viewall", "-d", dname]);
times.add_time(scad_name, t)
do_cmd(["magick", tmp_name, "-trim", "-resize", "1000x600", "-bordercolor", background, "-border", "10", tmp_name])
update_image(tmp_name, png_name)

View File

@@ -25,7 +25,7 @@
from __future__ import print_function
from set_config import *
import openscad
from tests import do_cmd, update_image, colour_scheme, background
from tests import do_cmd, update_image, colour_scheme, background, image_size
import time
import times
import options
@@ -223,7 +223,7 @@ def views(target, do_assemblies = None):
target_def = ['-D$target="%s"' % target] if target else []
cwd_def = ['-D$cwd="%s"' % os.getcwd().replace('\\', '/')]
view_def = ['--viewall', '--autocenter'] if not (zoomed & (1 << explode)) else ['--camera=0,0,0,55,0,25,140']
openscad.run_list(["-o", tmp_name, png_maker_name] + options.list() + target_def + cwd_def + view_def + ["-D$pose=1", "-D$explode=%d" % explode, colour_scheme, "--projection=p", "--imgsize=4096,4096", "-d", dname]);
openscad.run_list(["-o", tmp_name, png_maker_name] + options.list() + target_def + cwd_def + view_def + ["-D$pose=1", "-D$explode=%d" % explode, colour_scheme, "--projection=p", image_size, "-d", dname]);
times.add_time(png_name, t)
do_cmd(["magick", tmp_name, "-trim", "-resize", "1004x1004", "-bordercolor", background, "-border", "10", tmp_name])
update_image(tmp_name, png_name)

37
tests/LED_bezel.scad Normal file
View File

@@ -0,0 +1,37 @@
//
// NopSCADlib Copyright Chris Palmer 2018
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// 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>
use <../utils/layout.scad>
include <../vitamins/leds.scad>
use <../printed/led_bezel.scad>
module led_bezels()
layout([for(l = LEDs) led_diameter(l)], 6) let(l = LEDs[$i], b = led_bezel(l))
if($preview)
led_bezel_fastened_assembly(b, 3, ["yellow", "blue", "red", "orange"][$i % 4]);
else {
led_bezel(b);
translate([0, -20])
led_bezel_retainer(b);
}
led_bezels();

View File

@@ -23,7 +23,7 @@ include <../vitamins/leds.scad>
module leds()
layout([for(l = LEDs) led_diameter(l)], 5)
led(LEDs[$i], ["green", "blue", "red"][$i % 3]);
led(LEDs[$i], ["green", "blue", "red", "orange"][$i % 4]);
if($preview)
leds();

View File

@@ -61,6 +61,7 @@ test_pcb = ["test_pcb", "Test PCB",
[
[ 20, -5, 180, "trimpot10"],
[ 20, -15, 90, "trimpot10", true],
[ 7, 2, 90, "smd_led", LED1206, "blue"],
[ 10, 2, 90, "smd_led", LED0805, "red"],
[ 13, 2, 90, "smd_led", LED0603, "orange"],
[ 16, 2, 90, "smd_res", RES1206, "1K"],
@@ -69,6 +70,8 @@ test_pcb = ["test_pcb", "Test PCB",
[ 25, 2, 90, "smd_cap", CAP1206, 1.5],
[ 28, 2, 90, "smd_cap", CAP0805, 1.0],
[ 31, 2, 90, "smd_cap", CAP0603, 0.7],
[ 34, 3, 90, "smd_diode",DO241AC, "SS34"],
[ 22, 6, -90, "smd_pot", TC33X1, "10K"],
[ 16, 6, -90, "smd_sot", SOT23, "2N7000"],
[ 28, 20, -90, "smd_sot", SOT223, "LM117"],
@@ -77,9 +80,10 @@ test_pcb = ["test_pcb", "Test PCB",
[ 10, 20, 0, "2p54boxhdr", 4, 2],
[ 10, 30, 0, "2p54socket", 6, 1],
[ 25, 30, 0, "2p54socket", 4, 1, false, 0, false, "red" ],
[ 65, 50, 0, "led", LED3mm, "red"],
[ 75, 50, 0, "led", LED5mm, "orange"],
[ 90, 50, 0, "led", LED10mm, "yellow"],
[ 59, 50, 180, "led", LED3mm, "red"],
[ 66, 50, 180, "led", LED5mm, "orange"],
[ 77, 50, 180, "led", LED8mm, "blue"],
[ 90, 50, 180, "led", LED10mm, "yellow"],
[ 10, 45, 180, "rj45"],
[ 8, 65, 180, "usb_A"],
[ 8, 105, 180, "usb_Ax2"],
@@ -114,7 +118,6 @@ test_pcb = ["test_pcb", "Test PCB",
[ 60, 3, 0, "flex"],
[ 50, 15, -90, "flat_flex"],
[ 40, 15, -90, "flat_flex", true],
[ 60, 35, 0, "D_plug", DCONN9],
[ 50, 50, 0, "molex_hdr", 2],
[ 50, 60, 0, "jst_xh", 2],
@@ -139,8 +142,13 @@ test_pcb = ["test_pcb", "Test PCB",
[ 55, 170, 0, "button_4p5mm"],
[ 50, 185, 0, "microswitch", small_microswitch],
[ 52, 200, 0, "pcb", 11, TMC2130 ],
[ 80, 200, 0, "pdip", 24, "27C32", true, inch(0.6) ],
[ 80, 170, 0, "pdip", 8, "NE555" ],
[ 80, 210, 0, "pdip", 24, "27C32", true, inch(0.6) ],
[ 80, 180, 0, "pdip", 8, "NE555" ],
[ 71, 180, 0, "smd_inductor", IND2525, "4R7"],
[ 80, 166, -90, "smd_soic", SOIC18, "PIC18F88"],
[ 71, 166, -90, "smd_soic", SOIC16, "ICL323"],
[ 64, 166, -90, "smd_soic", SOIC8, "M34063"],
[ 80, 150, 0, "chip", 10, 5, 1, grey(20)],
[ 52, 206, 0, "2p54socket", 8, 1 ],
@@ -148,7 +156,8 @@ test_pcb = ["test_pcb", "Test PCB",
[ 50, 220, 0, "standoff", 5, 4.5, 12.5, 2.54],
[ 50, 240, 0, "potentiometer"],
[ 75, 240, 0, "potentiometer", KY_040_encoder, 8],
[ 30, 85, -90, "7seg", WT5011BSR, 2],
[ 30, 85, -90, "7seg", WT5011BSR, 2],
[ 30, 55, -90, "D_plug", DCONN9],
],
// accessories
[]

View File

@@ -34,10 +34,30 @@ module smds() {
let(c = smd_capacitors[$i])
smd_capacitor(c, smd_cap_size(c).y * 0.8);
translate([0, 12])
translate([0, 9])
layout([for(d = smd_diodes) smd_diode_size(d).x], 1)
let(d = smd_diodes[$i])
smd_diode(d, ["SS34"][$i]);
translate([0, 15])
layout([for(s = smd_sots) smd_sot_size(s).x], 1)
let(s = smd_sots[$i])
smd_sot(s, ["2N7000", "FZT851"][$i]);
translate([0, 21])
layout([for(p = smd_pots) smd_pot_size(p).x], 1)
let(p = smd_pots[$i])
smd_pot(p, "10K");
translate([0, 28])
layout([for(s = smd_soics) smd_soic_size(s).x], 1)
let(s = smd_soics[$i])
smd_soic(s, s[0]);
translate([0, 36])
layout([for(i = smd_inductors) smd_inductor_size(i).x], 1)
let(i = smd_inductors[$i])
smd_inductor(i, "4R7");
}
if($preview)

View File

@@ -24,9 +24,15 @@ include <../vitamins/inserts.scad>
module inserts() {
for(i = [0: len(inserts) -1])
translate([10 * i, 0])
translate([10 * i, 5])
insert(inserts[i]);
for(i = [0: len(short_inserts) -1])
translate([10 * i, -5])
insert(short_inserts[i]);
stl_colour(pp1_colour)
translate([len(inserts) * 10, 0]) {
insert_lug(inserts[0], 2, 1);

View File

@@ -25,6 +25,26 @@ module leadnuts()
layout([for(n = leadnuts) leadnut_flange_dia(n)], 5)
leadnut(leadnuts[$i]);
module leadnuthousings()
layout([for(n = leadnuthousings) leadnuthousing_width(n)], 5) {
rotate([0,0,270]) {
leadnuthousing(leadnuthousings[$i]);
explode(15)
leadnuthousing_nut_position(leadnuthousings[$i])
leadnut(leadnuthousing_nut(leadnuthousings[$i]));
explode(17 + leadnuthousing_nut_screw_length(leadnuthousings[$i]))
translate_z(leadnuthousing_height(leadnuthousings[$i])/2)
leadnuthousing_nut_screw_positions(leadnuthousings[$i])
screw(leadnut_screw(
leadnuthousing_nut(leadnuthousings[$i])),
leadnuthousing_nut_screw_length(leadnuthousings[$i])
);
}
}
if($preview)
let($show_threads = true)
let($show_threads = true) {
leadnuts();
translate([0,50,0])
leadnuthousings();
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 83 KiB

BIN
tests/png/led_bezel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 157 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 103 KiB

View File

@@ -16,18 +16,28 @@
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
show_connection_pos = false;
/* [Hidden] */
include <../core.scad>
include <../vitamins/stepper_motors.scad>
use <../utils/layout.scad>
has_connector = [NEMA17_27, NEMA17_40, NEMA17_40L280, NEMA8_30, NEMA8_30BH];
module stepper_motors()
layout([for(s = stepper_motors) NEMA_width(s)], 5, no_offset = false) let(m = stepper_motors[$i]) {
rotate(180)
NEMA(m, 0, in([NEMA17_27, NEMA17_40, NEMA17_40L280, NEMA8_30, NEMA8_30BH], m));
rotate(180) {
NEMA(m, 0, in(has_connector, m) ? true : show_connection_pos ? undef : false);
translate_z(4)
NEMA_screws(m, M3_pan_screw, n = $i - 2, earth = $i > 6 ? undef : $i - 3);
if(show_connection_pos)
translate(NEMA_connection_pos(m, in(has_connector, m)))
sphere();
translate_z(4)
NEMA_screws(m, M3_pan_screw, n = $i - 2, earth = $i > 6 ? undef : $i - 3);
}
}
if($preview)

View File

@@ -41,8 +41,8 @@ module box(xmin, ymin, zmin, xmax, ymax, zmax) //! Construct a box given its bou
[0,2,3,1]] // left
);
module clip(xmin = -inf, ymin = -inf, zmin = -inf, xmax = inf, ymax = inf, zmax = inf) //! Clip child to specified boundaries
render() intersection() {
module clip(xmin = -inf, ymin = -inf, zmin = -inf, xmax = inf, ymax = inf, zmax = inf, convexity = 1) //! Clip child to specified boundaries
render(convexity = convexity) intersection() {
children();
box(xmin, ymin, zmin, xmax, ymax, zmax);

View File

@@ -19,6 +19,7 @@
//
//! Global constants, functions and modules. This file is used directly or indirectly in every scad file.
//! See [global_defs.scad](../../global_defs.scad) for a list of global constants.
//
include <../../global_defs.scad>
@@ -38,6 +39,13 @@ 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
function round_to_layer(z) = //! Round up to a layer boundary using `layer_height0` for the first layer and `layer_height` for subsequent layers.
z <= 0 ? 0 :
z <= layer_height0 ? layer_height0 :
ceil((z -layer_height0) / layer_height) * layer_height + layer_height0;
function grey(n) = [0.01, 0.01, 0.01] * n; //! Generate a shade of grey to pass to color().
module translate_z(z) //! Shortcut for Z only translations
translate([0, 0, z]) children();
@@ -68,7 +76,7 @@ module render_if(render = true, convexity = 2) //! Renders an object if `re
module extrude_if(h, center = true) //! Extrudes 2D object to 3D when `h` is nonzero, otherwise leaves it 2D
if(h)
linear_extrude(h, center = center, convexity = 2) // 3D
linear_extrude(h, center = center, convexity = 5) // 3D
children();
else
children(); // 2D

View File

@@ -33,7 +33,7 @@ function circle_tangent(p1, p2) = //! Compute the clockwise tangent between two
dx = p2.x - p1.x,
dy = p2.y - p1.y,
d = sqrt(dx * dx + dy * dy),
theta = atan2(dy, dx) + acos((r1 - r2) / d),
theta = assert(d, str("points conicident ", p1)) atan2(dy, dx) + acos((r1 - r2) / d),
v = [cos(theta), sin(theta)]
)[ p1 + r1 * v, p2 + r2 * v ];
@@ -72,24 +72,52 @@ function rounded_polygon_length(points, tangents) = //! Calculate the length giv
arcs = rounded_polygon_arcs(points, tangents)
) sumv( map( concat(tangents, arcs), function(e) e[2] ) );
function line_intersection(l0, l1) = //! Return the point where two 2D lines intersect or undef if they don't.
assert(Len(l0) == 2 && Len(l1) == 2, "Two 2D vectors expected")
let(
p0 = l0[0], p1 = l0[1], p2 = l1[0], p3 = l1[1],
v1 = p1 - p0,
v2 = p3 - p2,
v3 = p0 - p2,
det = v1.x * v2.y - v2.x * v1.y,
s = det ? (-v1.y * v3.x + v1.x * v3.y) / det : inf,
t = det ? ( v2.x * v3.y - v2.y * v3.x) / det : inf
) s >= 0 && s <= 1 && t >= 0 && t <= 1 ? p0 + t * v1 : undef;
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
) [for(i = [0 : len - 1], last = (i - 1 + len) % len)
let(
t0 = vec2(tangents[last]),
t1 = vec2(tangents[i]),
p = line_intersection(t0, t1), // Do the tangents cross?
R = points[i][2]
)
if(!is_undef(p)) // Tangents intersect, so just add the intersection point
p
else
each [ // Else link the two tangent ends with an arc
t0[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
if(R)
t1[0], // Start of next tangent
]
];
function offset(points, offset) = //! Offset a 2D polygon, breaks for concave shapes and negative offsets if the offset is more than half the smallest feature size.
rounded_polygon([for(p = points) [p.x, p.y, offset]]);
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));

View File

@@ -127,8 +127,8 @@ function sweep_transforms(path, loop = false, twist = 0) =
i = i + 1,
rot = i < len ? rotate_from_to(tangents[i - 1], tangents[i]) * rot : undef) rot],
missmatch = loop ? calculate_twist(rotations[0], rotations[last]) : 0,
rotation = missmatch + twist
mismatch = loop ? calculate_twist(rotations[0], rotations[last]) : 0,
rotation = mismatch + twist
)
[for(i = [0 : last])
let(za = rotation * lengths[i] / length)
@@ -239,7 +239,7 @@ function segmented_path(path, min_segment) = [ //! Add points to a path to enfo
path[len(path) - 1]
];
function spiral_paths(path, n, r, twists, start_angle) = let( //! Create a new paths which sprial around the given path. Use for making twisted cables
function spiral_paths(path, n, r, twists, start_angle) = let( //! Create a new paths which spiral around the given path. Use for making twisted cables
segment = twists ? path_length(path) / twists / r2sides(2 * r) : inf,
transforms = sweep_transforms(segmented_path(path, segment), twist = 360 * twists)
) [for(i = [0 : n - 1]) let(initial = [r, 0, 0, 1] * rotate(start_angle + i * 360 / n)) [for(t = transforms) initial * t]];

View File

@@ -20,11 +20,11 @@
//
//! Brushless DC electric motor
//
include <NopSCADlib/core.scad>
include <../utils/core/core.scad>
use <NopSCADlib/vitamins/rod.scad>
use <NopSCADlib/utils/thread.scad>
use <NopSCADlib/utils/tube.scad>
use <rod.scad>
use <../utils/thread.scad>
use <../utils/tube.scad>
function BLDC_diameter(type) = type[1]; //! Diameter of motor

View File

@@ -20,7 +20,7 @@
// Extrusion
//
// W H d1 d2 sq cw cwi t st f recess
E1515 = [ "E1515", 15, 15, -2.5, 0, 5.7, 3.4, 5.7, 1.1, 1.1, 0.5, false ];
E1515 = [ "E1515", 15, 15, -3.3, 0, 5.5, 6.2, 9.5, 1.0, 0.9, 0.5, false ];
E2020 = [ "E2020", 20, 20, -4.2, -3, 8, 6, 12.0, 2, 2, 1, false ];
E2020t = [ "E2020t",20, 20, -5.0, -3, 7.8, 6.2, 11.0, 1.8, 1.5, 1.5, [7.2, 0.5] ];
E2040 = [ "E2040", 20, 40, -4.2, -3, 8, 6, 12.0, 2, 2, 1, false ];

View File

@@ -53,7 +53,7 @@ module insert(type) { //! Draw specified insert
ring2_h = ring1_h + chamfer1;
gap = (length - ring1_h - ring2_h - chamfer2) / 3;
vitamin(str("insert(", type[0], "): Heatfit insert M", insert_screw_diameter(type)));
vitamin(str("insert(", type[0], "): Heatfit insert M", insert_screw_diameter(type), " x ", length, "mm"));
$fn = 64;
thread_d = insert_screw_diameter(type);
explode(20, offset = [0, 0, -5]) translate_z(eps) vflip() {

View File

@@ -34,6 +34,13 @@ F1BM2p5 = [ "F1BM2p5", 5.8, 4.6, 4.0, 2.5, 3.65, 1.6, 4.4, 3.9 ];
F1BM3 = [ "F1BM3", 5.8, 4.6, 4.0, 3, 3.65, 1.6, 4.4, 3.9 ];
F1BM4 = [ "F1BM4", 8.2, 6.3, 5.6, 4, 5.15, 2.3, 6.0, 5.55 ];
inserts = [ F1BM2, F1BM2p5, F1BM3, F1BM4 ];
CNCKM2p5 =[ "CNCKM2p5",4.0, 4.6, 4.0, 2.5, 3.65, 1.0, 4.4, 3.9 ];
CNCKM3 = [ "CNCKM3", 3.0, 4.6, 4.0, 3, 3.65, 0.7, 4.4, 3.9 ];
CNCKM4 = [ "CNCKM4", 4.0, 6.3, 5.6, 4, 5.15, 1.0, 6.0, 5.55];
CNCKM5 = [ "CNCKM5", 5.8, 7.1, 6.4, 5, 6.0, 1.6, 6.8, 6.33];
inserts = [ F1BM2, F1BM2p5, F1BM3, F1BM4, CNCKM5 ];
short_inserts = [ F1BM2, CNCKM2p5, CNCKM3, CNCKM4, CNCKM5 ];
use <insert.scad>

View File

@@ -23,6 +23,7 @@
include <../utils/core/core.scad>
use <../utils/tube.scad>
use <../utils/thread.scad>
use <../vitamins/screw.scad>
function leadnut_bore(type) = type[2]; //! Thread size
function leadnut_od(type) = type[3]; //! Outer diameter of the shank
@@ -41,6 +42,17 @@ function leadnut_colour(type) = type[15]; //! The colour
function leadnut_shank(type) = leadnut_height(type) - leadnut_flange_t(type) - leadnut_flange_offset(type); //! The length of the shank below the flange
function leadnuthousing_length(type) = type[2]; //! Length of housing
function leadnuthousing_width(type) = type[3]; //! Width of housing
function leadnuthousing_height(type) = type[4]; //! Height of housing
function leadnuthousing_hole_pos(type) = type[5]; //! Offset from center for nut hole
function leadnuthousing_screw_dist_l(type) = type[6]; //! Distance between mounting holes length
function leadnuthousing_screw_dist_w(type) = type[7]; //! Distance between mounting holes width
function leadnuthousing_mount_screw(type) = type[8]; //! Mounting screw
function leadnuthousing_mount_screw_len(type) = type[9]; //! Mounting screw length
function leadnuthousing_nut(type) = type[10]; //! Nut type this is suitable for
function leadnuthousing_nut_screw_length(type) = type[11]; //! Length of mounting screw for nut
module leadnut_screw_positions(type) { //! Position children at the screw holes
holes = leadnut_holes(type);
flat = leadnut_flat(type);
@@ -87,3 +99,58 @@ module leadnut(type) { //! Draw specified leadnut
}
}
}
module leadnuthousing_screw_positions(type) { //! Get screw positions to mount the leadnut housing
for(p = [[-1,-1], [1,-1], [1,1], [-1,1]])
translate([p.x * leadnuthousing_screw_dist_l(type)/2, p.y * leadnuthousing_screw_dist_w(type)/2, 0])
children();
}
module leadnuthousing_nut_position(type) { //! The position of the nut may be off-center, use this to get the position
translate([leadnuthousing_hole_pos(type),0, leadnuthousing_height(type)/2])
children();
}
module leadnuthousing_nut_screw_positions(type) { //! get screw positions to mount the nut to the nut housing
translate([leadnuthousing_hole_pos(type),0, 0])
leadnut_screw_positions(leadnuthousing_nut(type))
children();
}
module leadnuthousing(type) { //! Nut housing, to connect a lead nut to another object
vitamin(str("nuthousing(", type[0], "): ", type[1]));
leadnut = leadnuthousing_nut(type);
screw = leadnut_screw(leadnut);
d = screw_radius(screw) * 2;
p = metric_coarse_pitch(d);
sl = leadnuthousing_nut_screw_length(type);
ms = leadnuthousing_mount_screw(type);
msl = leadnuthousing_mount_screw_len(type);
md = screw_radius (ms) * 2;
mp = metric_coarse_pitch(md);
color("silver")
difference() {
cube([leadnuthousing_length(type), leadnuthousing_width(type), leadnuthousing_height(type)], center = true);
translate([leadnuthousing_hole_pos(type),0,0]) {
cylinder(d=leadnut_od(leadnut), h=leadnuthousing_length(type)+2, center=true);
translate_z(leadnut_flange_offset(leadnut))
leadnut_screw_positions(leadnut)
cylinder(r=screw_radius(leadnut_screw(leadnut)), h=sl+1);
}
rotate([0,90,0])
leadnuthousing_screw_positions(type)
cylinder(r=screw_radius(ms), h=msl+1);
}
if(show_threads) {
translate([leadnuthousing_hole_pos(type),0,leadnuthousing_height(type)/2 - sl/2 - leadnut_flange_t(leadnut)])
leadnut_screw_positions(leadnut)
female_metric_thread(d, p, sl, center = true, colour = silver);
rotate([0,90,0])
translate_z(msl/2)
leadnuthousing_screw_positions(type)
female_metric_thread(md, mp, msl, center = true, colour = silver);
}
}

View File

@@ -29,5 +29,9 @@ LSN8x8 = ["LSN8x8", "Leadscrew nut 8 x 8 RobotDigg", 8, 12.75,19, 25.4, 4.1, 0
SFU1610 = ["SFU1610", "Leadscrew nut for SFU1610", 16, 28, 42.5, 48, 10, 0, 6, 6, 38/2, M6_cap_screw, 5, 10, 40, "#DFDAC5"];
leadnuts = [LSN8x2, LSN8x8, SFU1610];
// L W H Hole Mounting screws (top) Nut Nut mount screw
// Pos Dist L Dist W Type L Length
LNHT8x2 = [ "LNHT8x2", "Lead Screw Nut Housing T8", 30, 34, 30, -1, 20, 24, M4_cs_cap_screw, 15, LSN8x2, 15 ];
leadnuthousings = [LNHT8x2];
use <leadnut.scad>

View File

@@ -25,10 +25,11 @@
// d t h h
// t t
//
LED3mm = ["LED3mm", 3, 3.1, 1.0, 4.5, 2.54, 0.4];
LED5mm = ["LED5mm", 5, 5.6, 0.9, 8.5, 2.54, 0.4];
LED10mm = ["LED10mm", 10, 11.0, 2.0, 13.5, 2.54, 0.4];
LED3mm = ["LED3mm", 3, 3.15, 1.15, 4.6, 2.54, 0.4];
LED5mm = ["LED5mm", 5, 5.9, 1.1, 9.0, 2.54, 0.4];
LED8mm = ["LED8mm", 8, 9.2, 1.95,11.0, 2.54, 0.4];
LED10mm = ["LED10mm", 10, 11.0, 2.0, 13.5, 2.54, 0.4];
LEDs = [LED3mm, LED5mm, LED10mm];
LEDs = [LED3mm, LED5mm, LED8mm, LED10mm];
use <led.scad>

View File

@@ -28,14 +28,14 @@ M5_nut_depth = 4;
M6_nut_depth = 5;
M8_nut_depth = 6.5;
// s r t n w t t
// c a h y a r h
// r d i l s a r
// e i c o h p e
// w u k c e d
// s n r d
// e t e p
// s h p i
// s d t n w t t
// c i h y a r h
// r a i l s a r
// e m c o h p e
// w e k c e d
// t n r d
// e e t e p
// r s h p i
// s k t t
// h c
// h

View File

@@ -37,14 +37,13 @@ pole_w = 2;
pole_l = 36;
poles = 15;
pcb = ["", "", width, width, 0.8, 0, 3.5, 0, "darkgreen", false, [],
[ [ 3.45, 19, 0, "button_4p5mm"],
[ 2.75, 24.5, 0, "smd_led", LED0805, "green"],
[ 2.75, 28.0, 0, "smd_led", LED0805, "red"],
[ 28.5, 13, 0, "2p54header", 3, 1, false, undef, true],
pcb = ["", "", width, width, 0.8, 0, 3.5, 0, "darkgreen", false, [],
[ [ 3.475, 19.05, 0, "button_4p5mm"],
[ 2.2, 24.125, 0, "smd_led", LED0805, "green"],
[ 2.375, 27.9, 0, "smd_led", LED0805, "red"],
[ 28.4, 13.345, 0, "2p54header", 3, 1, false, undef, true],
]];
module opengrab_hole_positions() //! Position children at the screw positions
let($d = 3.2)
for($x = [-pitch, pitch], $y = [-pitch, pitch])
@@ -96,6 +95,17 @@ module opengrab() { //! Draw OpenGrab module
if(show_threads)
female_metric_thread(3, metric_coarse_pitch(3), depth - 1, center = false, colour = brass);
}
module molex()
translate_z(opengrab_pcb_z() + pcb_thickness(pcb))
color(grey(90))
import("stl/Molex_5023860470.stl");
translate([-8.4, -14.2])
molex();
translate([0.125, -14.2])
molex();
}
module opengrab_target() { //! Draw OpenGrab target

View File

@@ -1134,6 +1134,10 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
if(show(comp, "smd_res")) smd_resistor(comp[4], comp[5]);
if(show(comp, "smd_cap")) smd_capacitor(comp[4], comp[5], param(6, undef));
if(show(comp, "smd_sot")) smd_sot(comp[4], comp[5]);
if(show(comp, "smd_soic")) smd_soic(comp[4], comp[5]);
if(show(comp, "smd_diode")) smd_diode(comp[4], comp[5]);
if(show(comp, "smd_inductor")) smd_inductor(comp[4], comp[5]);
if(show(comp, "smd_pot")) smd_pot(comp[4], comp[5]);
if(show(comp, "vero_pin")) vero_pin(param(4, false));
if(show(comp, "terminal")) terminal_block(comp[5], comp[4]);
if(show(comp, "text")) color("white") linear_extrude(eps) resize([comp[4], comp[5]]) text(comp[6], font = param(7, "Liberation Mono"), valign = "center", halign = "center");

View File

@@ -744,9 +744,29 @@ WD2002SJ = ["WD2002SJ", "WD2002SJ Buck Boost DC-DC converter", 78, 47, 1.6, 0, 3
],
[]];
MP1584EN = ["MP1584EN", "MP1584EN 3A buck converter", 22, 17, 1.2, 0, 1, [2, 2], "green", false,
[[1.75, 1.75], [1.75, -1.75], [-1.75, 1.75], [-1.75, -1.75], [-1.75, -4.4], [-1.75, 4.48], [1.75, -4.4], [1.75, 4.4]],
[]
MP1584EN = ["MP1584EN", "MP1584EN 3A buck converter", 22, 17, 1.25, 0, 1, [2, 2], "green", false,
[[1.75, 1.75], [-1.75, 1.75], [-1.75, 4.4], [1.75, 4.4]],
[ [1.75, 8.5, 90, "smd_cap", CAP1206, 1],
[-1.75, 8.5, 90, "smd_cap", CAP1206, 1],
[7.5, 8.5, 0, "smd_soic", SOIC8, "WP1584EN"],
[3.9, 8.3, 90, "smd_res", RES0603, "104"],
[3.9, 11.2, 90,"smd_cap", CAP0603, 0.5],
[3.9, 5.4, 90, "smd_res", RES0603, "822"],
[6.2, 3.5, 0, "smd_res", RES0603, "104"],
[6.2, 2.1, 0, "smd_cap", CAP0603, 0.5],
[9.2, 3.5, 0, "smd_res", RES0603, "104"],
[9.2, 2.1, 0, "smd_res", RES0603, "104"],
[6.3, 14.4, 0, "smd_diode",DO241AC, "SS34"],
[12.1, 4.9, 0, "smd_cap", CAP0603, 0.5],
[15.8, 4.9, 0, "smd_cap", CAP0603, 0.5],
[14.5, 10, 90, "smd_inductor", IND2525, "4R7"],
[14.7, 1.8,-90,"smd_pot", TC33X1, "10K"],
[13.9, -1.4, 0,"text", 5, 1.5, "D-SUN", "Liberation Mono:style=Bold"],
[17.7, -1.2, 0,"text", 1.5,1.5,"\u2296", "MS Gothic:style=Bold"],
[17.9, 1.75, 0,"text", 1.5,1.5,"\u2295", "MS Gothic:style=Bold"],
],
[],
[1.75,17 -4.4, 2, 2, silver, 18.5, 2.65], // Abuse the grid facility to get the round pads
];
PERF80x20 = ["PERF80x20", "Perfboard 80 x 20mm", 80, 20, 1.6, 0, 2.3, 0, "green", true, [[2,2],[-2,2],[2,-2],[-2,-2]], [], [], [5.71, 3.65]];
@@ -908,9 +928,19 @@ KY_040 = ["KY_040", "KY-040 rotart encoder breakout",
],
[]];
L9110S = ["L9110S", "L9110S 2-Channel motor driver module", 29.2, 23, 1.6, 0, 3, 0, "#2140BE", false, [[10.7, 2.3], [10.7, -2.3], [-5.3, 2.3], [-5.3, -2.3] ],
[
[ -1.3, 11.5, 0, "2p54header", 1, 6],
[ 16, 9.5 , 0, "smd_led", LED0805, "red"],
for(i = [-1, 1]) [ 4, 5.5*i, 180, "gterm508", 2],
for(i = [-1, 1]) [ 17.38, 3*i, 90, "smd_soic", SOIC8, "" ]
],
[]];
tiny_pcbs = [XIAO, MP1584EN, TP4056, ESP_01, LIPO_fuel_gauge];
pcbs = [RAMPSEndstop, KY_040, MT3608, ZC_A0591, ArduinoNano, RPI_Pico, ESP32_DOIT_V1, RPI0, EnviroPlus, ArduinoUno3, ArduinoLeonardo, WD2002SJ, RPI3, RPI4, BTT_RELAY_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_E3_TURBO, BTT_SKR_V1_4_TURBO, DuetE, Duex5];
pcbs = [RAMPSEndstop, MT3608, KY_040, L9110S, ZC_A0591, ArduinoNano, RPI_Pico, ESP32_DOIT_V1, RPI0, EnviroPlus, ArduinoUno3, ArduinoLeonardo, WD2002SJ, RPI3, RPI4, BTT_RELAY_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_E3_TURBO, BTT_SKR_V1_4_TURBO, DuetE, Duex5];
pcbs_not_shown = [Melzi, Duex2, PSU12V1A, Keyes5p1, PI_IO, ExtruderPCB];

View File

@@ -20,7 +20,7 @@
include <../utils/core/core.scad>
use <../utils/dogbones.scad>
panel_clearance = 0.2;
panel_clearance = 0.5;
housing_height = 14.12; // measured height of a Dupont connector.
housing_colour = grey(25);

View File

@@ -68,7 +68,7 @@ function screw_shorter_than(x) = x >= 20 ? floor(x / 5) * 5 : //! Returns the le
function screw_length(screw, thickness, washers, insert = false, nyloc = false, nut = false, longer = false) = //! Returns the length of the longest or shortest screw that will got through `thickness` and `washers` and possibly an `insert`, `nut` or `nyloc`
let(washer = washers ? washers * washer_thickness(screw_washer(screw)) : 0,
insert = insert ? insert_length(screw_insert(screw)) : 0,
insert = insert ? insert_length(is_list(insert) ? insert : screw_insert(screw)) : 0,
nut = nut || nyloc ? nut_thickness(screw_nut(screw), nyloc) : 0,
total = thickness + washer + insert + nut
)
@@ -76,10 +76,11 @@ function screw_length(screw, thickness, washers, insert = false, nyloc = false,
function screw_smaller_than(d) = d >= 2.5 && d < 3 ? 2.5 : floor(d); // Largest diameter screw less than or equal to specified diameter
function screw_insert(screw, i = 0) = let(d = screw_radius(screw) * 2)
i >= len(inserts) ? undef
: insert_screw_diameter(inserts[i]) == d ? inserts[i]
: screw_insert(screw, i + 1);
function screw_insert(screw, short = false, i = 0) = //! Find insert to fit specified screw, defaults to longest but can specify the shortest
let(d = screw_radius(screw) * 2, list = short ? short_inserts : inserts)
i >= len(list) ? undef
: insert_screw_diameter(list[i]) == d ? list[i]
: screw_insert(screw, short, i + 1);
module screw(type, length, hob_point = 0, nylon = false) { //! Draw specified screw, optionally hobbed or nylon
description = str("Screw ", nylon ? "Nylon " : "", type[1], length < 10 ? " x " : " x ", length, "mm", hob_point ? str(", hobbed at ", hob_point) : "");
@@ -327,6 +328,19 @@ module screw_polysink(type, h = 100, alt = false, sink = 0) { //! A countersink
}
}
module screw_keyhole(type, h = 0) { //! Make keyhole slot to accept and retain screw head
r = screw_head_radius(type);
extrude_if(h) {
translate([0, - 2 * r])
drill(r + 0.5, 0);
hull()
for(y = [0, -2 * r])
translate([0, y])
drill(screw_clearance_radius(type), 0);
}
}
module screw_and_washer(type, length, star = false, penny = false) { //! Screw with a washer which can be standard or penny and an optional star washer on top
washer = screw_washer(type);
head_type = screw_head_type(type);

View File

@@ -26,6 +26,7 @@ function sc_length(type) = type[1]; //! Coupling length
function sc_diameter(type) = type[2]; //! Coupling outer diameter
function sc_diameter1(type) = type[3]; //! Diameter of smaller shaft
function sc_diameter2(type) = type[4]; //! Diameter of larger shaft
function sc_flexible(type) = type[5]; //! Flexible coupling
module shaft_coupling(type, colour = "silver") { //! Draw the shaft coupling
vitamin(str("shaft_coupling(", type[0], "): Shaft coupling ", type[0]));
@@ -34,6 +35,7 @@ module shaft_coupling(type, colour = "silver") { //! Draw the shaft coupling
radius = sc_diameter(type) / 2;
r1 = sc_diameter1(type) / 2;
r2 = sc_diameter2(type) / 2;
flexible = is_undef(sc_flexible(type)) ? false : sc_flexible(type);
grub_length = 3;
module grub_screw_positions() {
@@ -54,6 +56,11 @@ module shaft_coupling(type, colour = "silver") { //! Draw the shaft coupling
tube(radius, r2, length / 2, false);
}
if (flexible) {
linear_extrude(length/3, center=true, convexity = 20, twist = -5 * 360)
translate([r1,0,0])
square(radius-r1,1);
}
grub_screw_positions()
rotate([180, 0, 0])
cylinder(r = screw_radius(M3_grub_screw), h = 5);

View File

@@ -21,9 +21,9 @@
//! Shaft couplings
//
// L D d1 d2
SC_5x8_rigid = [ "SC_5x8_rigid", 25, 12.5, 5, 8 ];
shaft_couplings = [SC_5x8_rigid];
// L D d1 d2 flex?
SC_5x8_rigid = [ "SC_5x8_rigid", 25, 12.5, 5, 8, false ];
SC_6x8_flex = [ "SC_6x8_flex", 25, 19, 6, 8, true ];
shaft_couplings = [SC_5x8_rigid, SC_6x8_flex];
use <shaft_coupling.scad>

View File

@@ -49,7 +49,7 @@ AL3 = [ "AL3", "Aluminium tooling plate", 3, [0.9, 0.9, 0.9, 1 ],
AL6 = [ "AL6", "Aluminium tooling plate", 6, [0.9, 0.9, 0.9, 1 ], false];
AL8 = [ "AL8", "Aluminium tooling plate", 8, [0.9, 0.9, 0.9, 1 ], false];
Steel06 = [ "Steel06", "Sheet mild steel", 0.6,"silver" , false];
Spring05 = [ "Spring05", "Bi-metal saw blade", 0.5,"#FBC300", false];
Spring08 = [ "Spring08", "Bi-metal saw blade", 0.8,"#FBC300", false];
Silicone3 = [ "Silicone3", "Sheet silicone", 3, [0.9, 0.9, 0.9, 0.95 ], false];
CF1 = [ "CF1", "Sheet carbon fiber", 1, grey(35), false, 2, 2, grey(20)];
CF2 = [ "CF2", "Sheet carbon fiber", 2, grey(35), false, 2, 2, grey(20)];
@@ -57,6 +57,6 @@ CF3 = [ "CF3", "Sheet carbon fiber", 3, grey(35),
sheets = [CF1, CF2, CF3, MDF6, MDF10, MDF12, MDF19, PMMA1p25, PMMA2, PMMA3, PMMA6, PMMA8, PMMA10,
glass2, DiBond, DiBond6, Cardboard, FoilTape, AL1_6, AL2, AL3, AL6, AL8, Steel06, Spring05, Silicone3, Foam20];
glass2, DiBond, DiBond6, Cardboard, FoilTape, AL1_6, AL2, AL3, AL6, AL8, Steel06, Spring08, Silicone3, Foam20];
use <sheet.scad>

View File

@@ -24,6 +24,7 @@ include <../utils/core/core.scad>
use <../utils/tube.scad>
use <../utils/sweep.scad>
use <../utils/sector.scad>
function smd_led_size(type) = type[1]; //! Body length, width and height
function smd_led_lens(type) = type[2]; //! Lens length width and height
@@ -178,3 +179,255 @@ module smd_sot(type, value) { //! Draw an SMD transistor
text(value, halign = "center", valign = "center");
}
function smd_soic_size(type) = type[1]; //! Body length, width and height
function smd_soic_z(type) = type[2]; //! Height above PCB surface
function smd_soic_lead_z(type) = type[3]; //! Top of lead frame from top
function smd_soic_lead_pitch(type) = type[4]; //! Lead pitch
function smd_soic_lead_span(type) = type[5]; //! Total span of leads
function smd_soic_lead_size(type) = type[6]; //! Lead width, foot depth, lead thickness
module smd_soic(type, value) { //! Draw an SMD SOIC
vitamin(str("smd_soic(", type[0], "): ", type[0], " package ", value));
size = smd_soic_size(type);
z0 = smd_soic_z(type);
z2 = z0 + size.z;
z1 = z2 - smd_soic_lead_z(type);
slant = 5; //! 5 degree body draft angle
pitch = smd_soic_lead_pitch(type);
span = (smd_soic_lead_span(type) / 2);
leads = floor(size.x / pitch) + 1;
ls = smd_soic_lead_size(type);
r = ls.z;
gullwing = rounded_path([[0, 0, ls.z / 2], [0, ls.y - ls.z, ls.z / 2], r, [0, ls.y -ls.z + z1 - ls.z, z1 - ls.z / 2], r, [0, span / 2, z1 - ls.z / 2]], $fn = 32);
color(grey(20))
hull()
for(z = [z0, z1, z2], inset = abs(z - z1) * tan(slant))
translate_z(z)
cube([size.x - 2 * inset, size.y - 2 * inset, eps], center = true);
color(silver) {
for(i = [0 : leads - 1]) {
translate([i * pitch - size.x / 2 + (size.x - (leads - 1) * pitch) / 2, -span])
sweep(gullwing, rectangle_points(ls.x, ls.z));
rotate(180)
translate([0, -span / 2])
translate([i * pitch - size.x / 2 + (size.x - (leads - 1) * pitch) / 2, -span / 2])
sweep(gullwing, rectangle_points(ls.x, ls.z));
}
}
color("white")
translate_z(z0 + size.z)
linear_extrude(eps)
resize([size.x * 0.9, size.y / 2])
text(value, halign = "center", valign = "center");
}
function smd_diode_size(type) = type[1]; //! Body length, width and height
function smd_diode_z(type) = type[2]; //! Height above PCB surface
function smd_diode_lead_z(type) = type[3]; //! Top of lead frame from top
function smd_diode_leads(type) = type[4]; //! Lead extent in x, width, thickness and gap
module smd_diode(type, value) { //! Draw an SMD diode
vitamin(str("smd_diode(", type[0], "): ", type[0], " package ", value));
slant = 5; //! 5 degree body draft angle
size = smd_diode_size(type);
z0 = smd_diode_z(type);
z2 = z0 + size.z;
z1 = z2 - smd_diode_lead_z(type);
stripe = size.x / 5;
leads = smd_diode_leads(type);
gap = leads[3];
gap2 = gap - leads.z * 2;
color(grey(20))
difference() {
hull()
for(z = [z0, z1, z2], inset = abs(z - z1) * tan(slant))
translate_z(z)
cube([size.x - 2 * inset, size.y - 2 * inset, eps], center = true);
for(side = [-1, 1])
translate([side * (size.x / 2 - (size.x - gap2) / 4), 0, eps])
cube([(size.x - gap2) / 2, size.y, 3 * leads.z], center = true);
}
color("white")
translate([-stripe / 2, 0, z2])
linear_extrude(eps)
resize([0.9 * (size.x - stripe), size.y / 2])
text(value, halign = "center", valign = "center");
color(grey(90)) {
inset = (z2 - z1) * tan(slant);
translate([size.x / 2 - stripe, -size.y / 2 + inset, z2])
cube([stripe - inset, size.y - 2 * inset, eps]);
}
color(silver)
translate_z(z1 / 2)
rotate([90, 0, 0])
linear_extrude(leads.y, center = true, convexity = 3) let($fn = 32)
difference() {
rounded_square([leads.x, z1], 2 * leads.z);
rounded_square([leads.x - 2 * leads.z, z1 - 2 * leads.z], leads.z);
translate([0, - z1 / 2])
square([gap, leads.z * 2 + eps], center = true);
}
}
function smd_inductor_size(type) = type[1]; //! Body length, width and height
function smd_inductor_z(type) = type[2]; //! Height above PCB surface
function smd_inductor_lead_z(type) = type[3]; //! Top of lead frame from top
function smd_inductor_leads(type) = type[4]; //! Lead extent in x, width, thickness and gap
function smd_inductor_colour(type) = type[5]; //! Body colour
module smd_inductor(type, value) { //! Draw an SMD inductor
vitamin(str("smd_inductor(", type[0], "): ", type[0], " package ", value));
size = smd_inductor_size(type);
z0 = smd_inductor_z(type);
z1 = smd_inductor_lead_z(type);
z2 = z0 + size.z;
leads = smd_inductor_leads(type);
gap = leads[3];
gap2 = gap - leads.z * 2;
color(smd_inductor_colour(type))
difference() {
translate_z(z0)
rounded_rectangle(size, 0.5);
for(side = [-1, 1])
translate([side * (size.x / 2 - (size.x - gap2) / 4), 0, eps])
cube([(size.x - gap2) / 2, leads.y + 2 * leads.z, 3 * leads.z], center = true);
}
color("white")
translate_z(z2)
linear_extrude(eps)
resize([0.9 * size.x, size.y / 2])
text(value, halign = "center", valign = "center");
color(silver)
translate_z(z1 / 2)
rotate([90, 0, 0])
linear_extrude(leads.y, center = true, convexity = 3) let($fn = 32)
difference() {
rounded_square([leads.x, z1], 2 * leads.z);
rounded_square([leads.x - 2 * leads.z, z1 - 2 * leads.z], leads.z);
translate([0, - z1 / 2])
square([gap, leads.z * 2 + eps], center = true);
}
}
function smd_pot_size(type) = type[1]; //! Base length, width and height
function smd_pot_contacts(type) = type[2]; //! Contacts width, depth, pitch and width, depth, gap for center contact
function smd_pot_wiper(type) = type[3]; //! Wiper diameter, offset, thickness, height, d1, d2, d3, d4
function smd_pot_cross(type) = type[4]; //! Cross head slot for screwdriver
function smd_pot_flat(type) = type[5]; //! Flat at the back of the wiper
module smd_pot(type, value) { //! Draw an SMD pot
vitamin(str("smd_pot(", type[0], "): ", type[0], " package ", value));
size = smd_pot_size(type);
contacts = smd_pot_contacts(type);
contacts_pitch = contacts[2];
centre_contact_w = contacts[3];
centre_contact_d = contacts[4];
centre_contact_gap = contacts[5];
wiper = smd_pot_wiper(type);
wiper_r1 = wiper.x / 2; // outer radius
wiper_y = wiper.y;
wiper_t = wiper.z;
wiper_h = wiper[3];
wiper_r2 = wiper[4] / 2; // inner radius at the top
wiper_r3 = wiper[5] / 2; // inner radius at the bottom
wiper_r4 = wiper[6] / 2; // outer radius of rivet
wiper_r5 = wiper[7] / 2; // inner radius of rivet
cross = smd_pot_cross(type);
flat = smd_pot_flat(type);
track_or = size.x * 0.48;
track_ir = track_or * 0.6;
color(grey(90))
translate_z(size.z / 2)
cube(size, center = true);
color(silver) {
for(side = [-1, 1])
translate([side * contacts_pitch, -size.y / 2 + contacts.y / 2, size.z / 2])
cube([contacts.x, contacts.y, size.z] + 2 * eps * [1,1,1], center = true);
translate([0, size.y / 2 - centre_contact_d / 2, size.z / 2])
render() difference() {
cube([centre_contact_w, centre_contact_d + 2 * eps, size.z + 2 * eps], center = true);
translate_z(size.z / 2)
cube([centre_contact_gap, centre_contact_d + 4 * eps, 2 * eps], center = true);
}
slope_angle = atan((wiper_h - size.z - wiper_t) / (wiper_r2 - wiper_r3));
dx = wiper_t / tan(90 - slope_angle / 2);
translate([0, wiper_y]) {
render() difference() {
rotate_extrude() {
polygon([
[wiper_r5, size.z + wiper_t],
[wiper_r3, size.z + wiper_t],
[wiper_r2, wiper_h],
[wiper_r1, wiper_h],
[wiper_r1, wiper_h - wiper_t],
[wiper_r2 + dx, wiper_h - wiper_t],
[wiper_r3 + dx, size.z],
[wiper_r5, size.z],
]);
r = (wiper_r4 - wiper_r5) / 2;
translate([wiper_r5 + r, size.z + wiper_t])
circle(r, $fn = 16);
}
translate_z(size.z + wiper_t)
linear_extrude(wiper_h - size.z - wiper_t)
difference() {
union() {
square(cross, center = true);
rotate(90)
square(cross, center = true);
}
circle(wiper_r4 + eps);
}
}
translate([0, -(wiper_r1 + cross.x / 2) / 2, wiper_h - wiper_t / 2])
cube([flat, wiper_r1 - cross.x / 2, wiper_t], center = true);
}
}
color("black")
translate([0, wiper.y, size.z])
linear_extrude(eps) {
difference() {
sector(track_or, -270 / 2 + 90, 270 / 2 + 90);
circle(track_ir);
}
track_w = track_or - track_ir;
track_l = wiper.y - track_ir / sqrt(2) + size.y / 2 - contacts.y;
for(side = [-1, 1])
translate([side * (track_ir / sqrt(2) + track_w / 2), -wiper.y -size.y / 2 + track_l / 2 + contacts.y])
square([track_w, track_l], center = true);
}
}

View File

@@ -23,8 +23,9 @@
LED0603 = ["LED0603", [1.6, 0.8, 0.18], [1.0, 0.8, 0.42]];
LED0805 = ["LED0805", [2.0, 1.25, 0.46], [1.4, 1.25, 0.54]];
LED1206 = ["LED1206", [3.2, 1.6, 0.5], [2.0, 1.6, .6]];
smd_leds = [LED0603, LED0805];
smd_leds = [LED0603, LED0805, LED1206];
RES0603 = ["RES0603", [1.6, 0.8, 0.45], 0.3, 1/10];
RES0805 = ["RES0805", [2.0, 1.2, 0.45], 0.4, 1/8];
@@ -43,4 +44,22 @@ SOT223 = ["SOT223", [6.5, 3.5, 1.6], 0.05, 0.89, 2.3, 7.0, [0.7, 0.95, 0.25], 3]
smd_sots = [SOT23, SOT223];
SOIC8 = ["SOIC8", [4.90, 3.90, 1.25], 0.10, 0.66, 1.27, 6.00, [0.31, .50, 0.20]];
SOIC16 = ["SOIC16", [9.90, 3.90, 1.25], 0.10, 0.66, 1.27, 6.00, [0.31, .50, 0.20]];
SOIC18 = ["SOIC18", [11.40, 7.50, 2.00], 0.10, 1.20, 1.27, 10.30, [0.31, .50, 0.20]];
smd_soics = [SOIC8, SOIC16, SOIC18];
DO241AC = ["DO241AC", [4.0, 2.5, 2.0], 0.1, 1, [4.8, 1.2, 0.15, 2]];
smd_diodes = [DO241AC];
IND2525 = ["IND2525", [6.75, 6.75, 2], 0.1, 1.75, [7.24, 3.2, 0.15, 4.4], grey(50)];
smd_inductors = [IND2525];
TC33X1 = ["TC33X1", [3.0, 3.8, 0.5], [0.95, 0.9, 0.88, 1.5, 0.2, 0.75],[3.0, 0.1, 0.2, 1.2, 1.7, 1.2, 1, 0.5], [2.1, 0.5], 1.5];
smd_pots = [TC33X1];
use <smd.scad>

View File

@@ -51,6 +51,18 @@ stepper_body_colour = grey(20);
stepper_cap_colour = grey(50);
stepper_machined_colour = grey(90);
function NEMA_connection_pos(type, jst_connector = false) = let( //! Position of the wires or the connector
side = NEMA_width(type),
length = NEMA_length(type),
cap = NEMA_cap_heights(type)[1],
hdr = NEMA_end_connector(type) ? jst_zh_header : jst_ph_header,
socket_size = hdr_box_size(hdr),
end_conn_inset = socket_size.y - 2
)
jst_connector ? NEMA_end_connector(type) ? [0, side / 2 + hdr_y_offset(hdr) + socket_size.y / 2 - end_conn_inset, -length]
: [0, side / 2 + socket_size.z, hdr_y_offset(hdr) - socket_size.y / 2 - length + cap]
: [0, side / 2, -length + cap / 2];
module NEMA_outline(type) //! 2D outline
intersection() {
side = NEMA_width(type);
@@ -185,14 +197,14 @@ module NEMA(type, shaft_angle = 0, jst_connector = false) { //! Draw specified N
not_on_bom()
leadscrew(shaft_rad * 2, shaft.x + length + shaft2, shaft.y, shaft.z, center = false);
if(!jst_connector)
if(jst_connector == false)
translate([0, side / 2, -length + cap / 2])
rotate([90, 0, 0])
for(i = [0 : 3])
rotate(225 + i * 90)
color(["red", "blue","green","black"][i])
translate([1, 0, 0])
cylinder(r = 1.5 / 2, h = 12, center = true);
color(["red", "green", "black", "blue"][i])
translate([1.48 / sqrt(2), 0, 0])
cylinder(d = 1.48, h = 12, center = true);
}
module NEMA_screw_positions(type, n = 4) { //! Positions children at the screw holes

Binary file not shown.

View File

@@ -41,7 +41,7 @@ function vero_track_width(type) = vero_pitch(type) * 0.8; //! The width of th
function vero_length(type) = vero_holes(type) * vero_pitch(type); //! Length of the board
function vero_width(type) = vero_strips(type) * vero_pitch(type); //! Width of the board
function vero(name, assembly, holes, strips, pitch = inch(0.1), fr4 = false, screw = M3_cap_screw, mounting_holes = [], breaks = [], no_tracks = [], components = [], joints = []) = //! Constructor
function vero(name, assembly, holes, strips, pitch = 2.54, fr4 = false, screw = M3_cap_screw, mounting_holes = [], breaks = [], no_tracks = [], components = [], joints = []) = //! Constructor
[ name, assembly, holes, strips, pitch, fr4, screw, mounting_holes, breaks, no_tracks, components, joints ];
function vero_size(type) = [vero_length(type), vero_width(type), vero_thickness(type)]; //! Board size
@@ -89,7 +89,7 @@ module veroboard(type) { //! Draw specified veroboard with missing tracks and tr
tc = vero_fr4(type) ? "silver" : copper;
no_track = vero_no_track(type);
vitamin(str("veroboard(", type[0], "): Veroboard ", holes, " holes x ", strips, "strips"));
vitamin(str("veroboard(", type[0], "): Veroboard ", holes, " holes x ", strips, " strips"));
color(colour) linear_extrude(vero_thickness(type))
difference() {