1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-09-05 21:02:51 +02:00

Compare commits

...

73 Commits

Author SHA1 Message Date
Chris
5899ffe88f More typos in comments. 2023-06-29 10:43:15 +01:00
Chris
b05131145c Comment typo. 2023-06-28 23:04:15 +01:00
Chris Palmer
5da0f97485 Updated changelog. 2023-05-08 20:19:50 +01:00
Chris Palmer
c3f3d629b1 Added PanelDue V3. 2023-05-08 20:14:18 +01:00
Chris Palmer
c7ba052ccf Added SMD QFP package. 2023-05-08 20:13:53 +01:00
Chris Palmer
c2c5f50986 Can now used smd_res() to draw chokes. 2023-05-08 20:07:18 +01:00
Chris Palmer
d0ae8ca216 Added the ability to have more than one grid on a PCB. 2023-05-08 19:56:53 +01:00
Chris Palmer
e81dcfdbd8 Added right angle option to box headers. 2023-05-08 19:52:51 +01:00
Chris Palmer
06a286dc98 Fixed missing BOM entry for JST connectors.
Fixed default colour for JST connectors.
Corrected BOM entry to show right angle options on Molex and pin headers.
2023-05-08 19:51:29 +01:00
Chris Palmer
f5496c373a Fixed typo in smd_diode(DO214AC) package name. 2023-05-08 19:42:05 +01:00
Chris Palmer
1c6d3d8e95 Updated changelog. 2023-05-01 12:22:10 +01:00
Chris Palmer
5e24a32a0b Added ESP32 camera. 2023-05-01 12:18:12 +01:00
Chris Palmer
fbd8d8c7cd Added smd_coax 2023-05-01 12:14:23 +01:00
Chris Palmer
c77b18ebc9 Updated changelog. 2023-04-29 09:23:57 +01:00
Chris Palmer
b1592f51d4 Fixed bom.py, views.py and tests.py so that vitamin descriptions can contain more than one colon. 2023-04-29 09:22:35 +01:00
Chris Palmer
deb0c14aa2 Updated changelog. 2023-04-23 20:33:27 +01:00
Chris Palmer
cc82cf2a6c Merge branch 'martinbudden-shoulder_screws' 2023-04-23 20:31:18 +01:00
Chris Palmer
61fc194995 Refactored for readability. 2023-04-23 20:30:12 +01:00
Chris Palmer
f8af61568a Updated images and readme. 2023-04-23 17:15:29 +01:00
Chris Palmer
05d16841c4 Fixed thread pitch. 2023-04-23 17:15:02 +01:00
Chris Palmer
61f1dcc509 Merge branch 'shoulder_screws' of https://github.com/martinbudden/NopSCADlib into martinbudden-shoulder_screws 2023-04-22 19:11:39 +01:00
Chris Palmer
5fc70e19ac Added SMD Tantalum caps and 0502 and 0402 resistor and capacitors. 2023-04-22 12:12:12 +01:00
Martin Budden
07e7eb77f7 Added support for shoulder screws. 2023-04-05 12:32:13 +01:00
Chris Palmer
1c5d9a8ef5 Removed utility functions used by invert() from documentation as not generally useful. 2023-03-29 13:21:26 +01:00
Chris Palmer
d3f0bfc17f Fixed typo in resistor comment. 2023-03-29 12:54:07 +01:00
Chris
81f3b084ab Updated changelog. 2023-03-11 18:38:38 +00:00
Chris
62bd2b5597 Merge branch 'dirkjankrijnders-master' 2023-03-11 18:35:11 +00:00
Chris
18cd33c663 Fixed typos, corrected vitamin call, added boilerplate, updated images and readme. 2023-03-11 17:50:16 +00:00
Chris
e899306a13 Merge branch 'master' of https://github.com/dirkjankrijnders/NopSCADlib into dirkjankrijnders-master 2023-03-11 14:10:22 +00:00
Dirkjan Krijnders
ebfb330ac6 Added comments and make holes a linear_extrude result 2023-03-11 15:00:10 +01:00
Chris
07da7d8dc7 Removed Python2.7 from usage.md as no longer works. 2023-03-11 13:57:23 +00:00
Chris
38b52d13ee Merge branch 'master' of https://github.com/dirkjankrijnders/NopSCADlib into dirkjankrijnders-master 2023-03-10 22:03:16 +00:00
Chris
5a3bbf967d Fixed broken cover image. 2023-03-10 22:02:00 +00:00
Chris
ddb2f16b99 Updated changlog. 2023-03-10 21:49:21 +00:00
Chris
9d4d5aba17 veroboard_assembly() renamed veroboard_fastened_assembly().
veroboard_assembly() now doesn't include the fasteners.
2023-03-10 21:24:42 +00:00
Chris
d939401183 Added vero_grid_pos() function. 2023-03-10 21:11:03 +00:00
Chris
584542f87a Added fastons. 2023-03-10 21:09:28 +00:00
Chris
62372a049b The wire() module can now draw wires if a path is specified. 2023-03-10 20:49:41 +00:00
Chris
14698e5203 Added PTFE heatshrink sleeving. 2023-03-10 17:25:26 +00:00
Chris
14f6bb533a Added sleeving_length to al_clad_resistor_assembly(). 2023-03-10 16:04:17 +00:00
Chris
01e9aae698 Added TO220_size() and TO220_lead_pos(i, l). 2023-03-10 15:46:57 +00:00
Dirkjan Krijnders
c5fab08a45 Added photo_interrupter to the test 2023-03-08 16:51:08 +01:00
Dirkjan Krijnders
fecc93746a Added vitamins for photo interrupters 2023-03-08 09:20:14 +01:00
Chris Palmer
27f9b242f2 Added crystal, transistors, diode and LEDs to Arduino Uno. 2023-02-04 00:09:16 +00:00
Chris Palmer
f07fda70cd Wire links can now be sleeved. 2023-02-03 10:02:53 +00:00
Chris Palmer
abf1f1ab3f PCB blocks can now have rounded edges for more realistic cans. 2023-02-01 18:31:33 +00:00
Chris Palmer
df06d1f57f Upated changelog. 2023-02-01 01:33:04 +00:00
Chris Palmer
470d6d6216 Started radial components with crystals. 2023-02-01 01:31:06 +00:00
Chris Palmer
0e5e15a747 Added SOIC14 package. 2023-02-01 01:29:34 +00:00
Chris Palmer
3f84912e55 Added rounded_top_rectangle(). 2023-02-01 01:27:01 +00:00
Chris Palmer
ff7041c285 Updated changelog. 2023-01-29 06:56:40 +00:00
Chris Palmer
dd8a100d9c Merge branch 'elliotf-add-orange-pi-zero-2' 2023-01-29 06:54:28 +00:00
Chris Palmer
01eeafb255 Updated images and readme. 2023-01-29 06:54:02 +00:00
Chris Palmer
dd876c8fc9 Added vertical USB connector to PCB test. 2023-01-29 06:53:07 +00:00
Chris Palmer
ff40a276e1 Fixed display position in tests. 2023-01-29 06:52:30 +00:00
Chris Palmer
463c620cc3 Made a new row of PCBs in the test. 2023-01-29 06:41:47 +00:00
Chris Palmer
7b1a916043 Fixed vAx1 dimensions, removed flange and repositioned the tongue. 2023-01-29 06:20:35 +00:00
Chris Palmer
1a2a9bb512 Merge branch 'add-orange-pi-zero-2' of https://github.com/elliotf/NopSCADlib into elliotf-add-orange-pi-zero-2 2023-01-28 20:35:54 +00:00
Chris Palmer
adcb515d20 Updated changelog. 2023-01-28 20:27:50 +00:00
Chris Palmer
34719c3360 Box shelves now have screws in the corners to hold them down. 2023-01-28 20:25:38 +00:00
Chris Palmer
024439d4c2 Can now specify short inserts to be used for butt_boxes. 2023-01-28 20:22:53 +00:00
Chris Palmer
005c112ba9 Added values to the SMD capacitors on the example PCB. 2023-01-28 20:21:09 +00:00
Chris Palmer
dfbcbf84ab Changed OpenGrab link as nicadrone.com has gone. 2023-01-28 20:15:15 +00:00
Elliot Foster
de051343d0 WiP of an Orange Pi Zero 2 PCB 2023-01-28 13:37:47 -06:00
Chris Palmer
b6e47ed9b7 Updated changelog. 2023-01-24 09:59:02 +00:00
Chris Palmer
6a529c91a7 Merge branch 'elliotf-add-raspberry-pi-3a' 2023-01-24 09:56:52 +00:00
Chris Palmer
e7e9313e71 Updated images and readme. 2023-01-24 09:56:19 +00:00
Chris Palmer
e19bb47273 Merge branch 'add-raspberry-pi-3a' of https://github.com/elliotf/NopSCADlib into elliotf-add-raspberry-pi-3a 2023-01-24 09:24:15 +00:00
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
Elliot Foster
dab06ce4ca Add Raspberry Pi 3 A+ to pcbs 2023-01-23 12:50:00 -06:00
Chris Palmer
2e25932d5c Updated changelog. 2023-01-12 23:02:31 +00:00
73 changed files with 1987 additions and 349 deletions

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. This changelog is generated by `changelog.py` using manually added semantic version tags to classify commits as breaking changes, additions or fixes.
### [v21.5.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.5.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.4.1...v21.5.0 "diff with v21.4.1")
* 2023-05-08 [`c3f3d62`](https://github.com/nophead/NopSCADlib/commit/c3f3d629b1ff79d40cc5ad3efcb33e940d6c8056 "show commit") [C.P.](# "Chris Palmer") Added PanelDue V3.
* 2023-05-08 [`c7ba052`](https://github.com/nophead/NopSCADlib/commit/c7ba052ccf24d764aa6460d4559e92596c9e4cf4 "show commit") [C.P.](# "Chris Palmer") Added SMD QFP package.
* 2023-05-08 [`c2c5f50`](https://github.com/nophead/NopSCADlib/commit/c2c5f509860b909ca8fca5ffcc65dbef2f7177c5 "show commit") [C.P.](# "Chris Palmer") Can now used `smd_res()` to draw chokes.
* 2023-05-08 [`d0ae8ca`](https://github.com/nophead/NopSCADlib/commit/d0ae8ca216108f53c9b8e60896ea9b59b845b7e0 "show commit") [C.P.](# "Chris Palmer") Added the ability to have more than one grid on a PCB.
* 2023-05-08 [`e81dcfd`](https://github.com/nophead/NopSCADlib/commit/e81dcfdbd8163ce8e2db450f3a20c296c21327a8 "show commit") [C.P.](# "Chris Palmer") Added right angle option to box headers.
#### [v21.4.1](https://github.com/nophead/NopSCADlib/releases/tag/v21.4.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v21.4.0...v21.4.1 "diff with v21.4.0")
* 2023-05-08 [`06a286d`](https://github.com/nophead/NopSCADlib/commit/06a286dc989e9cc8cf7918049cd16a862b1a9b94 "show commit") [C.P.](# "Chris Palmer") Fixed missing BOM entry for JST connectors.
Fixed default colour for JST connectors.
Corrected BOM entry to show right angle options on Molex and pin headers.
* 2023-05-08 [`f5496c3`](https://github.com/nophead/NopSCADlib/commit/f5496c373a1ab8ae47d07cc0a52d76e4299876cc "show commit") [C.P.](# "Chris Palmer") Fixed typo in `smd_diode(DO214AC)` package name.
### [v21.4.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.4.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.3.1...v21.4.0 "diff with v21.3.1")
* 2023-05-01 [`5e24a32`](https://github.com/nophead/NopSCADlib/commit/5e24a32a0b422e8032c3c5d377c1a756ff6f1022 "show commit") [C.P.](# "Chris Palmer") Added ESP32 camera.
* 2023-05-01 [`fbd8d8c`](https://github.com/nophead/NopSCADlib/commit/fbd8d8c7cdff0bd7de0d42aa74bf0ab6551c205b "show commit") [C.P.](# "Chris Palmer") Added `smd_coax`
#### [v21.3.1](https://github.com/nophead/NopSCADlib/releases/tag/v21.3.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v21.3.0...v21.3.1 "diff with v21.3.0")
* 2023-04-29 [`b1592f5`](https://github.com/nophead/NopSCADlib/commit/b1592f51d4b16a125d9b28edae56f758fcac2f02 "show commit") [C.P.](# "Chris Palmer") Fixed `bom.py,` `views.py` and `tests.py` so that vitamin descriptions can contain more than one colon.
### [v21.3.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.3.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.2.0...v21.3.0 "diff with v21.2.0")
* 2023-04-23 [`61fc194`](https://github.com/nophead/NopSCADlib/commit/61fc19499524a2b750d17a90627a697bf626bbf0 "show commit") [C.P.](# "Chris Palmer") Refactored for readability.
* 2023-04-23 [`f8af615`](https://github.com/nophead/NopSCADlib/commit/f8af61568a8362cf470bc9eb8de8323c8fc001c7 "show commit") [C.P.](# "Chris Palmer") Updated images and readme.
* 2023-04-23 [`05d1684`](https://github.com/nophead/NopSCADlib/commit/05d16841c4d48c5c8f453e438af0ff6eb5bffe53 "show commit") [C.P.](# "Chris Palmer") Fixed thread pitch.
* 2023-04-05 [`07e7eb7`](https://github.com/nophead/NopSCADlib/commit/07e7eb77f73fcaab4291388b49781b0e2de5a64c "show commit") [M.B.](# "Martin Budden") Added support for shoulder screws.
### [v21.2.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.2.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.1.2...v21.2.0 "diff with v21.1.2")
* 2023-04-22 [`5fc70e1`](https://github.com/nophead/NopSCADlib/commit/5fc70e19ac5d320290f4a2151665e83f0829d796 "show commit") [C.P.](# "Chris Palmer") Added SMD Tantalum caps and 0502 and 0402 resistor and capacitors.
#### [v21.1.2](https://github.com/nophead/NopSCADlib/releases/tag/v21.1.2 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v21.1.1...v21.1.2 "diff with v21.1.1")
* 2023-03-29 [`1c5d9a8`](https://github.com/nophead/NopSCADlib/commit/1c5d9a8ef5892caf9b2c4d0d84dc3d20eba699d3 "show commit") [C.P.](# "Chris Palmer") Removed utility functions used by `invert()` from documentation as not generally useful.
#### [v21.1.1](https://github.com/nophead/NopSCADlib/releases/tag/v21.1.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v21.1.0...v21.1.1 "diff with v21.1.0")
* 2023-03-29 [`d3f0bfc`](https://github.com/nophead/NopSCADlib/commit/d3f0bfc17f82b42f2d81f2d72a54c3f0cc375604 "show commit") [C.P.](# "Chris Palmer") Fixed typo in resistor comment.
### [v21.1.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.1.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.0.1...v21.1.0 "diff with v21.0.1")
* 2023-03-11 [`18cd33c`](https://github.com/nophead/NopSCADlib/commit/18cd33c66388d4d4e7be664c0f883cff0854524b "show commit") [C.](# "Chris") Fixed typos, corrected vitamin call, added boilerplate, updated images and readme.
* 2023-03-11 [`ebfb330`](https://github.com/nophead/NopSCADlib/commit/ebfb330ac69f4e90de84ecffea94ce067d041031 "show commit") [D.K.](# "Dirkjan Krijnders") Added comments and make holes a `linear_extrude` result
* 2023-03-08 [`c5fab08`](https://github.com/nophead/NopSCADlib/commit/c5fab08a454383b295be2b151fd715ee79b85db3 "show commit") [D.K.](# "Dirkjan Krijnders") Added `photo_interrupter` to the test
* 2023-03-08 [`fecc937`](https://github.com/nophead/NopSCADlib/commit/fecc93746ab80ad1fc74f0fe3465de92ffee7b36 "show commit") [D.K.](# "Dirkjan Krijnders") Added vitamins for photo interrupters
#### [v21.0.1](https://github.com/nophead/NopSCADlib/releases/tag/v21.0.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v21.0.0...v21.0.1 "diff with v21.0.0")
* 2023-03-11 [`07da7d8`](https://github.com/nophead/NopSCADlib/commit/07da7d8dc7d3fb769e57a6b9ca86465357007b6c "show commit") [C.](# "Chris") Removed `Python2.7` from `usage.md` as no longer works.
* 2023-03-10 [`5a3bbf9`](https://github.com/nophead/NopSCADlib/commit/5a3bbf967dc967eca4726af517382e7eb875dde1 "show commit") [C.](# "Chris") Fixed broken cover image.
## [v21.0.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.0.0 "show release") Breaking Changes [...](https://github.com/nophead/NopSCADlib/compare/v20.24.0...v21.0.0 "diff with v20.24.0")
* 2023-03-10 [`9d4d5ab`](https://github.com/nophead/NopSCADlib/commit/9d4d5aba17974e7b5911e723d48d7b9403a4bcb4 "show commit") [C.](# "Chris") `veroboard_assembly()` renamed `veroboard_fastened_assembly()`.
`veroboard_assembly()` now doesn't include the fasteners.
### [v20.24.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.24.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.23.0...v20.24.0 "diff with v20.23.0")
* 2023-03-10 [`d939401`](https://github.com/nophead/NopSCADlib/commit/d939401183d12af3452e17aa5b020dab50f8edb0 "show commit") [C.](# "Chris") Added `vero_grid_pos()` function.
* 2023-03-10 [`584542f`](https://github.com/nophead/NopSCADlib/commit/584542f87a27efe06ff3ba597dbaff1f3c32c4fd "show commit") [C.](# "Chris") Added fastons.
* 2023-03-10 [`62372a0`](https://github.com/nophead/NopSCADlib/commit/62372a049b9ac7a0fecebfd3618df91ff6ffa87a "show commit") [C.](# "Chris") The `wire()` module can now draw wires if a path is specified.
* 2023-03-10 [`14698e5`](https://github.com/nophead/NopSCADlib/commit/14698e5203e1e860230ddb3729816730e221f49c "show commit") [C.](# "Chris") Added PTFE heatshrink sleeving.
* 2023-03-10 [`14f6bb5`](https://github.com/nophead/NopSCADlib/commit/14f6bb533a3dcc1d36b2b764906cdca7d8d24484 "show commit") [C.](# "Chris") Added `sleeving_length` to `al_clad_resistor_assembly()`.
* 2023-03-10 [`01e9aae`](https://github.com/nophead/NopSCADlib/commit/01e9aae698f57bac6046d1a04aaa11b0c88006b5 "show commit") [C.](# "Chris") Added `TO220_size()` and `TO220_lead_pos(i,` l).
* 2023-02-04 [`27f9b24`](https://github.com/nophead/NopSCADlib/commit/27f9b242f250c0083344a05527055bb2fbb56f91 "show commit") [C.P.](# "Chris Palmer") Added crystal, transistors, diode and LEDs to Arduino Uno.
* 2023-02-03 [`f07fda7`](https://github.com/nophead/NopSCADlib/commit/f07fda70cdfc743cd2462636fcc1eb13a092f9e4 "show commit") [C.P.](# "Chris Palmer") Wire links can now be sleeved.
* 2023-02-01 [`abf1f1a`](https://github.com/nophead/NopSCADlib/commit/abf1f1ab3f3eddc2f274df649e8481a4117901eb "show commit") [C.P.](# "Chris Palmer") PCB blocks can now have rounded edges for more realistic cans.
* 2023-02-01 [`df06d1f`](https://github.com/nophead/NopSCADlib/commit/df06d1f57fff64cd6da20684f8371da204f69a82 "show commit") [C.P.](# "Chris Palmer") Updated changelog.
### [v20.23.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.23.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.22.0...v20.23.0 "diff with v20.22.0")
* 2023-02-01 [`470d6d6`](https://github.com/nophead/NopSCADlib/commit/470d6d6216b1cef8ce6cafd4b14300edb62eac4a "show commit") [C.P.](# "Chris Palmer") Started radial components with crystals.
* 2023-02-01 [`0e5e15a`](https://github.com/nophead/NopSCADlib/commit/0e5e15a747fed6b4ef434c9796bef6cb9e658c0e "show commit") [C.P.](# "Chris Palmer") Added SOIC14 package.
* 2023-02-01 [`3f84912`](https://github.com/nophead/NopSCADlib/commit/3f84912e555cd4f7e97e7cac3091260fe969df4c "show commit") [C.P.](# "Chris Palmer") Added `rounded_top_rectangle()`.
### [v20.22.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.22.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.21.0...v20.22.0 "diff with v20.21.0")
* 2023-01-29 [`01eeafb`](https://github.com/nophead/NopSCADlib/commit/01eeafb2552a4fcc735e85e8d0e7c0855c18be8c "show commit") [C.P.](# "Chris Palmer") Updated images and readme.
* 2023-01-29 [`dd876c8`](https://github.com/nophead/NopSCADlib/commit/dd876c8fc9f2658332c1c3200a6a67e1b78a8f64 "show commit") [C.P.](# "Chris Palmer") Added vertical USB connector to PCB test.
* 2023-01-29 [`ff40a27`](https://github.com/nophead/NopSCADlib/commit/ff40a276e1a37836ab011689e849da76ce19d4a7 "show commit") [C.P.](# "Chris Palmer") Fixed display position in tests.
* 2023-01-29 [`463c620`](https://github.com/nophead/NopSCADlib/commit/463c620cc3053428ecf7ca6360477992b9538978 "show commit") [C.P.](# "Chris Palmer") Made a new row of PCBs in the test.
* 2023-01-29 [`7b1a916`](https://github.com/nophead/NopSCADlib/commit/7b1a9160434f5b000c83f03d39305f73b0bbf646 "show commit") [C.P.](# "Chris Palmer") Fixed vAx1 dimensions, removed flange and repositioned the tongue.
* 2023-01-28 [`de05134`](https://github.com/nophead/NopSCADlib/commit/de051343d01e57b5e0c43a5f8de69eb508bd86ca "show commit") [E.F.](# "Elliot Foster") WiP of an Orange Pi Zero 2 PCB
### [v20.21.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.21.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.20.1...v20.21.0 "diff with v20.20.1")
* 2023-01-28 [`34719c3`](https://github.com/nophead/NopSCADlib/commit/34719c33607f8720701eb59719af337cb4a1b777 "show commit") [C.P.](# "Chris Palmer") Box shelves now have screws in the corners to hold them down.
* 2023-01-28 [`024439d`](https://github.com/nophead/NopSCADlib/commit/024439d4c2d0f302027d130584cedadb6d9d14a9 "show commit") [C.P.](# "Chris Palmer") Can now specify short inserts to be used for `butt_boxes`.
#### [v20.20.1](https://github.com/nophead/NopSCADlib/releases/tag/v20.20.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v20.20.0...v20.20.1 "diff with v20.20.0")
* 2023-01-28 [`005c112`](https://github.com/nophead/NopSCADlib/commit/005c112ba9fc210f88fa82cf638108dbe0b20f26 "show commit") [C.P.](# "Chris Palmer") Added values to the SMD capacitors on the example PCB.
* 2023-01-28 [`dfbcbf8`](https://github.com/nophead/NopSCADlib/commit/dfbcbf84ab57a2c70aaf5b1fa26668278b6993d3 "show commit") [C.P.](# "Chris Palmer") Changed OpenGrab link as `nicadrone.com` has gone.
### [v20.20.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.20.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.19.1...v20.20.0 "diff with v20.19.1")
* 2023-01-24 [`e7e9313`](https://github.com/nophead/NopSCADlib/commit/e7e9313e71fb2b30aca142ceded2dc5615695071 "show commit") [C.P.](# "Chris Palmer") Updated images and readme.
* 2023-01-23 [`dab06ce`](https://github.com/nophead/NopSCADlib/commit/dab06ce4ca771787aa625d1370b4f2b779580315 "show commit") [E.F.](# "Elliot Foster") Add Raspberry Pi 3 A+ to pcbs
#### [v20.19.1](https://github.com/nophead/NopSCADlib/releases/tag/v20.19.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v20.19.0...v20.19.1 "diff with v20.19.0")
* 2023-01-24 [`494002a`](https://github.com/nophead/NopSCADlib/commit/494002aebeda560e65ca4f8cb3794707487a3c2a "show commit") [C.P.](# "Chris Palmer") Added test to MP1584EN PCB.
* 2023-01-24 [`77e948f`](https://github.com/nophead/NopSCADlib/commit/77e948f43c911442211bcbf6d1b1520184d2c70b "show commit") [C.P.](# "Chris Palmer") Added can bus connectors to OpenGrab model.
Tweaked some PCB component positions.
* 2023-01-24 [`543cdb4`](https://github.com/nophead/NopSCADlib/commit/543cdb4e01d38308a06d4368ebabadb85c696567 "show commit") [C.P.](# "Chris Palmer") Incresed the clearance of holes made for pin header.
### [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") #### [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. * 2023-01-07 [`ec3e752`](https://github.com/nophead/NopSCADlib/commit/ec3e752fc5b5586ef5ac838c709ab4b704dac817 "show commit") [C.](# "Chris") Added missing documentation for `hinge_female()` module.

View File

@@ -2,7 +2,7 @@
## Requirements ## Requirements
1. OpenSCAD 2021.01 or later, download it from here: https://www.openscad.org/downloads.html 1. OpenSCAD 2021.01 or later, download it from here: https://www.openscad.org/downloads.html
1. Python 2.7+ or 3.6+ from https://www.python.org/downloads/ 1. Python 3.6+ from https://www.python.org/downloads/
1. ImageMagick 7 www.imagemagick.org 1. ImageMagick 7 www.imagemagick.org
These are all cross platform tools so NopSCADlib should work on any platform that supports them, although it has currently only been tested on Win7. These are all cross platform tools so NopSCADlib should work on any platform that supports them, although it has currently only been tested on Win7.

View File

@@ -37,6 +37,7 @@ include <vitamins/components.scad>
include <vitamins/displays.scad> include <vitamins/displays.scad>
include <vitamins/extrusions.scad> include <vitamins/extrusions.scad>
include <vitamins/extrusion_brackets.scad> include <vitamins/extrusion_brackets.scad>
include <vitamins/fastons.scad>
include <vitamins/geared_steppers.scad> include <vitamins/geared_steppers.scad>
include <vitamins/hot_ends.scad> include <vitamins/hot_ends.scad>
include <vitamins/inserts.scad> include <vitamins/inserts.scad>
@@ -48,6 +49,7 @@ include <vitamins/magnets.scad>
include <vitamins/mains_sockets.scad> include <vitamins/mains_sockets.scad>
include <vitamins/modules.scad> include <vitamins/modules.scad>
include <vitamins/panel_meters.scad> include <vitamins/panel_meters.scad>
include <vitamins/photo_interrupters.scad>
include <vitamins/pillars.scad> include <vitamins/pillars.scad>
include <vitamins/pillow_blocks.scad> include <vitamins/pillow_blocks.scad>
include <vitamins/pin_headers.scad> include <vitamins/pin_headers.scad>
@@ -99,3 +101,4 @@ use <utils/round.scad>
use <utils/offset.scad> use <utils/offset.scad>
use <utils/sector.scad> use <utils/sector.scad>
use <utils/thread.scad> use <utils/thread.scad>
use <vitamins/photo_interrupter.scad>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 998 KiB

After

Width:  |  Height:  |  Size: 977 KiB

View File

@@ -63,6 +63,7 @@ use <tests/drag_chain.scad>
use <tests/extrusions.scad> use <tests/extrusions.scad>
use <tests/extrusion_brackets.scad> use <tests/extrusion_brackets.scad>
use <tests/fans.scad> use <tests/fans.scad>
use <tests/fastons.scad>
use <tests/fuseholder.scad> use <tests/fuseholder.scad>
use <tests/geared_steppers.scad> use <tests/geared_steppers.scad>
use <tests/hot_ends.scad> use <tests/hot_ends.scad>
@@ -84,6 +85,7 @@ use <tests/o_ring.scad>
use <tests/opengrab.scad> use <tests/opengrab.scad>
use <tests/panel_meters.scad> use <tests/panel_meters.scad>
use <tests/PCBs.scad> use <tests/PCBs.scad>
use <tests/photo_interrupters.scad>
use <tests/pillars.scad> use <tests/pillars.scad>
use <tests/pillow_blocks.scad> use <tests/pillow_blocks.scad>
use <tests/potentiometers.scad> use <tests/potentiometers.scad>
@@ -215,7 +217,7 @@ translate([950, box_y])
box_test(); box_test();
translate([950, 1400]) translate([950, 1525])
rotate(-90) rotate(-90)
bbox_test(); bbox_test();
@@ -223,7 +225,7 @@ inserts_y = 0;
nuts_y = inserts_y + 20; nuts_y = inserts_y + 20;
washers_y = nuts_y + 120; washers_y = nuts_y + 120;
screws_y = washers_y + 120; screws_y = washers_y + 120;
circlips_y = screws_y + 160; circlips_y = screws_y + 180;
springs_y = circlips_y + 20; springs_y = circlips_y + 20;
o_rings_y = springs_y; o_rings_y = springs_y;
sealing_strip_y = springs_y + 20; sealing_strip_y = springs_y + 20;
@@ -236,7 +238,7 @@ linear_bearings_y = leadnuts_y + 50;
steppers_y = linear_bearings_y + 110; steppers_y = linear_bearings_y + 110;
sheets_y = steppers_y + 55; sheets_y = steppers_y + 55;
pcbs_y = sheets_y + 60; pcbs_y = sheets_y + 60;
displays_y = pcbs_y + 140; displays_y = pcbs_y + 265;
fans_y = displays_y + 110; fans_y = displays_y + 110;
transformers_y = fans_y + 120; transformers_y = fans_y + 120;
psus_y = transformers_y + 190; psus_y = transformers_y + 190;
@@ -336,9 +338,10 @@ leds_y = 0;
carriers_y = leds_y + 40; carriers_y = leds_y + 40;
magnets_y = carriers_y + 40; magnets_y = carriers_y + 40;
spades_y = magnets_y + 20; spades_y = magnets_y + 20;
buttons_y = spades_y + 20; fastons_y = spades_y + 20;
jacks_y = buttons_y + 40; buttons_y = fastons_y + 20;
microswitches_y = jacks_y + 40; jacks_y = buttons_y + 30;
microswitches_y = jacks_y + 30;
rockers_y = microswitches_y + 40; rockers_y = microswitches_y + 40;
toggles_y = rockers_y + 60; toggles_y = rockers_y + 60;
components_y = toggles_y + 40; components_y = toggles_y + 40;
@@ -364,6 +367,9 @@ translate([x2 + 70, leds_y])
translate([x2, spades_y]) translate([x2, spades_y])
spades(); spades();
translate([x2, fastons_y])
fastons();
translate([x2, buttons_y]) translate([x2, buttons_y])
buttons(); buttons();
@@ -396,21 +402,21 @@ extrusions_y = panel_meters_y + 80;
translate([x3, veroboard_y]) translate([x3, veroboard_y])
veroboard_test(); veroboard_test();
translate([x3 + 60, veroboard_y + 20]) translate([x3 + 50, veroboard_y + 20])
geared_steppers(); geared_steppers();
translate([x3 + 160, ssrs_y]) translate([x3 + 160, ssrs_y])
pcb_mounts(); pcb_mounts();
translate([x3 + 170, veroboard_y + 16]) translate([x3 + 145, veroboard_y + 16])
cameras(); cameras();
translate([x3 + 145, d_connectors_y - 10])
camera_housings();
translate([x3, d_connectors_y]) translate([x3, d_connectors_y])
d_connectors(); d_connectors();
translate([x3 + 170, d_connectors_y - 10])
camera_housings();
translate([x3, iecs_y]) translate([x3, iecs_y])
iecs(); iecs();
@@ -423,6 +429,9 @@ translate([x3 + 60, modules_y])
translate([x3 + 90, modules_y]) translate([x3 + 90, modules_y])
modules(); modules();
translate([x3 + 150, modules_y])
photo_interrupters();
translate([x3, ssrs_y]) { translate([x3, ssrs_y]) {
ssrs(); ssrs();

View File

@@ -474,16 +474,19 @@ function subst_sheet(type, sheet) =
let(s = box_sheets(type)) let(s = box_sheets(type))
sheet ? assert(sheet_thickness(sheet) == sheet_thickness(s)) sheet : s; 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 module box_shelf_blank(type, sheet = false, wall = undef) { //! Generates a 2D template for a shelf sheet
difference() { difference() {
sheet_2D(subst_sheet(type, sheet), box_width(type) - bezel_clearance, box_depth(type) - bezel_clearance, 1); sheet_2D(subst_sheet(type, sheet), box_width(type) - bezel_clearance, box_depth(type) - bezel_clearance, 1);
offset(bezel_clearance / 2) offset(bezel_clearance / 2)
box_corner_quadrants(type, box_width(type), box_depth(type)); box_corner_quadrants(type, box_width(type), box_depth(type));
box_shelf_screw_positions(type, [], 0, wall)
drill(screw_clearance_radius(box_shelf_screw(type)), 0);
} }
} }
module box_shelf_screw_positions(type, screw_positions, thickness = 0, wall = undef) { //! Place children at the shelf screw positions module box_shelf_screw_positions(type, screw_positions, thickness = 0, wall = undef, top_screws = true) { //! Place children at the shelf screw positions
w = is_undef(wall) ? box_wall(type) : wall; w = is_undef(wall) ? box_wall(type) : wall;
insert = box_shelf_insert(type); insert = box_shelf_insert(type);
translate_z(-insert_boss_radius(insert, w)) translate_z(-insert_boss_radius(insert, w))
@@ -491,13 +494,22 @@ module box_shelf_screw_positions(type, screw_positions, thickness = 0, wall = un
multmatrix(p) multmatrix(p)
translate_z(thickness) translate_z(thickness)
children(); children();
r = box_boss_r(type);
inset = box_intrusion(type) - r + (r + insert_boss_radius(insert, w) + bezel_clearance / 2) / sqrt(2);
if(top_screws)
translate_z(thickness)
for(x = [-1, 1], y = [-1, 1])
translate([x * (box_width(type) / 2 - inset), y * (box_depth(type) / 2 - inset)])
rotate(45 * x * (2 + y))
children();
} }
module box_shelf_bracket(type, screw_positions, wall = undef) { //! Generates a shelf bracket, the first optional child is a 2D cutout and the second 3D cutouts module box_shelf_bracket(type, screw_positions, wall = undef) { //! Generates a shelf bracket, the first optional child is a 2D cutout and the second 3D cutouts
w = is_undef(wall) ? box_wall(type) : wall; w = is_undef(wall) ? box_wall(type) : wall;
insert = box_shelf_insert(type); insert = box_shelf_insert(type);
lip = 2 * insert_boss_radius(insert, w); lip = 2 * insert_boss_radius(insert, w);
width = insert_length(insert) + w; width = max(insert_length(insert) + w, lip);
module shape() module shape()
difference() { difference() {

View File

@@ -51,9 +51,10 @@ function bbox_name(type) = type[8]; //! Optional name if there is more tha
function bbox_skip_blocks(type)= type[9]; //! List of fixing blocks to skip, used to allow a hinged panel for example function bbox_skip_blocks(type)= type[9]; //! List of fixing blocks to skip, used to allow a hinged panel for example
function bbox_star_washers(type)= type[10];//! Set to false to remove star washers. function bbox_star_washers(type)= type[10];//! Set to false to remove star washers.
function bbox_thin_blocks(type) = type[11];//! Set for 2 screw blocks instead of three hole fixing blocks. function bbox_thin_blocks(type) = type[11];//! Set for 2 screw blocks instead of three hole fixing blocks.
function bbox_short_inserts(type)= type[12];//! Set to use short inserts in the blocks
function bbox(screw, sheets, base_sheet, top_sheet, span, size, name = "bbox", skip_blocks = [], star_washers = true, thin_blocks = false) = //! Construct the property list for a butt_box function bbox(screw, sheets, base_sheet, top_sheet, span, size, name = "bbox", skip_blocks = [], star_washers = true, thin_blocks = false, short_inserts = false) = //! Construct the property list for a butt_box
[ screw, sheets, base_sheet, top_sheet, span, size.x, size.y, size.z, name, skip_blocks, star_washers, thin_blocks ]; [ screw, sheets, base_sheet, top_sheet, span, size.x, size.y, size.z, name, skip_blocks, star_washers, thin_blocks, short_inserts ];
function bbox_volume(type) = bbox_width(type) * bbox_depth(type) * bbox_height(type) / 1000000; //! Internal volume in litres function bbox_volume(type) = bbox_width(type) * bbox_depth(type) * bbox_height(type) / 1000000; //! Internal volume in litres
function bbox_area(type) = let(w = bbox_width(type), d = bbox_depth(type), h = bbox_height(type)) //! Internal surface area in m^2 function bbox_area(type) = let(w = bbox_width(type), d = bbox_depth(type), h = bbox_height(type)) //! Internal surface area in m^2
@@ -78,7 +79,8 @@ function corner_block_positions(type) = let(
rotate([z > 0 ? 180 : 0, 0, corner * 90 + (z > 0 ? 90 : 0)]) rotate([z > 0 ? 180 : 0, 0, corner * 90 + (z > 0 ? 90 : 0)])
]; ];
function corner_holes(type) = [for(p = corner_block_positions(type), q = corner_block_holes(bbox_screw(type))) p * q]; function corner_holes(type) = let(short = bbox_short_inserts(type))
[for(p = corner_block_positions(type), q = corner_block_holes(bbox_screw(type), short_insert = short)) p * q];
function fixing_block_positions(type) = let( function fixing_block_positions(type) = let(
width = bbox_width(type), width = bbox_width(type),
@@ -112,7 +114,8 @@ function fixing_block_positions(type) = let(
function side_holes(type) = let( function side_holes(type) = let(
screw = bbox_screw(type), screw = bbox_screw(type),
holes = bbox_thin_blocks(type) ? 2screw_block_holes(screw) : fixing_block_holes(screw)) short = bbox_short_inserts(type),
holes = bbox_thin_blocks(type) ? 2screw_block_holes(screw, short_insert = short) : fixing_block_holes(screw))
[for(p = fixing_block_positions(type), q = holes) p * q]; [for(p = fixing_block_positions(type), q = holes) p * q];
module bbox_drill_holes(type, t) module bbox_drill_holes(type, t)
@@ -232,6 +235,7 @@ module _bbox_assembly(type, top = true, base = true, left = true, right = true,
tt = sheet_thickness(bbox_top_sheet(type)); tt = sheet_thickness(bbox_top_sheet(type));
star_washers = bbox_star_washers(type); star_washers = bbox_star_washers(type);
thin_blocks = bbox_thin_blocks(type); thin_blocks = bbox_thin_blocks(type);
short = bbox_short_inserts(type);
function is_missing_screw(p) = p.y > depth / 2 - 1 ? !back : false; function is_missing_screw(p) = p.y > depth / 2 - 1 ? !back : false;
@@ -241,14 +245,14 @@ module _bbox_assembly(type, top = true, base = true, left = true, right = true,
let(q = transform([0, 0, 0], p), thickness = q.z > 0 ? tt : bt) let(q = transform([0, 0, 0], p), thickness = q.z > 0 ? tt : bt)
multmatrix(p) multmatrix(p)
fastened_corner_block_assembly(is_missing_screw(q) && ((q.z > 0) != (q.x > 0)) ? 0 : t, bbox_screw(type), thickness, fastened_corner_block_assembly(is_missing_screw(q) && ((q.z > 0) != (q.x > 0)) ? 0 : t, bbox_screw(type), thickness,
is_missing_screw(q) && ((q.z > 0) == (q.x > 0)) ? 0 : t, star_washers = star_washers); is_missing_screw(q) && ((q.z > 0) == (q.x > 0)) ? 0 : t, star_washers = star_washers, short_insert = short);
h = height / 2 - 1; h = height / 2 - 1;
for(p = fixing_block_positions(type)) for(p = fixing_block_positions(type))
let(q = transform([0, 0, 0], p), thickness = q.z > h ? tt : q.z < -h ? bt : t) let(q = transform([0, 0, 0], p), thickness = q.z > h ? tt : q.z < -h ? bt : t)
multmatrix(p) multmatrix(p)
if(thin_blocks) if(thin_blocks)
fastened_2screw_block_assembly(is_missing_screw(q) ? 0 : t, bbox_screw(type), thickness_below = thickness, star_washers = star_washers); fastened_2screw_block_assembly(is_missing_screw(q) ? 0 : t, bbox_screw(type), thickness_below = thickness, star_washers = star_washers, short_insert = short);
else else
fastened_fixing_block_assembly(is_missing_screw(q) ? 0 : t, bbox_screw(type), thickness2 = thickness, star_washers = star_washers); fastened_fixing_block_assembly(is_missing_screw(q) ? 0 : t, bbox_screw(type), thickness2 = thickness, star_washers = star_washers);

402
readme.md
View File

@@ -21,33 +21,33 @@ A list of changes classified as breaking, additions or fixes is maintained in [C
## Table of Contents<a name="top"/> ## Table of Contents<a name="top"/>
<table><tr> <table><tr>
<th align="left"> Vitamins A-H </th><th align="left"> Vitamins I-Q </th><th align="left"> Vitamins R-Z </th><th align="left"> Printed </th><th align="left"> Utilities </th><th align="left"> Core Utilities </th></tr> <th align="left"> Vitamins A-H </th><th align="left"> Vitamins I-Q </th><th align="left"> Vitamins R-Z </th><th align="left"> Printed </th><th align="left"> Utilities </th><th align="left"> Core Utilities </th></tr>
<tr><td> <a href = "#7_segments">7_segments</a> </td><td> <a href = "#IECs">IECs</a> </td><td> <a href = "#Rails">Rails</a> </td><td> <a href = "#Box">Box</a> </td><td> <a href = "#Annotation">Annotation</a> </td><td> <a href = "#BOM">BOM</a> </td></tr> <tr><td> <a href = "#7_segments">7_segments</a> </td><td> <a href = "#IECs">IECs</a> </td><td> <a href = "#Radials">Radials</a> </td><td> <a href = "#Box">Box</a> </td><td> <a href = "#Annotation">Annotation</a> </td><td> <a href = "#BOM">BOM</a> </td></tr>
<tr><td> <a href = "#Axials">Axials</a> </td><td> <a href = "#Inserts">Inserts</a> </td><td> <a href = "#Ring_terminals">Ring_terminals</a> </td><td> <a href = "#Butt_box">Butt_box</a> </td><td> <a href = "#Bezier">Bezier</a> </td><td> <a href = "#Clip">Clip</a> </td></tr> <tr><td> <a href = "#Axials">Axials</a> </td><td> <a href = "#Inserts">Inserts</a> </td><td> <a href = "#Rails">Rails</a> </td><td> <a href = "#Butt_box">Butt_box</a> </td><td> <a href = "#Bezier">Bezier</a> </td><td> <a href = "#Clip">Clip</a> </td></tr>
<tr><td> <a href = "#BLDC_motors">BLDC_motors</a> </td><td> <a href = "#Jack">Jack</a> </td><td> <a href = "#Rockers">Rockers</a> </td><td> <a href = "#Cable_clip">Cable_clip</a> </td><td> <a href = "#Catenary">Catenary</a> </td><td> <a href = "#Global">Global</a> </td></tr> <tr><td> <a href = "#BLDC_motors">BLDC_motors</a> </td><td> <a href = "#Jack">Jack</a> </td><td> <a href = "#Ring_terminals">Ring_terminals</a> </td><td> <a href = "#Cable_clip">Cable_clip</a> </td><td> <a href = "#Catenary">Catenary</a> </td><td> <a href = "#Global">Global</a> </td></tr>
<tr><td> <a href = "#Ball_bearings">Ball_bearings</a> </td><td> <a href = "#LDRs">LDRs</a> </td><td> <a href = "#Rod">Rod</a> </td><td> <a href = "#Cable_grommets">Cable_grommets</a> </td><td> <a href = "#Core_xy">Core_xy</a> </td><td> <a href = "#Polyholes">Polyholes</a> </td></tr> <tr><td> <a href = "#Ball_bearings">Ball_bearings</a> </td><td> <a href = "#LDRs">LDRs</a> </td><td> <a href = "#Rockers">Rockers</a> </td><td> <a href = "#Cable_grommets">Cable_grommets</a> </td><td> <a href = "#Core_xy">Core_xy</a> </td><td> <a href = "#Polyholes">Polyholes</a> </td></tr>
<tr><td> <a href = "#Batteries">Batteries</a> </td><td> <a href = "#LED_meters">LED_meters</a> </td><td> <a href = "#SK_brackets">SK_brackets</a> </td><td> <a href = "#Camera_housing">Camera_housing</a> </td><td> <a href = "#Dogbones">Dogbones</a> </td><td> <a href = "#Rounded_rectangle">Rounded_rectangle</a> </td></tr> <tr><td> <a href = "#Batteries">Batteries</a> </td><td> <a href = "#LED_meters">LED_meters</a> </td><td> <a href = "#Rod">Rod</a> </td><td> <a href = "#Camera_housing">Camera_housing</a> </td><td> <a href = "#Dogbones">Dogbones</a> </td><td> <a href = "#Rounded_rectangle">Rounded_rectangle</a> </td></tr>
<tr><td> <a href = "#Bearing_blocks">Bearing_blocks</a> </td><td> <a href = "#LEDs">LEDs</a> </td><td> <a href = "#SMDs">SMDs</a> </td><td> <a href = "#Carriers">Carriers</a> </td><td> <a href = "#Fillet">Fillet</a> </td><td> <a href = "#Sphere">Sphere</a> </td></tr> <tr><td> <a href = "#Bearing_blocks">Bearing_blocks</a> </td><td> <a href = "#LEDs">LEDs</a> </td><td> <a href = "#SK_brackets">SK_brackets</a> </td><td> <a href = "#Carriers">Carriers</a> </td><td> <a href = "#Fillet">Fillet</a> </td><td> <a href = "#Sphere">Sphere</a> </td></tr>
<tr><td> <a href = "#Belts">Belts</a> </td><td> <a href = "#Leadnuts">Leadnuts</a> </td><td> <a href = "#SSRs">SSRs</a> </td><td> <a href = "#Corner_block">Corner_block</a> </td><td> <a href = "#Gears">Gears</a> </td><td> <a href = "#Teardrops">Teardrops</a> </td></tr> <tr><td> <a href = "#Belts">Belts</a> </td><td> <a href = "#Leadnuts">Leadnuts</a> </td><td> <a href = "#SMDs">SMDs</a> </td><td> <a href = "#Corner_block">Corner_block</a> </td><td> <a href = "#Gears">Gears</a> </td><td> <a href = "#Teardrops">Teardrops</a> </td></tr>
<tr><td> <a href = "#Blowers">Blowers</a> </td><td> <a href = "#Light_strips">Light_strips</a> </td><td> <a href = "#Screws">Screws</a> </td><td> <a href = "#Door_hinge">Door_hinge</a> </td><td> <a href = "#Hanging_hole">Hanging_hole</a> </td><td></td></tr> <tr><td> <a href = "#Blowers">Blowers</a> </td><td> <a href = "#Light_strips">Light_strips</a> </td><td> <a href = "#SSRs">SSRs</a> </td><td> <a href = "#Door_hinge">Door_hinge</a> </td><td> <a href = "#Hanging_hole">Hanging_hole</a> </td><td></td></tr>
<tr><td> <a href = "#Box_sections">Box_sections</a> </td><td> <a href = "#Linear_bearings">Linear_bearings</a> </td><td> <a href = "#Sealing_strip">Sealing_strip</a> </td><td> <a href = "#Door_latch">Door_latch</a> </td><td> <a href = "#Horiholes">Horiholes</a> </td><td></td></tr> <tr><td> <a href = "#Box_sections">Box_sections</a> </td><td> <a href = "#Linear_bearings">Linear_bearings</a> </td><td> <a href = "#Screws">Screws</a> </td><td> <a href = "#Door_latch">Door_latch</a> </td><td> <a href = "#Horiholes">Horiholes</a> </td><td></td></tr>
<tr><td> <a href = "#Bulldogs">Bulldogs</a> </td><td> <a href = "#Magnets">Magnets</a> </td><td> <a href = "#Servo_motors">Servo_motors</a> </td><td> <a href = "#Drag_chain">Drag_chain</a> </td><td> <a href = "#Layout">Layout</a> </td><td></td></tr> <tr><td> <a href = "#Bulldogs">Bulldogs</a> </td><td> <a href = "#Magnets">Magnets</a> </td><td> <a href = "#Sealing_strip">Sealing_strip</a> </td><td> <a href = "#Drag_chain">Drag_chain</a> </td><td> <a href = "#Layout">Layout</a> </td><td></td></tr>
<tr><td> <a href = "#Buttons">Buttons</a> </td><td> <a href = "#Mains_sockets">Mains_sockets</a> </td><td> <a href = "#Shaft_couplings">Shaft_couplings</a> </td><td> <a href = "#Fan_guard">Fan_guard</a> </td><td> <a href = "#Maths">Maths</a> </td><td></td></tr> <tr><td> <a href = "#Buttons">Buttons</a> </td><td> <a href = "#Mains_sockets">Mains_sockets</a> </td><td> <a href = "#Servo_motors">Servo_motors</a> </td><td> <a href = "#Fan_guard">Fan_guard</a> </td><td> <a href = "#Maths">Maths</a> </td><td></td></tr>
<tr><td> <a href = "#Cable_strips">Cable_strips</a> </td><td> <a href = "#Microswitches">Microswitches</a> </td><td> <a href = "#Sheets">Sheets</a> </td><td> <a href = "#Fixing_block">Fixing_block</a> </td><td> <a href = "#Offset">Offset</a> </td><td></td></tr> <tr><td> <a href = "#Cable_strips">Cable_strips</a> </td><td> <a href = "#Microswitches">Microswitches</a> </td><td> <a href = "#Shaft_couplings">Shaft_couplings</a> </td><td> <a href = "#Fixing_block">Fixing_block</a> </td><td> <a href = "#Offset">Offset</a> </td><td></td></tr>
<tr><td> <a href = "#Cameras">Cameras</a> </td><td> <a href = "#Microview">Microview</a> </td><td> <a href = "#Spades">Spades</a> </td><td> <a href = "#Flat_hinge">Flat_hinge</a> </td><td> <a href = "#Quadrant">Quadrant</a> </td><td></td></tr> <tr><td> <a href = "#Cameras">Cameras</a> </td><td> <a href = "#Microview">Microview</a> </td><td> <a href = "#Sheets">Sheets</a> </td><td> <a href = "#Flat_hinge">Flat_hinge</a> </td><td> <a href = "#Quadrant">Quadrant</a> </td><td></td></tr>
<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 = "#Circlips">Circlips</a> </td><td> <a href = "#Modules">Modules</a> </td><td> <a href = "#Spades">Spades</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 = "#Components">Components</a> </td><td> <a href = "#Nuts">Nuts</a> </td><td> <a href = "#Spools">Spools</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 = "#DIP">DIP</a> </td><td> <a href = "#O_ring">O_ring</a> </td><td> <a href = "#Springs">Springs</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 = "#LED_bezel">LED_bezel</a> </td><td> <a href = "#Rounded_triangle">Rounded_triangle</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 = "#Stepper_motors">Stepper_motors</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 = "#Displays">Displays</a> </td><td> <a href = "#PCB">PCB</a> </td><td> <a href = "#Swiss_clips">Swiss_clips</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 = "#Extrusion_brackets">Extrusion_brackets</a> </td><td> <a href = "#PCBs">PCBs</a> </td><td> <a href = "#Terminals">Terminals</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 = "#Extrusions">Extrusions</a> </td><td> <a href = "#PSUs">PSUs</a> </td><td> <a href = "#Toggles">Toggles</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 = "#Fans">Fans</a> </td><td> <a href = "#Panel_meters">Panel_meters</a> </td><td> <a href = "#Transformers">Transformers</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 = "#Fastons">Fastons</a> </td><td> <a href = "#Photo_interrupters">Photo_interrupters</a> </td><td> <a href = "#Tubings">Tubings</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 = "#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 = "#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 = "#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 = "#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 = "#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 = "#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> <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></td><td></td><td></td><td> <a href = "#Socket_box">Socket_box</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></td><td></td><td></td><td> <a href = "#Strap_handle">Strap_handle</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> </table>
@@ -110,7 +110,7 @@ Axial components for PCBs.
| Module | Description | | Module | Description |
|:--- |:--- | |:--- |:--- |
| `ax_res(type, value, tol = 5, pitch = 0)` | Through hole axial resistor. If `pitch` is zero the minimum is used. If below the minimum the resistor is placed vertical. | | `ax_res(type, value, tol = 5, pitch = 0)` | Through hole axial resistor. If `pitch` is zero the minimum is used. If below the minimum the resistor is placed vertical. |
| `wire_link(d, l, h = 1, tail = 3)` | Draw a wire jumper link. If `l` is zero then a vertical wire is drawn. | | `wire_link(d, l, h = 1, tail = 3, sleeve = false)` | Draw a wire jumper link. `sleeve` can be a list with the diameter and colour. If `l` is zero then a vertical wire is drawn. |
![axials](tests/png/axials.png) ![axials](tests/png/axials.png)
@@ -124,6 +124,7 @@ Axial components for PCBs.
| 1 | `ax_res(res1_4, 47000)` | Resistor 47000 Ohms 5% 0.25W | | 1 | `ax_res(res1_4, 47000)` | Resistor 47000 Ohms 5% 0.25W |
| 1 | `ax_res(res1_2, 8200)` | Resistor 8200 Ohms 5% 0.5W | | 1 | `ax_res(res1_2, 8200)` | Resistor 8200 Ohms 5% 0.5W |
| 1 | `ax_res(res1_2, 8250, tol = 1)` | Resistor 8250 Ohms 1% 0.5W | | 1 | `ax_res(res1_2, 8250, tol = 1)` | Resistor 8250 Ohms 1% 0.5W |
| 1 | `wire_link(0.8, 7.62, h = 0.75, sleeve = [1.5, "red"])` | Wire link 0.8mm x 0.3" with red sleeving |
| 1 | `wire_link(0.8, 10.16)` | Wire link 0.8mm x 0.4" | | 1 | `wire_link(0.8, 10.16)` | Wire link 0.8mm x 0.4" |
| 1 | `wire_link(0.8, 0, h = 5)` | Wire link 0.8mm x 8mm | | 1 | `wire_link(0.8, 0, h = 5)` | Wire link 0.8mm x 8mm |
@@ -710,6 +711,7 @@ PCB cameras.
### Vitamins ### Vitamins
| Qty | Module call | BOM entry | | Qty | Module call | BOM entry |
| ---:|:--- |:---| | ---:|:--- |:---|
| 1 | `camera(ESP32_CAM)` | ESP32-CAM Camera module |
| 1 | `camera(rpi_camera_v1)` | Raspberry Pi camera V1 | | 1 | `camera(rpi_camera_v1)` | Raspberry Pi camera V1 |
| 1 | `camera(rpi_camera_v2)` | Raspberry Pi camera V2 | | 1 | `camera(rpi_camera_v2)` | Raspberry Pi camera V2 |
| 1 | `camera(rpi_camera)` | Raspberry Pi focusable camera | | 1 | `camera(rpi_camera)` | Raspberry Pi focusable camera |
@@ -805,6 +807,8 @@ Various electronic components used in hot ends and heated beds.
### Functions ### Functions
| Function | Description | | Function | Description |
|:--- |:--- | |:--- |:--- |
| `TO220_lead_pos(i, l)` | Position of ith lead end when length = l |
| `TO220_size()` | Size of a TO220 |
| `TO220_thickness()` | Thickness of the tab of a TO220 | | `TO220_thickness()` | Thickness of the tab of a TO220 |
| `TO247_size()` | Body dimensions of a T247, hole offset, lead height and lead wide length | | `TO247_size()` | Body dimensions of a T247, hole offset, lead height and lead wide length |
| `fack2spm_bezel_size()` | FACK2SPM Bezel dimensions | | `fack2spm_bezel_size()` | FACK2SPM Bezel dimensions |
@@ -816,6 +820,7 @@ Various electronic components used in hot ends and heated beds.
| ` TO220(description, leads = 3, lead_length = 16)` | Draw a TO220 package, use `description` to describe what it is | | ` TO220(description, leads = 3, lead_length = 16)` | Draw a TO220 package, use `description` to describe what it is |
| ` TO247(description, lead_length = 20)` | Draw a TO247 package, use `description` to describe what it is | | ` TO247(description, lead_length = 20)` | Draw a TO247 package, use `description` to describe what it is |
| `al_clad_resistor(type, value, leads = true)` | Draw an aluminium clad resistor | | `al_clad_resistor(type, value, leads = true)` | Draw an aluminium clad resistor |
| `al_clad_resistor_assembly(type, value, sleeved = true, sleeving = HSHRNK32, sleeving_length = 15)` | Draw aluminium clad resistor with optional sleaving, positions children at the screw positions |
| `al_clad_resistor_hole_positions(type)` | Position children at the screw holes of an aluminium clad resistor | | `al_clad_resistor_hole_positions(type)` | Position children at the screw holes of an aluminium clad resistor |
| `al_clad_resistor_holes(type, h = 100)` | Drill screw holes for an aluminium clad resistor | | `al_clad_resistor_holes(type, h = 100)` | Drill screw holes for an aluminium clad resistor |
| `fack2spm()` | Draw a FACK2SPM Cat5E RJ45 shielded panel mount coupler | | `fack2spm()` | Draw a FACK2SPM Cat5E RJ45 shielded panel mount coupler |
@@ -824,7 +829,7 @@ Various electronic components used in hot ends and heated beds.
| `panel_USBA()` | Draw a panel mount USBA connector | | `panel_USBA()` | Draw a panel mount USBA connector |
| `panel_USBA_hole_positions()` | Place children at hole positions | | `panel_USBA_hole_positions()` | Place children at hole positions |
| `panel_USBA_holes(h = 100)` | Make holes for USBA connector | | `panel_USBA_holes(h = 100)` | Make holes for USBA connector |
| `resistor(type)` | Draw specified type of resitor | | `resistor(type)` | Draw specified type of resistor |
| `sleeved_resistor(type, sleeving, bare = 5, heatshrink = false)` | Draw a resistor with sleeved leads and option heatshrink | | `sleeved_resistor(type, sleeving, bare = 5, heatshrink = false)` | Draw a resistor with sleeved leads and option heatshrink |
| `thermal_cutout(type)` | Draw specified thermal cutout | | `thermal_cutout(type)` | Draw specified thermal cutout |
| `thermal_cutout_hole_positions(type)` | Place children at hole positions | | `thermal_cutout_hole_positions(type)` | Place children at hole positions |
@@ -1191,6 +1196,56 @@ Can draw three styles: solid, open frame and open frame with screw bosses.
| 32 | `washer(M4_washer)` | Washer M4 x 9mm x 0.8mm | | 32 | `washer(M4_washer)` | Washer M4 x 9mm x 0.8mm |
<a href="#top">Top</a>
---
<a name="Fastons"></a>
## Fastons
Faston receptacles to mate with spade connectors
[vitamins/fastons.scad](vitamins/fastons.scad) Object definitions.
[vitamins/faston.scad](vitamins/faston.scad) Implementation.
[tests/fastons.scad](tests/fastons.scad) Code for this example.
### Properties
| Function | Description |
|:--- |:--- |
| `faston_d_bot(type)` | Radius of bottom corners |
| `faston_d_top(type)` | Radius of the clips |
| `faston_fillet_d(type)` | Fillets at the transition |
| `faston_insul_crimp_d(type)` | Outside diameter of the insulation crimp |
| `faston_insul_crimp_l(type)` | Length of the insulation crimp |
| `faston_insul_crimp_o(type)` | Offset of insulation crimp |
| `faston_insul_crimp_p(type)` | Position of the tip of the insulation crimp |
| `faston_size(type)` | Size of the receptical part |
| `faston_t(type)` | Thickness |
| `faston_wall_h(type)` | Height of transition web wall |
| `faston_width(type)` | Width of matching spade |
| `faston_wire_crimp_d(type)` | Outside diameter of the wire crimp |
| `faston_wire_crimp_l(type)` | Length of the wire crimp |
| `faston_wire_crimp_p(type)` | Position of the tip of the wire crimp |
### Functions
| Function | Description |
|:--- |:--- |
| `faston_insul_stop(type)` | Position where insulation stops |
| `faston_length(type)` | Total length of crimp |
### Modules
| Module | Description |
|:--- |:--- |
| `faston(type, closed = false)` | Draw specified faston |
![fastons](tests/png/fastons.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 4 | `faston(5_160430_7)` | Faston part no 5_160430_7 to fit 4.75mm spade |
<a href="#top">Top</a> <a href="#top">Top</a>
--- ---
@@ -2242,7 +2297,7 @@ Can be shown stretched by specifying the `actual_id`.
--- ---
<a name="Opengrab"></a> <a name="Opengrab"></a>
## Opengrab ## Opengrab
Nicodrone OpenGrab V3 electro-permanent magnet, see <https://nicadrone.com/products/epm-v3>. Nicodrone OpenGrab V3 electro-permanent magnet, see <https://kb.zubax.com/display/MAINKB/OpenGrab+EPM+v3>.
A permanent magnet that can be magnetized and de-magnetized electronically. A permanent magnet that can be magnetized and de-magnetized electronically.
@@ -2386,7 +2441,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| `pcb_component(type, name, index = 0)` | Return the component specified by name and index | | `pcb_component(type, name, index = 0)` | Return the component specified by name and index |
| `pcb_component_position(type, name, index = 0)` | Return x y position of specified component | | `pcb_component_position(type, name, index = 0)` | Return x y position of specified component |
| `pcb_coord(type, p)` | Convert offsets from the edge to coordinates relative to the centre | | `pcb_coord(type, p)` | Convert offsets from the edge to coordinates relative to the centre |
| `pcb_grid_pos(type, x, y, z = 0)` | Returns a pcb grid position | | `pcb_grid_pos(type, x, y, z = 0, i = 0)` | Returns a pcb grid position |
| `pcb_screw(type, cap = hs_cap)` | Mounting screw type | | `pcb_screw(type, cap = hs_cap)` | Mounting screw type |
| `pcb_size(type)` | Length, width and thickness in a vector | | `pcb_size(type)` | Length, width and thickness in a vector |
@@ -2394,7 +2449,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| Module | Description | | Module | Description |
|:--- |:--- | |:--- |:--- |
| `barrel_jack(cutout = false)` | Draw barrel power jack | | `barrel_jack(cutout = false)` | Draw barrel power jack |
| `block(size, colour, makes_cutout, cutouts)` | Draw a coloured cube to represent a random PCB component | | `block(size, colour, makes_cutout, cutouts, r = 0, rtop = 0)` | Draw a coloured cube to represent a random PCB component |
| `buzzer(height, diameter, colour)` | Draw PCB buzzer with specified height, diameter and colour | | `buzzer(height, diameter, colour)` | Draw PCB buzzer with specified height, diameter and colour |
| `chip(length, width, thickness, colour, cutout = false)` | Draw a coloured cube to represent a chip, or other rectangular component, or cylinder if width is zero | | `chip(length, width, thickness, colour, cutout = false)` | Draw a coloured cube to represent a chip, or other rectangular component, or cylinder if width is zero |
| `flat_flex(type, cutout = false)` | Draw flat flexistrip connector as used on RPI0 | | `flat_flex(type, cutout = false)` | Draw flat flexistrip connector as used on RPI0 |
@@ -2412,7 +2467,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| `pcb_component_position(type, name)` | Position child at the specified component position | | `pcb_component_position(type, name)` | Position child at the specified component position |
| `pcb_components(type, cutouts = false, angle = undef)` | Draw list of PCB components on the PCB | | `pcb_components(type, cutouts = false, angle = undef)` | Draw list of PCB components on the PCB |
| `pcb_cutouts(type, angle = undef)` | Make cut outs to clear components on a PCB | | `pcb_cutouts(type, angle = undef)` | Make cut outs to clear components on a PCB |
| `pcb_grid(type, x, y, z = 0)` | Positions children at specified grid position | | `pcb_grid(type, x, y, z = 0, i = 0)` | Positions children at specified grid position |
| `pcb_grid_components(type, components, cutouts = false, angle = undef)` | Draw list of components on the PCB grid for perf board | | `pcb_grid_components(type, components, cutouts = false, angle = undef)` | Draw list of components on the PCB grid for perf board |
| `pcb_screw_positions(type)` | Positions children at the mounting hole positions | | `pcb_screw_positions(type)` | Positions children at the mounting hole positions |
| `pcb_spacer(screw, height, wall = 1.8, taper = 0)` | Generate STL for PCB spacer | | `pcb_spacer(screw, height, wall = 1.8, taper = 0)` | Generate STL for PCB spacer |
@@ -2427,6 +2482,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| `usb_C(cutout = false)` | Draw USB C connector | | `usb_C(cutout = false)` | Draw USB C connector |
| `usb_miniA(cutout = false)` | Draw USB mini A connector | | `usb_miniA(cutout = false)` | Draw USB mini A connector |
| `usb_uA(cutout = false)` | Draw USB micro A connector | | `usb_uA(cutout = false)` | Draw USB micro A connector |
| `usb_vAx1(cutout = false)` | Draw a vertical USB type A single socket |
| `vero_pin(cropped = false)` | Draw a vero pin | | `vero_pin(cropped = false)` | Draw a vero pin |
![pcb](tests/png/pcb.png) ![pcb](tests/png/pcb.png)
@@ -2436,14 +2492,23 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| ---:|:--- |:---| | ---:|:--- |:---|
| 1 | `potentiometer(BTT_encoder)` | BTT_encoder | | 1 | `potentiometer(BTT_encoder)` | BTT_encoder |
| 1 | `box_header(2p54header, 4, 2)` | Box header 4 x 2 | | 1 | `box_header(2p54header, 4, 2)` | Box header 4 x 2 |
| 1 | `box_header(2p54header, 4, 2, right_angle = true)` | Box header 4 x 2 right angle |
| 1 | `rd_xtal(ACT1100, "40MHz")` | Crystal ACT1100 40MHz |
| 1 | `rd_xtal(ACT1700, "80MHz")` | Crystal ACT1700 80MHz |
| 1 | `rd_xtal(C_002RX, "60KHz")` | Crystal C_002RX 60KHz |
| 1 | `rd_xtal(HC49, "4MHz")` | Crystal HC49 4MHz |
| 1 | `rd_xtal(HC49_4H, "10MHz")` | Crystal HC49_4H 10MHz |
| 1 | `d_plug(DCONN9, pcb = true)` | D-type 9 way PCB mount plug | | 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 | `dil_socket(12, 15.24)` | DIL socket 24 x 0.6" |
| 1 | `smd_diode(DO241AC)` | DO241AC package SS34 | | 1 | `smd_diode(DO214AC)` | DO214AC package SS34 |
| 1 | `hdmi(hdmi_full)` | HDMI socket | | 1 | `hdmi(hdmi_full)` | HDMI socket |
| 1 | `pdip(24, 27C32, w = 15.24)` | IC 27C32 PDIP24 | | 1 | `pdip(24, 27C32, w = 15.24)` | IC 27C32 PDIP24 |
| 1 | `pdip(8, NE555)` | IC NE555 PDIP8 | | 1 | `pdip(8, NE555)` | IC NE555 PDIP8 |
| 1 | `idc_transition(2p54header, 5)` | IDC transition header 5 x 2 | | 1 | `idc_transition(2p54header, 5)` | IDC transition header 5 x 2 |
| 1 | `smd_inductor(IND2525)` | IND2525 package 4R7 | | 1 | `smd_inductor(IND2525)` | IND2525 package 4R7 |
| 1 | `jst_xh_header(jst_ph_header, 2)` | JST PH connector 2 way |
| 1 | `jst_xh_header(jst_xh_header, 2)` | JST XH connector 2 way |
| 1 | `jst_xh_header(jst_zh_header, 2)` | JST ZH connector 2 way |
| 1 | `potentiometer(KY_040_encoder)` | KY_040_encoder | | 1 | `potentiometer(KY_040_encoder)` | KY_040_encoder |
| 1 | `led(LED10mm, "yellow")` | LED 10 mm yellow | | 1 | `led(LED10mm, "yellow")` | LED 10 mm yellow |
| 1 | `led(LED3mm)` | LED 3 mm red | | 1 | `led(LED3mm)` | LED 3 mm red |
@@ -2452,8 +2517,11 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `microswitch(small_microswitch)` | Microswitch DM1-00P-110-3 | | 1 | `microswitch(small_microswitch)` | Microswitch DM1-00P-110-3 |
| 1 | `hdmi(hdmi_mini)` | Mini HDMI socket | | 1 | `hdmi(hdmi_mini)` | Mini HDMI socket |
| 1 | `molex_254(2)` | Molex KK header 2 way | | 1 | `molex_254(2)` | Molex KK header 2 way |
| 1 | `molex_254(2, right_angle = 1)` | Molex KK header 2 way right angle |
| 1 | `molex_254(2, right_angle = -1)` | Molex KK header 2 way right angle |
| 1 | `pin_header(2p54header, 4, 1)` | Pin header 4 x 1 | | 1 | `pin_header(2p54header, 4, 1)` | Pin header 4 x 1 |
| 1 | `pin_header(2p54header, 5, 1)` | Pin header 5 x 1 | | 1 | `pin_header(2p54header, 5, 1)` | Pin header 5 x 1 |
| 1 | `pin_header(2p54header, 5, 1, right_angle = true)` | Pin header 5 x 1 right_angle |
| 1 | `pin_socket(2p54header, 4, 1)` | Pin socket 4 x 1 | | 1 | `pin_socket(2p54header, 4, 1)` | Pin socket 4 x 1 |
| 1 | `pin_socket(2p54header, 6, 1)` | Pin socket 6 x 1 | | 1 | `pin_socket(2p54header, 6, 1)` | Pin socket 6 x 1 |
| 2 | `pin_socket(2p54header, 8, 1)` | Pin socket 8 x 1 | | 2 | `pin_socket(2p54header, 8, 1)` | Pin socket 8 x 1 |
@@ -2466,12 +2534,23 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `smd_led(LED0603, orange)` | SMD LED 0603 orange | | 1 | `smd_led(LED0603, orange)` | SMD LED 0603 orange |
| 1 | `smd_led(LED0805, red)` | SMD LED 0805 red | | 1 | `smd_led(LED0805, red)` | SMD LED 0805 red |
| 1 | `smd_led(LED1206, blue)` | SMD LED 1306 blue | | 1 | `smd_led(LED1206, blue)` | SMD LED 1306 blue |
| 1 | `smd_capacitor(CAP0603)` | SMD capacitor 0603 | | 1 | `smd_tant(TANT_A)` | SMD Tantalum capacitor package A ,1uF, 2.5V |
| 1 | `smd_capacitor(CAP0805)` | SMD capacitor 0805 | | 1 | `smd_tant(TANT_B)` | SMD Tantalum capacitor package B ,10uF, 10V |
| 1 | `smd_capacitor(CAP1206)` | SMD capacitor 1206 | | 1 | `smd_tant(TANT_C)` | SMD Tantalum capacitor package C ,100uF, 16V |
| 1 | `smd_resistor(RES0603, 1K)` | SMD resistor 0603 1K 0.1W | | 1 | `smd_capacitor(CAP0402)` | SMD capacitor 0402 10nF |
| 1 | `smd_capacitor(CAP0502)` | SMD capacitor 0502 10nF |
| 1 | `smd_capacitor(CAP0603)` | SMD capacitor 0603 10nF |
| 1 | `smd_capacitor(CAP0805)` | SMD capacitor 0805 100nF |
| 1 | `smd_capacitor(CAP1206)` | SMD capacitor 1206 1uF |
| 1 | `smd_qfp(QFP50P1200X1200X160_64N)` | SMD chip: ATSAM4S4BA, package : QFP50P1200X1200X160_64N |
| 1 | `smd_resistor(L2012C, 1u)` | SMD choke 0805 1u |
| 1 | `smd_coax(U_FL_R_SMT_1)` | SMD coax connector type: U_FL_R_SMT_1 |
| 1 | `smd_resistor(RES0402, 1)` | SMD resistor 0402 1 0.0625W |
| 1 | `smd_resistor(RES0502, 10)` | SMD resistor 0502 10 0.05W |
| 1 | `smd_resistor(RES0603, 100)` | SMD resistor 0603 100 0.1W |
| 1 | `smd_resistor(RES0805, 1K)` | SMD resistor 0805 1K 0.125W | | 1 | `smd_resistor(RES0805, 1K)` | SMD resistor 0805 1K 0.125W |
| 1 | `smd_resistor(RES1206, 1K)` | SMD resistor 1206 1K 0.25W | | 1 | `smd_resistor(RES1206, 1M)` | SMD resistor 1206 1M 0.25W |
| 1 | `smd_soic(SOIC14)` | SOIC14 package 74HC00 |
| 1 | `smd_soic(SOIC16)` | SOIC16 package ICL323 | | 1 | `smd_soic(SOIC16)` | SOIC16 package ICL323 |
| 1 | `smd_soic(SOIC18)` | SOIC18 package PIC18F88 | | 1 | `smd_soic(SOIC18)` | SOIC18 package PIC18F88 |
| 1 | `smd_soic(SOIC8)` | SOIC8 package M34063 | | 1 | `smd_soic(SOIC8)` | SOIC8 package M34063 |
@@ -2494,6 +2573,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 2 | `vero_pin()` | Vero board pin | | 2 | `vero_pin()` | Vero board pin |
| 1 | `wire_link(0.8, 5.08, h = 10.16)` | Wire link 0.8mm x 0.2" | | 1 | `wire_link(0.8, 5.08, h = 10.16)` | Wire link 0.8mm x 0.2" |
| 1 | `wire_link(0.8, 10.16)` | Wire link 0.8mm x 0.4" | | 1 | `wire_link(0.8, 10.16)` | Wire link 0.8mm x 0.4" |
| 1 | `wire_link(0.8, 10.16, h = 0.75, sleeve = [1.5, "red"])` | Wire link 0.8mm x 0.4" with red sleeving |
| 1 | `wire_link(0.8, 0, h = 5)` | Wire link 0.8mm x 8mm | | 1 | `wire_link(0.8, 0, h = 5)` | Wire link 0.8mm x 8mm |
@@ -2545,7 +2625,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| `pcb_component(type, name, index = 0)` | Return the component specified by name and index | | `pcb_component(type, name, index = 0)` | Return the component specified by name and index |
| `pcb_component_position(type, name, index = 0)` | Return x y position of specified component | | `pcb_component_position(type, name, index = 0)` | Return x y position of specified component |
| `pcb_coord(type, p)` | Convert offsets from the edge to coordinates relative to the centre | | `pcb_coord(type, p)` | Convert offsets from the edge to coordinates relative to the centre |
| `pcb_grid_pos(type, x, y, z = 0)` | Returns a pcb grid position | | `pcb_grid_pos(type, x, y, z = 0, i = 0)` | Returns a pcb grid position |
| `pcb_screw(type, cap = hs_cap)` | Mounting screw type | | `pcb_screw(type, cap = hs_cap)` | Mounting screw type |
| `pcb_size(type)` | Length, width and thickness in a vector | | `pcb_size(type)` | Length, width and thickness in a vector |
@@ -2553,7 +2633,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| Module | Description | | Module | Description |
|:--- |:--- | |:--- |:--- |
| `barrel_jack(cutout = false)` | Draw barrel power jack | | `barrel_jack(cutout = false)` | Draw barrel power jack |
| `block(size, colour, makes_cutout, cutouts)` | Draw a coloured cube to represent a random PCB component | | `block(size, colour, makes_cutout, cutouts, r = 0, rtop = 0)` | Draw a coloured cube to represent a random PCB component |
| `buzzer(height, diameter, colour)` | Draw PCB buzzer with specified height, diameter and colour | | `buzzer(height, diameter, colour)` | Draw PCB buzzer with specified height, diameter and colour |
| `chip(length, width, thickness, colour, cutout = false)` | Draw a coloured cube to represent a chip, or other rectangular component, or cylinder if width is zero | | `chip(length, width, thickness, colour, cutout = false)` | Draw a coloured cube to represent a chip, or other rectangular component, or cylinder if width is zero |
| `flat_flex(type, cutout = false)` | Draw flat flexistrip connector as used on RPI0 | | `flat_flex(type, cutout = false)` | Draw flat flexistrip connector as used on RPI0 |
@@ -2571,7 +2651,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| `pcb_component_position(type, name)` | Position child at the specified component position | | `pcb_component_position(type, name)` | Position child at the specified component position |
| `pcb_components(type, cutouts = false, angle = undef)` | Draw list of PCB components on the PCB | | `pcb_components(type, cutouts = false, angle = undef)` | Draw list of PCB components on the PCB |
| `pcb_cutouts(type, angle = undef)` | Make cut outs to clear components on a PCB | | `pcb_cutouts(type, angle = undef)` | Make cut outs to clear components on a PCB |
| `pcb_grid(type, x, y, z = 0)` | Positions children at specified grid position | | `pcb_grid(type, x, y, z = 0, i = 0)` | Positions children at specified grid position |
| `pcb_grid_components(type, components, cutouts = false, angle = undef)` | Draw list of components on the PCB grid for perf board | | `pcb_grid_components(type, components, cutouts = false, angle = undef)` | Draw list of components on the PCB grid for perf board |
| `pcb_screw_positions(type)` | Positions children at the mounting hole positions | | `pcb_screw_positions(type)` | Positions children at the mounting hole positions |
| `pcb_spacer(screw, height, wall = 1.8, taper = 0)` | Generate STL for PCB spacer | | `pcb_spacer(screw, height, wall = 1.8, taper = 0)` | Generate STL for PCB spacer |
@@ -2586,6 +2666,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| `usb_C(cutout = false)` | Draw USB C connector | | `usb_C(cutout = false)` | Draw USB C connector |
| `usb_miniA(cutout = false)` | Draw USB mini A connector | | `usb_miniA(cutout = false)` | Draw USB mini A connector |
| `usb_uA(cutout = false)` | Draw USB micro A connector | | `usb_uA(cutout = false)` | Draw USB micro A connector |
| `usb_vAx1(cutout = false)` | Draw a vertical USB type A single socket |
| `vero_pin(cropped = false)` | Draw a vero pin | | `vero_pin(cropped = false)` | Draw a vero pin |
![pcbs](tests/png/pcbs.png) ![pcbs](tests/png/pcbs.png)
@@ -2616,16 +2697,18 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `pcb(MP1584EN)` | MP1584EN 3A buck converter | | 1 | `pcb(MP1584EN)` | MP1584EN 3A buck converter |
| 1 | `pcb(MT3608)` | MT3608 boost converter module | | 1 | `pcb(MT3608)` | MT3608 boost converter module |
| 1 | `pcb(Melzi)` | Melzi electronics - not shown | | 1 | `pcb(Melzi)` | Melzi electronics - not shown |
| 4 | | Micro SD card | | 6 | | Micro SD card |
| 1 | | Micro SD card - not shown | | 1 | | Micro SD card - not shown |
| 1 | `molex_254(2)` | Molex KK header 2 way - not shown | | 1 | `molex_254(2)` | Molex KK header 2 way - not shown |
| 1 | `molex_254(3)` | Molex KK header 3 way - not shown | | 1 | `molex_254(3)` | Molex KK header 3 way - not shown |
| 20 | `nut(M2_nut, nyloc = true)` | Nut M2 x 1.6mm nyloc | | 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 | | 34 | `nut(M2p5_nut, nyloc = true)` | Nut M2.5 x 2.2mm nyloc |
| 36 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc | | 43 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc |
| 8 | `nut(M4_nut, nyloc = true)` | Nut M4 x 3.2mm nyloc | | 8 | `nut(M4_nut, nyloc = true)` | Nut M4 x 3.2mm nyloc |
| 1 | `pcb(OPZ2)` | Orange Pi Zero 2 |
| 1 | `pcb(PI_IO)` | PI_IO V2 - not shown | | 1 | `pcb(PI_IO)` | PI_IO V2 - not shown |
| 1 | `pcb(PSU12V1A)` | PSU 12V 1A - not shown | | 1 | `pcb(PSU12V1A)` | PSU 12V 1A - not shown |
| 1 | `pcb(PanelDue_v3)` | Panel Due v3.0a LCD Display interface |
| 1 | `pcb(PERF60x40)` | Perfboard 60 x 40mm | | 1 | `pcb(PERF60x40)` | Perfboard 60 x 40mm |
| 1 | `pcb(PERF70x30)` | Perfboard 70 x 30mm | | 1 | `pcb(PERF70x30)` | Perfboard 70 x 30mm |
| 1 | `pcb(PERF70x50)` | Perfboard 70 x 50mm | | 1 | `pcb(PERF70x50)` | Perfboard 70 x 50mm |
@@ -2635,6 +2718,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `pin_socket(2p54header, 13, 2, right_angle = true)` | Pin socket 13 x 2 right_angle - not shown | | 1 | `pin_socket(2p54header, 13, 2, right_angle = true)` | Pin socket 13 x 2 right_angle - not shown |
| 1 | `pcb(RAMPSEndstop)` | RAMPS Endstop Switch | | 1 | `pcb(RAMPSEndstop)` | RAMPS Endstop Switch |
| 1 | `pcb(RPI3)` | Raspberry Pi 3 | | 1 | `pcb(RPI3)` | Raspberry Pi 3 |
| 1 | `pcb(RPI3A)` | Raspberry Pi 3 A+ |
| 1 | `pcb(RPI4)` | Raspberry Pi 4 | | 1 | `pcb(RPI4)` | Raspberry Pi 4 |
| 1 | `pcb(RPI_Pico)` | Raspberry Pi Pico | | 1 | `pcb(RPI_Pico)` | Raspberry Pi Pico |
| 1 | `pcb(RPI0)` | Raspberry Pi Zero | | 1 | `pcb(RPI0)` | Raspberry Pi Zero |
@@ -2643,14 +2727,14 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 2 | `screw(M2p5_cap_screw, 16)` | Screw M2.5 cap x 16mm | | 2 | `screw(M2p5_cap_screw, 16)` | Screw M2.5 cap x 16mm |
| 8 | `screw(M2p5_cap_screw, 25)` | Screw M2.5 cap x 25mm | | 8 | `screw(M2p5_cap_screw, 25)` | Screw M2.5 cap x 25mm |
| 8 | `screw(M2p5_cap_screw, 30)` | Screw M2.5 cap x 30mm | | 8 | `screw(M2p5_cap_screw, 30)` | Screw M2.5 cap x 30mm |
| 4 | `screw(M2p5_cap_screw, 35)` | Screw M2.5 cap x 35mm |
| 4 | `screw(M2p5_pan_screw, 20)` | Screw M2.5 pan x 20mm | | 4 | `screw(M2p5_pan_screw, 20)` | Screw M2.5 pan x 20mm |
| 8 | `screw(M2p5_pan_screw, 25)` | Screw M2.5 pan x 25mm | | 8 | `screw(M2p5_pan_screw, 25)` | Screw M2.5 pan x 25mm |
| 8 | `screw(M3_cap_screw, 16)` | Screw M3 cap x 16mm | | 17 | `screw(M3_cap_screw, 16)` | Screw M3 cap x 16mm |
| 6 | `screw(M3_cap_screw, 20)` | Screw M3 cap x 20mm | | 15 | `screw(M3_cap_screw, 20)` | Screw M3 cap x 20mm |
| 8 | `screw(M3_cap_screw, 30)` | Screw M3 cap x 30mm | | 11 | `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, 20)` | Screw M4 cap x 20mm |
| 4 | `screw(M4_cap_screw, 35)` | Screw M4 cap x 35mm | | 4 | `screw(M4_cap_screw, 25)` | Screw M4 cap x 25mm |
| 4 | `screw(M4_cap_screw, 40)` | Screw M4 cap x 40mm |
| 1 | `pcb(XIAO)` | Seeeduino XIAO | | 1 | `pcb(XIAO)` | Seeeduino XIAO |
| 1 | `pcb(TP4056)` | TP4056 Li-lon Battery charger module | | 1 | `pcb(TP4056)` | TP4056 Li-lon Battery charger module |
| 3 | `terminal_35(2)` | Terminal block 2 way 3.5mm - not shown | | 3 | `terminal_35(2)` | Terminal block 2 way 3.5mm - not shown |
@@ -2658,8 +2742,8 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | | USB A to Mini B lead - not shown | | 1 | | USB A to Mini B lead - not shown |
| 1 | `pcb(WD2002SJ)` | WD2002SJ Buck Boost DC-DC converter | | 1 | `pcb(WD2002SJ)` | WD2002SJ Buck Boost DC-DC converter |
| 20 | `washer(M2_washer)` | Washer M2 x 5mm x 0.3mm | | 20 | `washer(M2_washer)` | Washer M2 x 5mm x 0.3mm |
| 30 | `washer(M2p5_washer)` | Washer M2.5 x 5.9mm x 0.5mm | | 34 | `washer(M2p5_washer)` | Washer M2.5 x 5.9mm x 0.5mm |
| 36 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm | | 43 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
| 8 | `washer(M4_washer)` | Washer M4 x 9mm x 0.8mm | | 8 | `washer(M4_washer)` | Washer M4 x 9mm x 0.8mm |
| 1 | `pcb(ZC_A0591)` | ZC-A0591 ULN2003 driver PCB | | 1 | `pcb(ZC_A0591)` | ZC-A0591 ULN2003 driver PCB |
@@ -2675,21 +2759,63 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 4 | pcb_spacer25140.stl | | 4 | pcb_spacer25140.stl |
| 4 | pcb_spacer25150_2.stl | | 4 | pcb_spacer25150_2.stl |
| 4 | pcb_spacer25160_2.stl | | 4 | pcb_spacer25160_2.stl |
| 4 | pcb_spacer25180.stl | | 4 | pcb_spacer25200.stl |
| 4 | pcb_spacer25190.stl | | 4 | pcb_spacer25210.stl |
| 4 | pcb_spacer25220.stl |
| 2 | pcb_spacer2550.stl | | 2 | pcb_spacer2550.stl |
| 4 | pcb_spacer2590.stl | | 4 | pcb_spacer2590.stl |
| 4 | pcb_spacer30170.stl | | 4 | pcb_spacer30170.stl |
| 4 | pcb_spacer30200.stl | | 4 | pcb_spacer30180.stl |
| 5 | pcb_spacer30210.stl | | 3 | pcb_spacer30190.stl |
| 5 | pcb_spacer30220.stl | | 8 | pcb_spacer3050.stl |
| 4 | pcb_spacer30230.stl | | 9 | pcb_spacer3060.stl |
| 4 | pcb_spacer3050.stl | | 7 | pcb_spacer3070.stl |
| 4 | pcb_spacer3060.stl | | 8 | pcb_spacer3080.stl |
| 2 | pcb_spacer3070.stl | | 4 | pcb_spacer40100.stl |
| 4 | pcb_spacer3080.stl | | 4 | pcb_spacer4090.stl |
| 4 | pcb_spacer40240.stl |
| 4 | pcb_spacer40250.stl |
<a href="#top">Top</a>
---
<a name="Photo_interrupters"></a>
## Photo_interrupters
Photo interrupter modules popular in robot kits and from China.
[vitamins/photo_interrupters.scad](vitamins/photo_interrupters.scad) Object definitions.
[vitamins/photo_interrupter.scad](vitamins/photo_interrupter.scad) Implementation.
[tests/photo_interrupters.scad](tests/photo_interrupters.scad) Code for this example.
### Properties
| Function | Description |
|:--- |:--- |
| `pi_base_height(type)` | Height of the base |
| `pi_base_length(type)` | Length of the base |
| `pi_base_width(type)` | Width of the base |
| `pi_color(type)` | Color of photo interrupter |
| `pi_gap_height(type)` | Height of the gap where the light can be interrupted |
| `pi_gap_width(type)` | Width of the gap |
| `pi_hole_diameter(type)` | Diameter of the mounting holes |
| `pi_pcb(type)` | Parameter for the support PCB, created with pi_pcb |
| `pi_stem_width(type)` | Width of the stems |
### Modules
| Module | Description |
|:--- |:--- |
| `photo_interrupter(type)` | Draw the photo interrupter, with PCB |
| `pi_cutout(type)` | Shape to subtract for fitting a photo interrupter |
| `pi_hole_locations(type)` | Locations of photo interrupter mounting holes |
| `pi_pcb(type)` | Draw the support PCB |
| `pi_pcb_hole_locations(pcb)` | Locations of the PCB holes |
![photo_interrupters](tests/png/photo_interrupters.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `photo_interrupter(PH1)` | PH1 Photo interrupter |
<a href="#top">Top</a> <a href="#top">Top</a>
@@ -2824,9 +2950,9 @@ Pin headers and sockets, etc.
### Modules ### Modules
| Module | Description | | Module | Description |
|:--- |:--- | |:--- |:--- |
| `box_header(type, cols = 1, rows = 1, smt = false, cutout = false)` | Draw box header | | `box_header(type, cols = 1, rows = 1, smt = false, cutout = false, right_angle = false)` | Draw box header |
| `idc_transition(type, cols = 5, skip = [], cutout = false)` | Draw IDC transition header | | `idc_transition(type, cols = 5, skip = [], cutout = false)` | Draw IDC transition header |
| `jst_xh_header(type, pin_count, right_angle = false, colour = false, pin_colour = false, smt = false)` | Draw JST XH connector | | `jst_xh_header(type, pin_count, right_angle = false, colour = false, pin_colour = false, smt = false)` | Draw JST XH, PH or ZH connector |
| `pin(type, length = undef)` | Draw a header pin | | `pin(type, length = undef)` | Draw a header pin |
| `pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cutout = false, colour)` | Draw pin header | | `pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cutout = false, colour)` | Draw pin header |
| `pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt = false, cutout = false, colour)` | Draw pin socket | | `pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt = false, cutout = false, colour)` | Draw pin socket |
@@ -2837,8 +2963,22 @@ Pin headers and sockets, etc.
| Qty | Module call | BOM entry | | Qty | Module call | BOM entry |
| ---:|:--- |:---| | ---:|:--- |:---|
| 1 | `box_header(2p54header, 10, 2)` | Box header 10 x 2 | | 1 | `box_header(2p54header, 10, 2)` | Box header 10 x 2 |
| 1 | `box_header(2p54header, 10, 2, right_angle = true)` | Box header 10 x 2 right angle |
| 1 | `box_header(2p54header, 8, 1)` | Box header 8 x 1 | | 1 | `box_header(2p54header, 8, 1)` | Box header 8 x 1 |
| 1 | `box_header(2p54header, 8, 1, right_angle = true)` | Box header 8 x 1 right angle |
| 1 | `idc_transition(2p54header, 10)` | IDC transition header 10 x 2 | | 1 | `idc_transition(2p54header, 10)` | IDC transition header 10 x 2 |
| 1 | `jst_xh_header(jst_ph_header, 2)` | JST PH connector 2 way |
| 1 | `jst_xh_header(jst_ph_header, 2, right_angle = true)` | JST PH connector 2 way right_angle |
| 1 | `jst_xh_header(jst_ph_header, 5)` | JST PH connector 5 way |
| 1 | `jst_xh_header(jst_ph_header, 5, right_angle = true)` | JST PH connector 5 way right_angle |
| 1 | `jst_xh_header(jst_xh_header, 2)` | JST XH connector 2 way |
| 1 | `jst_xh_header(jst_xh_header, 2, right_angle = true)` | JST XH connector 2 way right_angle |
| 1 | `jst_xh_header(jst_xh_header, 5)` | JST XH connector 5 way |
| 1 | `jst_xh_header(jst_xh_header, 5, right_angle = true)` | JST XH connector 5 way right_angle |
| 1 | `jst_xh_header(jst_zh_header, 2)` | JST ZH connector 2 way |
| 1 | `jst_xh_header(jst_zh_header, 2, right_angle = true)` | JST ZH connector 2 way right_angle |
| 1 | `jst_xh_header(jst_zh_header, 5)` | JST ZH connector 5 way |
| 1 | `jst_xh_header(jst_zh_header, 5, right_angle = true)` | JST ZH connector 5 way right_angle |
| 1 | `pin_header(2p54header, 10, 2)` | Pin header 10 x 2 | | 1 | `pin_header(2p54header, 10, 2)` | Pin header 10 x 2 |
| 1 | `pin_header(2p54header, 3, 1, right_angle = true)` | Pin header 3 x 1 right_angle | | 1 | `pin_header(2p54header, 3, 1, right_angle = true)` | Pin header 3 x 1 right_angle |
| 1 | `pin_header(2p54header, 3, 2, right_angle = true)` | Pin header 3 x 2 right_angle | | 1 | `pin_header(2p54header, 3, 2, right_angle = true)` | Pin header 3 x 2 right_angle |
@@ -2879,7 +3019,7 @@ Potentiometers and rotary encoders
| `pot_spigot_x(type)` | Spigot offset from the shaft centre | | `pot_spigot_x(type)` | Spigot offset from the shaft centre |
| `pot_thread_d(type)` | Nomininal thread diameter | | `pot_thread_d(type)` | Nomininal thread diameter |
| `pot_thread_h(type)` | Height of threaded part | | `pot_thread_h(type)` | Height of threaded part |
| `pot_thread_p(type)` | Thread pritch | | `pot_thread_p(type)` | Thread pitch |
| `pot_wafer(type)` | Width, diameter and thickness of the track wafer plus true if curved | | `pot_wafer(type)` | Width, diameter and thickness of the track wafer plus true if curved |
| `pot_washer(type)` | Outside diameter and thickness of the washer | | `pot_washer(type)` | Outside diameter and thickness of the washer |
@@ -3051,6 +3191,46 @@ Timing belt pulleys, both toothed and plain with internal bearings for idlers.
| 1 | `screw(M4_grub_screw, 6)` | Screw M4 grub x 6mm | | 1 | `screw(M4_grub_screw, 6)` | Screw M4 grub x 6mm |
<a href="#top">Top</a>
---
<a name="Radials"></a>
## Radials
Radial components for PCBs.
[vitamins/radials.scad](vitamins/radials.scad) Object definitions.
[vitamins/radial.scad](vitamins/radial.scad) Implementation.
[tests/radials.scad](tests/radials.scad) Code for this example.
### Properties
| Function | Description |
|:--- |:--- |
| `rd_xtal_flange(type)` | Crystal flange width and thickness |
| `rd_xtal_lead_d(type)` | Crystal lead diameter |
| `rd_xtal_pitch(type)` | Crystal lead pitch |
| `rd_xtal_size(type)` | Crystal length, width and height and optional corner radius |
### Modules
| Module | Description |
|:--- |:--- |
| `cylindrical_wrap(r, h = eps)` | Wrap a 2D child extruded to height `h` around a cylinder with radius `r`. |
| `rd_xtal(type, value, z = 0, pitch = undef, tail = 3)` | Draw a crystal |
![radials](tests/png/radials.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `rd_xtal(ACT1100, "ACT1100")` | Crystal ACT1100 ACT1100 |
| 1 | `rd_xtal(ACT1700, "ACT1700")` | Crystal ACT1700 ACT1700 |
| 1 | `rd_xtal(C_002RX, "C_002RX")` | Crystal C_002RX C_002RX |
| 1 | `rd_xtal(HC49, "HC49")` | Crystal HC49 HC49 |
| 1 | `rd_xtal(HC49_4H, "HC49_4H")` | Crystal HC49_4H HC49_4H |
| 1 | `pcb(PERF60x40)` | Perfboard 60 x 40mm |
<a href="#top">Top</a> <a href="#top">Top</a>
--- ---
@@ -3332,6 +3512,7 @@ For an explanation of `screw_polysink()` see <https://hydraraptor.blogspot.com/2
| `screw_radius(type)` | Nominal radius | | `screw_radius(type)` | Nominal radius |
| `screw_socket_af(type)` | Socket across flats | | `screw_socket_af(type)` | Socket across flats |
| `screw_socket_depth(type)` | Socket or slot depth | | `screw_socket_depth(type)` | Socket or slot depth |
| `screw_thread_diameter(type)` | Thread diameter, if different from nominal diameter |
| `screw_washer(type)` | Default washer | | `screw_washer(type)` | Default washer |
### Functions ### Functions
@@ -3374,12 +3555,14 @@ For an explanation of `screw_polysink()` see <https://hydraraptor.blogspot.com/2
| 1 | `screw(M3_hex_screw, 10)` | Screw M3 hex x 10mm | | 1 | `screw(M3_hex_screw, 10)` | Screw M3 hex x 10mm |
| 1 | `screw(M3_low_cap_screw, 10)` | Screw M3 low cap x 10mm | | 1 | `screw(M3_low_cap_screw, 10)` | Screw M3 low cap x 10mm |
| 1 | `screw(M3_pan_screw, 10)` | Screw M3 pan x 10mm | | 1 | `screw(M3_pan_screw, 10)` | Screw M3 pan x 10mm |
| 1 | `screw(M3_shoulder_screw, 12)` | Screw M3 shoulder x 12mm |
| 1 | `screw(M4_cap_screw, 25)` | Screw M4 cap x 25mm | | 1 | `screw(M4_cap_screw, 25)` | Screw M4 cap x 25mm |
| 1 | `screw(M4_cs_cap_screw, 25)` | Screw M4 cs cap x 25mm | | 1 | `screw(M4_cs_cap_screw, 25)` | Screw M4 cs cap x 25mm |
| 1 | `screw(M4_dome_screw, 25)` | Screw M4 dome x 25mm | | 1 | `screw(M4_dome_screw, 25)` | Screw M4 dome x 25mm |
| 1 | `screw(M4_grub_screw, 8)` | Screw M4 grub x 8mm | | 1 | `screw(M4_grub_screw, 8)` | Screw M4 grub x 8mm |
| 1 | `screw(M4_hex_screw, 30)` | Screw M4 hex x 30mm | | 1 | `screw(M4_hex_screw, 30)` | Screw M4 hex x 30mm |
| 1 | `screw(M4_pan_screw, 30)` | Screw M4 pan x 30mm | | 1 | `screw(M4_pan_screw, 30)` | Screw M4 pan x 30mm |
| 1 | `screw(M4_shoulder_screw, 16)` | Screw M4 shoulder x 16mm |
| 1 | `screw(M5_cap_screw, 30)` | Screw M5 cap x 30mm | | 1 | `screw(M5_cap_screw, 30)` | Screw M5 cap x 30mm |
| 1 | `screw(M5_cs_cap_screw, 30)` | Screw M5 cs cap x 30mm | | 1 | `screw(M5_cs_cap_screw, 30)` | Screw M5 cs cap x 30mm |
| 1 | `screw(M5_dome_screw, 30)` | Screw M5 dome x 30mm | | 1 | `screw(M5_dome_screw, 30)` | Screw M5 dome x 30mm |
@@ -3667,6 +3850,21 @@ SK shaft support brackets
## SMDs ## SMDs
Surface mount components for PCBs. Surface mount components for PCBs.
Note that the value string for tantalum capacitors is the the capacitance in pico farads expressed as two digits plus an exponent plus a single letter voltage code.
E.g. 475A is 4.7uF 10V on the parts list.
| Code | Voltage |
| ---- | ------- |
| e | 2.5 |
| G | 4 |
| J | 6.3 |
| A | 10 |
| C | 16 |
| D | 20 |
| E | 25 |
| V | 35 |
| H | 50 |
[vitamins/smds.scad](vitamins/smds.scad) Object definitions. [vitamins/smds.scad](vitamins/smds.scad) Object definitions.
[vitamins/smd.scad](vitamins/smd.scad) Implementation. [vitamins/smd.scad](vitamins/smd.scad) Implementation.
@@ -3678,6 +3876,14 @@ Surface mount components for PCBs.
|:--- |:--- | |:--- |:--- |
| `smd_cap_end_cap(type)` | End cap width | | `smd_cap_end_cap(type)` | End cap width |
| `smd_cap_size(type)` | Body length, width | | `smd_cap_size(type)` | Body length, width |
| `smd_coax_base_r(type)` | Corner radius of the base |
| `smd_coax_base_size(type)` | Size of the insulating base |
| `smd_coax_groove(type)` | Groove id, width and z |
| `smd_coax_lug_size(type)` | lug size |
| `smd_coax_pin_d(type)` | Central pin diameter |
| `smd_coax_tube(type)` | OD, ID, height |
| `smd_contact_size(type)` | contact size |
| `smd_diode_colour(type)` | Body colour |
| `smd_diode_lead_z(type)` | Top of lead frame from top | | `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_leads(type)` | Lead extent in x, width, thickness and gap |
| `smd_diode_size(type)` | Body length, width and height | | `smd_diode_size(type)` | Body length, width and height |
@@ -3694,8 +3900,14 @@ Surface mount components for PCBs.
| `smd_pot_flat(type)` | Flat at the back of the wiper | | `smd_pot_flat(type)` | Flat at the back of the wiper |
| `smd_pot_size(type)` | Base length, width and height | | `smd_pot_size(type)` | Base length, width and height |
| `smd_pot_wiper(type)` | Wiper diameter, offset, thickness, height, d1, d2, d3, d4 | | `smd_pot_wiper(type)` | Wiper diameter, offset, thickness, height, d1, d2, d3, d4 |
| `smd_qfp_body_size(type)` | Size of the body |
| `smd_qfp_gullwing(type)` | Gullwing S, L, R1, R2 |
| `smd_qfp_pin_size(type)` | Pins dimensions |
| `smd_qfp_pins(type)` | Number of pins |
| `smd_qfp_pitch(type)` | Pin pitch |
| `smd_qfp_slant(type)` | Angle of the slope |
| `smd_res_end_cap(type)` | End cap width | | `smd_res_end_cap(type)` | End cap width |
| `smd_res_power(type)` | Power rating in Watts | | `smd_res_power(type)` | Power rating in Watts, 0 for choke |
| `smd_res_size(type)` | Body length, width and height | | `smd_res_size(type)` | Body length, width and height |
| `smd_soic_lead_pitch(type)` | Lead pitch | | `smd_soic_lead_pitch(type)` | Lead pitch |
| `smd_soic_lead_size(type)` | Lead width, foot depth, lead thickness | | `smd_soic_lead_size(type)` | Lead width, foot depth, lead thickness |
@@ -3710,6 +3922,11 @@ Surface mount components for PCBs.
| `smd_sot_size(type)` | Body length, width and height | | `smd_sot_size(type)` | Body length, width and height |
| `smd_sot_tab_width(type)` | The wide lead at the top | | `smd_sot_tab_width(type)` | The wide lead at the top |
| `smd_sot_z(type)` | Height above PCB surface | | `smd_sot_z(type)` | Height above PCB surface |
| `smd_tant_colours(type)` | Colours of body and stripe |
| `smd_tant_lead_z(type)` | Top of lead frame from top |
| `smd_tant_leads(type)` | Lead extent in x, width, thickness and gap |
| `smd_tant_size(type)` | Body length, width and height |
| `smd_tant_z(type)` | Height above PCB surface |
### Functions ### Functions
| Function | Description | | Function | Description |
@@ -3722,30 +3939,44 @@ Surface mount components for PCBs.
| Module | Description | | Module | Description |
|:--- |:--- | |:--- |:--- |
| `smd_capacitor(type, height, value = undef)` | Draw an SMD capacitor with specified height | | `smd_capacitor(type, height, value = undef)` | Draw an SMD capacitor with specified height |
| `smd_coax(type)` | Draw an SMD coaxial connector |
| `smd_diode(type, value)` | Draw an SMD diode | | `smd_diode(type, value)` | Draw an SMD diode |
| `smd_inductor(type, value)` | Draw an SMD inductor | | `smd_inductor(type, value)` | Draw an SMD inductor |
| `smd_led(type, colour, cutout)` | Draw an SMD LED with specified `colour` | | `smd_led(type, colour, cutout)` | Draw an SMD LED with specified `colour` |
| `smd_pot(type, value)` | Draw an SMD pot | | `smd_pot(type, value)` | Draw an SMD pot |
| `smd_qfp(type, value)` | Draw and SMD QFP package |
| `smd_resistor(type, value)` | Draw an SMD resistor with specified value | | `smd_resistor(type, value)` | Draw an SMD resistor with specified value |
| `smd_soic(type, value)` | Draw an SMD SOIC | | `smd_soic(type, value)` | Draw an SMD SOIC |
| `smd_sot(type, value)` | Draw an SMD transistor | | `smd_sot(type, value)` | Draw an SMD transistor |
| `smd_tant(type, value)` | Draw an SMD tantalum capacitor |
![smds](tests/png/smds.png) ![smds](tests/png/smds.png)
### Vitamins ### Vitamins
| Qty | Module call | BOM entry | | Qty | Module call | BOM entry |
| ---:|:--- |:---| | ---:|:--- |:---|
| 1 | `smd_diode(DO241AC)` | DO241AC package SS34 | | 1 | `smd_diode(DO214AC)` | DO214AC package SS34 |
| 1 | `smd_inductor(IND2525)` | IND2525 package 4R7 | | 1 | `smd_inductor(IND2525)` | IND2525 package 4R7 |
| 1 | `smd_led(LED0603, green)` | SMD LED 0603 green | | 1 | `smd_led(LED0603, green)` | SMD LED 0603 green |
| 1 | `smd_led(LED0805, blue)` | SMD LED 0805 blue | | 1 | `smd_led(LED0805, blue)` | SMD LED 0805 blue |
| 1 | `smd_led(LED1206, red)` | SMD LED 1306 red | | 1 | `smd_led(LED1206, red)` | SMD LED 1306 red |
| 1 | `smd_tant(TANT_A)` | SMD Tantalum capacitor package A ,1uF, 2.5V |
| 1 | `smd_tant(TANT_B)` | SMD Tantalum capacitor package B ,10uF, 6.3V |
| 1 | `smd_tant(TANT_C)` | SMD Tantalum capacitor package C ,100uF, 10V |
| 1 | `smd_capacitor(CAP0402)` | SMD capacitor 0402 |
| 1 | `smd_capacitor(CAP0502)` | SMD capacitor 0502 |
| 1 | `smd_capacitor(CAP0603)` | SMD capacitor 0603 | | 1 | `smd_capacitor(CAP0603)` | SMD capacitor 0603 |
| 1 | `smd_capacitor(CAP0805)` | SMD capacitor 0805 | | 1 | `smd_capacitor(CAP0805)` | SMD capacitor 0805 |
| 1 | `smd_capacitor(CAP1206)` | SMD capacitor 1206 | | 1 | `smd_capacitor(CAP1206)` | SMD capacitor 1206 |
| 1 | `smd_resistor(RES0603, 1R0)` | SMD resistor 0603 1R0 0.1W | | 1 | `smd_qfp(QFP50P1200X1200X160_64N)` | SMD chip: ATSAM4S4BA, package : QFP50P1200X1200X160_64N |
| 1 | `smd_resistor(L2012C, 10u)` | SMD choke 0805 10u |
| 1 | `smd_coax(U_FL_R_SMT_1)` | SMD coax connector type: U_FL_R_SMT_1 |
| 1 | `smd_resistor(RES0402, 1R0)` | SMD resistor 0402 1R0 0.0625W |
| 1 | `smd_resistor(RES0502, 10)` | SMD resistor 0502 10 0.05W |
| 1 | `smd_resistor(RES0603, 100)` | SMD resistor 0603 100 0.1W |
| 1 | `smd_resistor(RES0805, 10M)` | SMD resistor 0805 10M 0.125W | | 1 | `smd_resistor(RES0805, 10M)` | SMD resistor 0805 10M 0.125W |
| 1 | `smd_resistor(RES1206, 100K)` | SMD resistor 1206 100K 0.25W | | 1 | `smd_resistor(RES1206, 100K)` | SMD resistor 1206 100K 0.25W |
| 1 | `smd_soic(SOIC14)` | SOIC14 package SOIC14 |
| 1 | `smd_soic(SOIC16)` | SOIC16 package SOIC16 | | 1 | `smd_soic(SOIC16)` | SOIC16 package SOIC16 |
| 1 | `smd_soic(SOIC18)` | SOIC18 package SOIC18 | | 1 | `smd_soic(SOIC18)` | SOIC18 package SOIC18 |
| 1 | `smd_soic(SOIC8)` | SOIC8 package SOIC8 | | 1 | `smd_soic(SOIC8)` | SOIC8 package SOIC8 |
@@ -4226,6 +4457,8 @@ Tubing and sleeving. The internal diameter can be forced to stretch it over some
| 1 | `tubing(HSHRNK24)` | Heatshrink sleeving ID 2.4mm x 15mm | | 1 | `tubing(HSHRNK24)` | Heatshrink sleeving ID 2.4mm x 15mm |
| 1 | `tubing(HSHRNK64)` | Heatshrink sleeving ID 6.4mm x 15mm | | 1 | `tubing(HSHRNK64)` | Heatshrink sleeving ID 6.4mm x 15mm |
| 1 | `tubing(NEOP85)` | Neoprene tubing OD 8mm ID 5mm x 15mm | | 1 | `tubing(NEOP85)` | Neoprene tubing OD 8mm ID 5mm x 15mm |
| 1 | `tubing(STFE4_3p2_CLR)` | PTFE heatshrink sleeving OD 3.7mm ID 3.2mm x 15mm |
| 1 | `tubing(STFE4_6p4_CLR)` | PTFE heatshrink sleeving OD 7mm ID 6.4mm x 15mm |
| 1 | `tubing(PTFE07)` | PTFE sleeving OD 1.2mm ID 0.71mm x 15mm | | 1 | `tubing(PTFE07)` | PTFE sleeving OD 1.2mm ID 0.71mm x 15mm |
| 1 | `tubing(PTFE20)` | PTFE sleeving OD 2.6mm ID 2mm x 15mm | | 1 | `tubing(PTFE20)` | PTFE sleeving OD 2.6mm ID 2mm x 15mm |
| 1 | `tubing(PTFE2_3)` | PTFE tubing OD 3mm ID 2mm x 15mm | | 1 | `tubing(PTFE2_3)` | PTFE tubing OD 3mm ID 2mm x 15mm |
@@ -4319,6 +4552,7 @@ Veroboard with mounting holes, track breaks, removed tracks, solder points and c
| Function | Description | | Function | Description |
|:--- |:--- | |:--- |:--- |
| `vero(name, assembly, holes, strips, pitch = 2.54, fr4 = false, screw = M3_cap_screw, mounting_holes = [], breaks = [], no_tracks = [], components = [], joints = [])` | Constructor | | `vero(name, assembly, holes, strips, pitch = 2.54, fr4 = false, screw = M3_cap_screw, mounting_holes = [], breaks = [], no_tracks = [], components = [], joints = [])` | Constructor |
| `vero_grid_pos(type, x, y)` | Convert grid position to offset from the centre |
| `vero_length(type)` | Length of the board | | `vero_length(type)` | Length of the board |
| `vero_size(type)` | Board size | | `vero_size(type)` | Board size |
| `vero_thickness(type)` | Thickness of the substrate | | `vero_thickness(type)` | Thickness of the substrate |
@@ -4335,7 +4569,9 @@ Veroboard with mounting holes, track breaks, removed tracks, solder points and c
| `vero_mounting_hole_positions(type)` | Positions children at the mounting holes | | `vero_mounting_hole_positions(type)` | Positions children at the mounting holes |
| `vero_mounting_holes(type, h = 100)` | Drill mounting holes in a panel | | `vero_mounting_holes(type, h = 100)` | Drill mounting holes in a panel |
| `veroboard(type)` | Draw specified veroboard with missing tracks and track breaks | | `veroboard(type)` | Draw specified veroboard with missing tracks and track breaks |
| `veroboard_assembly(type, height, thickness, flip = false, ngb = false)` | Draw the assembly with components and fasteners in place | | `veroboard_assembly(type, ngb = false)` | Draw the assembly with components |
| `veroboard_fastened_assembly(type, height, thickness, flip = false, ngb = false)` | Draw the assembly with components and fasteners in place |
| `veroboard_fasteners(type, height, thickness, flip = false)` | Draw the fasteners in place |
![veroboard](tests/png/veroboard.png) ![veroboard](tests/png/veroboard.png)
@@ -4343,16 +4579,16 @@ Veroboard with mounting holes, track breaks, removed tracks, solder points and c
| Qty | Module call | BOM entry | | Qty | Module call | BOM entry |
| ---:|:--- |:---| | ---:|:--- |:---|
| 2 | `idc_transition(2p54header, 10)` | IDC transition header 10 x 2 | | 2 | `idc_transition(2p54header, 10)` | IDC transition header 10 x 2 |
| 4 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc | | 2 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc |
| 4 | `screw(M3_dome_screw, 25)` | Screw M3 dome x 25mm | | 2 | `screw(M3_dome_screw, 25)` | Screw M3 dome x 25mm |
| 2 | `green_terminal(gt_2p54, 10)` | Terminal block 10 way 0.1" | | 2 | `green_terminal(gt_2p54, 10)` | Terminal block 10 way 0.1" |
| 2 | `veroboard(z_vb)` | Veroboard 5 holes x 22 strips | | 2 | `veroboard(z_vb)` | Veroboard 5 holes x 22 strips |
| 8 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm | | 4 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
### Printed ### Printed
| Qty | Filename | | Qty | Filename |
| ---:|:--- | | ---:|:--- |
| 4 | pcb_spacer30120.stl | | 2 | pcb_spacer30120.stl |
### Assemblies ### Assemblies
| Qty | Name | | Qty | Name |
@@ -4490,7 +4726,7 @@ Utilities for adding wires to the BOM and optionally drawing them and cable bund
| `cable_tie_holes(cable_r, h = 100)` | Holes to thread a ziptie through a panel to make a cable tie. | | `cable_tie_holes(cable_r, h = 100)` | Holes to thread a ziptie through a panel to make a cable tie. |
| `mouse_hole(cable, h = 100, teardrop = false)` | A mouse hole to allow a panel to go over a wire bundle. | | `mouse_hole(cable, h = 100, teardrop = false)` | A mouse hole to allow a panel to go over a wire bundle. |
| `ribbon_cable(ways, length)` | Add ribbon cable to the BOM | | `ribbon_cable(ways, length)` | Add ribbon cable to the BOM |
| `wire(colour, strands, length, strand = 0.2)` | Add stranded wire to the BOM | | `wire(colour, strands, length, strand = 0.2, d = 0, path = [])` | Add stranded wire to the BOM and draw it if diameter and path specified |
![wire](tests/png/wire.png) ![wire](tests/png/wire.png)
@@ -4616,10 +4852,10 @@ The top bezel can have an optional child, which is subtracted to allow modificat
| `box_left_blank(type, sheet = false)` | Generates a 2D template for the left sheet, `sheet` can be set to override the type | | `box_left_blank(type, sheet = false)` | Generates a 2D template for the left sheet, `sheet` can be set to override the type |
| `box_right(type)` | Default right side, can be overridden to customise | | `box_right(type)` | Default right side, can be overridden to customise |
| `box_right_blank(type, sheet = false)` | Generates a 2D template for the right sheet, `sheet` can be set to override the type | | `box_right_blank(type, sheet = false)` | Generates a 2D template for the right sheet, `sheet` can be set to override the type |
| `box_shelf_blank(type, sheet = false)` | Generates a 2D template for a shelf sheet | | `box_shelf_blank(type, sheet = false, wall = undef)` | Generates a 2D template for a shelf sheet |
| `box_shelf_bracket(type, screw_positions, wall = undef)` | Generates a shelf bracket, the first optional child is a 2D cutout and the second 3D cutouts | | `box_shelf_bracket(type, screw_positions, wall = undef)` | Generates a shelf bracket, the first optional child is a 2D cutout and the second 3D cutouts |
| `box_shelf_bracket_section(type, rows, cols, x, y)` | Generates sections of the shelf bracket to allow it to be bigger than the printer | | `box_shelf_bracket_section(type, rows, cols, x, y)` | Generates sections of the shelf bracket to allow it to be bigger than the printer |
| `box_shelf_screw_positions(type, screw_positions, thickness = 0, wall = undef)` | Place children at the shelf screw positions | | `box_shelf_screw_positions(type, screw_positions, thickness = 0, wall = undef, top_screws = true)` | Place children at the shelf screw positions |
| `box_top(type)` | Default top, can be overridden to customise | | `box_top(type)` | Default top, can be overridden to customise |
| `box_top_blank(type)` | Generates a 2D template for the top sheet | | `box_top_blank(type)` | Generates a 2D template for the top sheet |
| `grill(width, height, r = 1000, poly = false, h = 0)` | A staggered array of 5mm holes to make grills in sheets. Can be constrained to be circular. Set `poly` `true` for printing, `false` for milling. | | `grill(width, height, r = 1000, poly = false, h = 0)` | A staggered array of 5mm holes to make grills in sheets. Can be constrained to be circular. Set `poly` `true` for printing, `false` for milling. |
@@ -4696,6 +4932,7 @@ fixing_blocks along the sides.
| `bbox_name(type)` | Optional name if there is more than one box in a project | | `bbox_name(type)` | Optional name if there is more than one box in a project |
| `bbox_screw(type)` | Screw type for corner blocks | | `bbox_screw(type)` | Screw type for corner blocks |
| `bbox_sheets(type)` | Sheet type for the sides | | `bbox_sheets(type)` | Sheet type for the sides |
| `bbox_short_inserts(type)` | Set to use short inserts in the blocks |
| `bbox_skip_blocks(type)` | List of fixing blocks to skip, used to allow a hinged panel for example | | `bbox_skip_blocks(type)` | List of fixing blocks to skip, used to allow a hinged panel for example |
| `bbox_span(type)` | Maximum span between fixing blocks | | `bbox_span(type)` | Maximum span between fixing blocks |
| `bbox_star_washers(type)` | Set to false to remove star washers. | | `bbox_star_washers(type)` | Set to false to remove star washers. |
@@ -4706,7 +4943,7 @@ fixing_blocks along the sides.
### Functions ### Functions
| Function | Description | | Function | Description |
|:--- |:--- | |:--- |:--- |
| `bbox(screw, sheets, base_sheet, top_sheet, span, size, name = "bbox", skip_blocks = [], star_washers = true, thin_blocks = false)` | Construct the property list for a butt_box | | `bbox(screw, sheets, base_sheet, top_sheet, span, size, name = "bbox", skip_blocks = [], star_washers = true, thin_blocks = false, short_inserts = false)` | Construct the property list for a butt_box |
| `bbox_area(type)` | Internal surface area in m^2 | | `bbox_area(type)` | Internal surface area in m^2 |
| `bbox_volume(type)` | Internal volume in litres | | `bbox_volume(type)` | Internal volume in litres |
@@ -6598,7 +6835,6 @@ Maths utilities for manipulating vectors and matrices.
| `argcoth(x)` | inverse hyperbolic cotangent | | `argcoth(x)` | inverse hyperbolic cotangent |
| `argsinh(x)` | inverse hyperbolic sine | | `argsinh(x)` | inverse hyperbolic sine |
| `argtanh(x)` | inverse hyperbolic tangent | | `argtanh(x)` | inverse hyperbolic tangent |
| `augment(m)` | Augment a matrix by adding an identity matrix to the right |
| `circle_intersect(c1, r1, c2, r2)` | Calculate one point where two circles in the X-Z plane intersect, clockwise around c1 | | `circle_intersect(c1, r1, c2, r2)` | Calculate one point where two circles in the X-Z plane intersect, clockwise around c1 |
| `cosh(x)` | hyperbolic cosine | | `cosh(x)` | hyperbolic cosine |
| `coth(x)` | hyperbolic cotangent | | `coth(x)` | hyperbolic cotangent |
@@ -6618,11 +6854,8 @@ Maths utilities for manipulating vectors and matrices.
| `rot2_z(a)` | Generate a 2x2 matrix to rotate around z | | `rot2_z(a)` | Generate a 2x2 matrix to rotate around z |
| `rot3_z(a)` | Generate a 3x3 matrix to rotate around z | | `rot3_z(a)` | Generate a 3x3 matrix to rotate around z |
| `rotate(a, v)` | Generate a 4x4 rotation matrix, `a` can be a vector of three angles or a single angle around `z`, or around axis `v` | | `rotate(a, v)` | Generate a 4x4 rotation matrix, `a` can be a vector of three angles or a single angle around `z`, or around axis `v` |
| `rowswap(m, i, j)` | Swap two rows of a matrix |
| `scale(v)` | Generate a 4x4 matrix that scales by `v`, which can be a vector of xyz factors or a scalar to scale all axes equally | | `scale(v)` | Generate a 4x4 matrix that scales by `v`, which can be a vector of xyz factors or a scalar to scale all axes equally |
| `sinh(x)` | hyperbolic sine | | `sinh(x)` | hyperbolic sine |
| `solve(m, i = 0, j = 0)` | Solve each row ensuring diagonal is not zero |
| `solve_row(m, i)` | Make diagonal one by dividing the row by it and subtract from other rows to make column zero |
| `sqr(x)` | Square x | | `sqr(x)` | Square x |
| `sumv(v)` | sum a vector of values that can be added with "+" | | `sumv(v)` | sum a vector of values that can be added with "+" |
| `tanh(x)` | hyperbolic tangent | | `tanh(x)` | hyperbolic tangent |
@@ -6726,6 +6959,7 @@ Cylinder with a rounded end.
|:--- |:--- | |:--- |:--- |
| `rounded_corner(r, h, r2, ir = 0)` | 2D version | | `rounded_corner(r, h, r2, ir = 0)` | 2D version |
| `rounded_cylinder(r, h, r2, ir = 0, angle = 360)` | Rounded cylinder given radius `r`, height `h`, optional internal radius `ir` and optional `angle` | | `rounded_cylinder(r, h, r2, ir = 0, angle = 360)` | Rounded cylinder given radius `r`, height `h`, optional internal radius `ir` and optional `angle` |
| `rounded_top_rectangle(size, r, r2)` | Make a rounded rectangle with a rounded top edge |
![rounded_cylinder](tests/png/rounded_cylinder.png) ![rounded_cylinder](tests/png/rounded_cylinder.png)

View File

@@ -140,7 +140,7 @@ class BOM:
for part in sorted(self.vitamins): for part in sorted(self.vitamins):
i += 1 i += 1
if ': ' in part: if ': ' in part:
part_no, description = part.split(': ') part_no, description = part.split(': ', 1)
else: else:
part_no, description = "", part part_no, description = "", part
qty = self.vitamins[part].count qty = self.vitamins[part].count
@@ -183,7 +183,7 @@ class BOM:
for part in sorted(self.vitamins): for part in sorted(self.vitamins):
if ': ' in part: if ': ' in part:
part_no, description = part.split(': ') part_no, description = part.split(': ', 1)
else: else:
part_no, description = "", part part_no, description = "", part
if breakdown: if breakdown:

View File

@@ -259,11 +259,11 @@ def tests(tests):
things = BOM[thing] things = BOM[thing]
if things: if things:
body += ['### %s\n| Qty | %s |\n| ---:|:--- |%s' % (thing.title(), heading, ':---|' if '|' in heading else '')] body += ['### %s\n| Qty | %s |\n| ---:|:--- |%s' % (thing.title(), heading, ':---|' if '|' in heading else '')]
for item in sorted(things, key = lambda s: s.split(":")[-1]): for item in sorted(things, key = lambda s: s.split(":",1)[-1]):
name = item name = item
desc = '' desc = ''
if thing == "vitamins": if thing == "vitamins":
vit = item.split(':') vit = item.split(':', 1)
name = '`' + vit[0] + '`' if vit[0] else '' name = '`' + vit[0] + '`' if vit[0] else ''
while '[[' in name and ']]' in name: while '[[' in name and ']]' in name:
i = name.find('[[') i = name.find('[[')

View File

@@ -303,7 +303,7 @@ def views(target, do_assemblies = None):
grand_total2 = 0 grand_total2 = 0
heading = headings[t][0].upper() + headings[t][1:] heading = headings[t][0].upper() + headings[t][1:]
print(('| ' * len(global_bom) + '| | **%s** |') % heading, file = doc_file) print(('| ' * len(global_bom) + '| | **%s** |') % heading, file = doc_file)
for thing in sorted(things[t], key = lambda s: s.split(":")[-1]): for thing in sorted(things[t], key = lambda s: s.split(":",1)[-1]):
for ass in global_bom: for ass in global_bom:
count = ass[t][thing]["count"] if thing in ass[t] else 0 count = ass[t][thing]["count"] if thing in ass[t] else 0
print('| %s ' % pad(count if count else '.', 2, 1), file = doc_file, end = '') print('| %s ' % pad(count if count else '.', 2, 1), file = doc_file, end = '')
@@ -313,7 +313,7 @@ def views(target, do_assemblies = None):
else: else:
totals[name] = count totals[name] = count
grand_total2 += count grand_total2 += count
print('| %s | %s |' % (pad(things[t][thing], 2, 1), pad(thing.split(":")[-1], 2)), file = doc_file) print('| %s | %s |' % (pad(things[t][thing], 2, 1), pad(thing.split(":",1)[-1], 2)), file = doc_file)
grand_total = 0 grand_total = 0
for ass in global_bom: for ass in global_bom:
@@ -344,8 +344,8 @@ def views(target, do_assemblies = None):
print("### Vitamins", file = doc_file) print("### Vitamins", file = doc_file)
print("|Qty|Description|", file = doc_file) print("|Qty|Description|", file = doc_file)
print("|---:|:----------|", file = doc_file) print("|---:|:----------|", file = doc_file)
for v in sorted(vitamins, key = lambda s: s.split(":")[-1]): for v in sorted(vitamins, key = lambda s: s.split(":",1)[-1]):
print("|%d|%s|" % (vitamins[v]["count"], v.split(":")[1]), file = doc_file) print("|%d|%s|" % (vitamins[v]["count"], v.split(":",1)[1]), file = doc_file)
print("\n", file = doc_file) print("\n", file = doc_file)
printed = ass["printed"] printed = ass["printed"]

View File

@@ -21,6 +21,7 @@ include <../vitamins/microswitches.scad>
include <../vitamins/d_connectors.scad> include <../vitamins/d_connectors.scad>
include <../vitamins/leds.scad> include <../vitamins/leds.scad>
include <../vitamins/axials.scad> include <../vitamins/axials.scad>
include <../vitamins/radials.scad>
include <../vitamins/smds.scad> include <../vitamins/smds.scad>
include <../vitamins/7_segments.scad> include <../vitamins/7_segments.scad>
include <../vitamins/potentiometers.scad> include <../vitamins/potentiometers.scad>
@@ -61,30 +62,46 @@ test_pcb = ["test_pcb", "Test PCB",
[ [
[ 20, -5, 180, "trimpot10"], [ 20, -5, 180, "trimpot10"],
[ 20, -15, 90, "trimpot10", true], [ 20, -15, 90, "trimpot10", true],
[ 7, 2, 90, "smd_led", LED1206, "blue"], [ 19, 2, 90, "smd_led", LED1206, "blue"],
[ 10, 2, 90, "smd_led", LED0805, "red"], [ 16, 2, 90, "smd_led", LED0805, "red"],
[ 13, 2, 90, "smd_led", LED0603, "orange"], [ 13, 2, 90, "smd_led", LED0603, "orange"],
[ 16, 2, 90, "smd_res", RES1206, "1K"], [ 10, 2, -90, "smd_res", L2012C, "1u"],
[ 19, 2, 90, "smd_res", RES0805, "1K"], [ 19, 6, -90, "smd_res", RES1206, "1M"],
[ 22, 2, 90, "smd_res", RES0603, "1K"], [ 16, 6, -90, "smd_res", RES0805, "1K"],
[ 25, 2, 90, "smd_cap", CAP1206, 1.5], [ 13, 6, -90, "smd_res", RES0603, "100"],
[ 28, 2, 90, "smd_cap", CAP0805, 1.0], [ 10, 6, -90, "smd_res", RES0502, "10"],
[ 31, 2, 90, "smd_cap", CAP0603, 0.7], [ 7, 6, -90, "smd_res", RES0402, "1"],
[ 34, 3, 90, "smd_diode",DO241AC, "SS34"], [ 19, 10, 90, "smd_cap", CAP1206, 1.5, "1uF"],
[ 22, 6, -90, "smd_pot", TC33X1, "10K"], [ 16, 10, 90, "smd_cap", CAP0805, 1.0, "100nF"],
[ 16, 6, -90, "smd_sot", SOT23, "2N7000"], [ 13, 10, 90, "smd_cap", CAP0603, 0.7, "10nF"],
[ 28, 20, -90, "smd_sot", SOT223, "LM117"], [ 10, 10, 90, "smd_cap", CAP0502, 0.6, "10nF"],
[ 7, 10, 90, "smd_cap", CAP0402, 0.5, "10nF"],
[ 19, 16, -90, "smd_tant", TANT_C, "107C"],
[ 13, 16, -90, "smd_tant", TANT_B, "106A"],
[ 7, 16, -90, "smd_tant", TANT_A, "105e"],
[ 32, 3, -90, "smd_diode",DO214AC, "SS34"],
[ 26, 2, -90, "smd_pot", TC33X1, "10K"],
[ 26, 6, -90, "smd_coax",U_FL_R_SMT_1],
[ 10, 10, 0, "2p54header", 4, 1], [ 26, 10, -90, "smd_sot", SOT23, "2N7000"],
[ 25, 10, 0, "2p54header", 5, 1, false, "blue" ], [ 28, 16, -90, "smd_sot", SOT223, "LM117"],
[ 10, 20, 0, "2p54boxhdr", 4, 2],
[ 10, 30, 0, "2p54socket", 6, 1], [ 30, 30, -90, "smd_qfp", QFP50P1200X1200X160_64N, "ATSAM4S4BA"],
[ 25, 30, 0, "2p54socket", 4, 1, false, 0, false, "red" ],
[ 59, 50, 180, "led", LED3mm, "red"], [ 45, 35, 0, "2p54header", 4, 1],
[ 66, 50, 180, "led", LED5mm, "orange"], [ 60, 35, 0, "2p54header", 5, 1, false, "blue" ],
[ 77, 50, 180, "led", LED8mm, "blue"], [ 60, 40, 180, "2p54header", 5, 1, false, undef, true],
[ 90, 50, 180, "led", LED10mm, "yellow"], [ 80, 33, 0, "2p54boxhdr", 4, 2],
[ 10, 45, 180, "rj45"], [ 80, 40, 0, "2p54boxhdr", 4, 2, false, true, true],
[ 45, 30, 0, "2p54socket", 4, 1, false, 0, false, "red" ],
[ 60, 30, 0, "2p54socket", 6, 1],
[ 59, 60, 180, "led", LED3mm, "red"],
[ 66, 60, 180, "led", LED5mm, "orange"],
[ 77, 60, 180, "led", LED8mm, "blue"],
[ 90, 60, 180, "led", LED10mm, "yellow"],
[ 10, 35, 180, "rj45"],
[ 7, 50, 180, "usb_vAx1"],
[ 8, 65, 180, "usb_A"], [ 8, 65, 180, "usb_A"],
[ 8, 105, 180, "usb_Ax2"], [ 8, 105, 180, "usb_Ax2"],
[ 7, 85, 180, "molex_usb_Ax1"], [ 7, 85, 180, "molex_usb_Ax1"],
@@ -102,28 +119,41 @@ test_pcb = ["test_pcb", "Test PCB",
[ 25, 200, 0, "buzzer", 4.5, 8.5], [ 25, 200, 0, "buzzer", 4.5, 8.5],
[ 25, 218, 0, "buzzer"], [ 25, 218, 0, "buzzer"],
[ 65, 9, 0, "link", inch(0.4)], [ 45, 5, 0, "link", inch(0.4), 0.75, undef, undef, [1.5, "red"]], // Sleeved link
[ 65, 12, 0, "ax_res", res1_8, 1000], [ 45, 9, 0, "link", inch(0.4)], // Flat link
[ 65, 17, 0, "ax_res", res1_4, 10000], [ 45, 12, 0, "ax_res", res1_8, 1000],
[ 65, 22, 0, "ax_res", res1_2, 100000], [ 45, 17, 0, "ax_res", res1_4, 10000],
[ 55, 22, 0, "vero_pin"], [ 45, 22, 0, "ax_res", res1_2, 100000],
[ 55, 17, 0, "vero_pin", true], [ 35, 22, 0, "vero_pin"],
[ 55, 9, 0, "link", 0, 5], [ 35, 17, 0, "vero_pin", true],
[ 35, 9, 0, "link", 0, 5], // Vertical wire
[ 80, 9, 0, "link", inch(0.2), inch(0.4)], [ 60, 9, 0, "link", inch(0.2), inch(0.4)], // Raised link
[ 80, 12, 0, "ax_res", res1_8, 1000000, 1, inch(0.1)], [ 60, 12, 0, "ax_res", res1_8, 1000000, 1, inch(0.1)],
[ 80, 17, 0, "ax_res", res1_4, 100, 2, inch(0.1)], [ 60, 17, 0, "ax_res", res1_4, 100, 2, inch(0.1)],
[ 80, 22, 0, "ax_res", res1_2, 10, 10, inch(0.2)], [ 60, 22, 0, "ax_res", res1_2, 10, 10, inch(0.2)],
[ 60, 3, 0, "flex"], [ 33, 110, -90, "rd_xtal", HC49, "4MHz" ],
[ 50, 15, -90, "flat_flex"], [ 28, 110, -90, "rd_xtal", HC49_4H, "10MHz" ],
[ 40, 15, -90, "flat_flex", true], [ 28, 103, -90, "rd_xtal", C_002RX, "60KHz", 2 ],
[ 50, 50, 0, "molex_hdr", 2], [ 30, 130,-90, "rd_xtal", ACT1100, "40MHz", 0.5 ],
[ 50, 60, 0, "jst_xh", 2], [ 30, 150,-90, "rd_xtal", ACT1700, "80MHz", 0.5 ],
[ 50, 70, 180, "term254", 3],
[ 63, 70, 180, "term254", 3, undef, grey(20)], [ 77, 15, -90, "flex"],
[ 75, 70, 180, "gterm508",2, undef, "blue"], [ 95, 15, -90, "flat_flex"],
[ 87, 15, -90, "flat_flex", true],
[ 47, 55, 0, "molex_hdr", 2],
[ 51, 48, 0, "molex_hdr", 2, 1],
[ 51, 41, 0, "molex_hdr", 2, -1],
[ 45, 65, 0, "jst_xh", 2],
[ 54, 65, 0, "jst_ph", 2],
[ 61, 65, 0, "jst_zh", 2],
[ 50, 75, 180, "term254", 3],
[ 63, 75, 180, "term254", 3, undef, grey(20)],
[ 75, 75, 180, "gterm508",2, undef, "blue"],
[ 50, 90, 180, "gterm35", 4, [1,2]], [ 50, 90, 180, "gterm35", 4, [1,2]],
[ 63, 90, 180, "gterm35", 4, [1,2], "red"], [ 63, 90, 180, "gterm35", 4, [1,2], "red"],
@@ -146,7 +176,8 @@ test_pcb = ["test_pcb", "Test PCB",
[ 80, 180, 0, "pdip", 8, "NE555" ], [ 80, 180, 0, "pdip", 8, "NE555" ],
[ 71, 180, 0, "smd_inductor", IND2525, "4R7"], [ 71, 180, 0, "smd_inductor", IND2525, "4R7"],
[ 80, 166, -90, "smd_soic", SOIC18, "PIC18F88"], [ 87, 166, -90, "smd_soic", SOIC18, "PIC18F88"],
[ 78, 166, -90, "smd_soic", SOIC14, "74HC00"],
[ 71, 166, -90, "smd_soic", SOIC16, "ICL323"], [ 71, 166, -90, "smd_soic", SOIC16, "ICL323"],
[ 64, 166, -90, "smd_soic", SOIC8, "M34063"], [ 64, 166, -90, "smd_soic", SOIC8, "M34063"],
[ 80, 150, 0, "chip", 10, 5, 1, grey(20)], [ 80, 150, 0, "chip", 10, 5, 1, grey(20)],
@@ -157,7 +188,7 @@ test_pcb = ["test_pcb", "Test PCB",
[ 50, 240, 0, "potentiometer"], [ 50, 240, 0, "potentiometer"],
[ 75, 240, 0, "potentiometer", KY_040_encoder, 8], [ 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], [ 30, 55, -90, "D_plug", DCONN9],
], ],
// accessories // accessories
[] []

View File

@@ -39,6 +39,12 @@ module pcbs() {
translate([0, -pcb_width(perfboards[$i]) / 2]) translate([0, -pcb_width(perfboards[$i]) / 2])
pcb_assembly(perfboards[$i], 5 + $i, 3); pcb_assembly(perfboards[$i], 5 + $i, 3);
translate([0, 125])
layout([for(p = big_pcbs) spacing(p)], 0)
translate([0, pcb_length(big_pcbs[$i]) / 2])
rotate(90)
pcb_assembly(big_pcbs[$i], 5 + $i, 3);
for(p = pcbs_not_shown) for(p = pcbs_not_shown)
hidden() hidden()
pcb(p); pcb(p);

View File

@@ -23,7 +23,7 @@ include <../vitamins/smds.scad>
module smds() { module smds() {
layout([for(r = smd_resistors) smd_res_size(r).x], 1) layout([for(r = smd_resistors) smd_res_size(r).x], 1)
smd_resistor(smd_resistors[$i], ["1R0", "10M", "100K"][$i % 3]); smd_resistor(smd_resistors[$i], ["1R0", "10", "100", "10M", "100K", "10u"][$i % 6]);
translate([0, 3]) translate([0, 3])
layout([for(l = smd_leds) smd_led_size(l).x], 1) layout([for(l = smd_leds) smd_led_size(l).x], 1)
@@ -35,29 +35,44 @@ module smds() {
smd_capacitor(c, smd_cap_size(c).y * 0.8); smd_capacitor(c, smd_cap_size(c).y * 0.8);
translate([0, 9]) translate([0, 9])
layout([for(d = smd_diodes) smd_diode_size(d).x], 1) layout([for(t = smd_tants) smd_tant_leads(t).x], 1)
let(t = smd_tants[$i])
smd_tant(t, ["105e","106J", "107A"][$i]);
translate([0, 12.5])
layout([for(d = smd_diodes) smd_diode_leads(d).x], 1)
let(d = smd_diodes[$i]) let(d = smd_diodes[$i])
smd_diode(d, ["SS34"][$i]); smd_diode(d, ["SS34"][$i]);
translate([0, 15]) translate([0, 24])
layout([for(s = smd_sots) smd_sot_size(s).x], 1) layout([for(s = smd_sots) smd_sot_size(s).x], 1)
let(s = smd_sots[$i]) let(s = smd_sots[$i])
smd_sot(s, ["2N7000", "FZT851"][$i]); smd_sot(s, ["2N7000", "FZT851"][$i]);
translate([0, 21]) translate([0, 18])
layout([for(p = smd_pots) smd_pot_size(p).x], 1) layout([for(p = smd_pots) smd_pot_size(p).x], 1)
let(p = smd_pots[$i]) let(p = smd_pots[$i])
smd_pot(p, "10K"); smd_pot(p, "10K");
translate([0, 28]) translate([6, 18])
layout([for(c = smd_coaxs) smd_coax_base_size(c).x], 1)
let(c = smd_coaxs[$i])
smd_coax(c);
translate([0, 31])
layout([for(s = smd_soics) smd_soic_size(s).x], 1) layout([for(s = smd_soics) smd_soic_size(s).x], 1)
let(s = smd_soics[$i]) let(s = smd_soics[$i])
smd_soic(s, s[0]); smd_soic(s, s[0]);
translate([0, 36]) translate([0, 39])
layout([for(i = smd_inductors) smd_inductor_size(i).x], 1) layout([for(i = smd_inductors) smd_inductor_leads(i).x], 1)
let(i = smd_inductors[$i]) let(i = smd_inductors[$i])
smd_inductor(i, "4R7"); smd_inductor(i, "4R7");
translate([20, 6])
layout([for(q = smd_qfps) smd_qfp_body_size(q).x], 3)
let(q = smd_qfps[$i])
smd_qfp(q, ["ATSAM4S4BA"][$i]);
} }
if($preview) if($preview)

View File

@@ -28,6 +28,10 @@ module axials() {
rotate(90) rotate(90)
wire_link(0.8, inch(0.4)); wire_link(0.8, inch(0.4));
pcb_grid(pcb, 1, 1.5)
rotate(90)
wire_link(0.8, inch(0.3), 0.75, sleeve = [1.5, "red"]);
pcb_grid(pcb, 0, 7) pcb_grid(pcb, 0, 7)
wire_link(0.8, 0, 5); wire_link(0.8, 0, 5);

View File

@@ -26,8 +26,9 @@ include <../vitamins/cameras.scad>
use <../vitamins/pcb.scad> use <../vitamins/pcb.scad>
module camera_housings() module camera_housings()
layout([for(c = cameras) pcb_length(camera_pcb(c))], 15, false) let(c = cameras[$i]) layout([for(c = cameras) pcb_length(camera_pcb(c))], 10, false) let(c = cameras[$i])
camera_fastened_assembly(c, 3); if(pcb_screw(camera_pcb(c)))
camera_fastened_assembly(c, 3);
if($preview) if($preview)
camera_housings(); camera_housings();

View File

@@ -24,9 +24,10 @@ use <../vitamins/pcb.scad>
module displays() module displays()
layout([for(d = displays) pcb_length(display_pcb(d))], 10) layout([for(d = displays) pcb_length(display_pcb(d))], 10)
translate([0, pcb_width(displays[$i]) / 2]) let(d = displays[$i], offset = display_pcb_offset(d))
vflip() translate([-offset.x, pcb_width(display_pcb(d)) / 2 - offset.y])
display(displays[$i]); vflip()
display(d);
if($preview) if($preview)
let($show_threads = true) let($show_threads = true)

35
tests/fastons.scad Normal file
View File

@@ -0,0 +1,35 @@
//
// NopSCADlib Copyright Chris Palmer 2023
// 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 <../utils/core/core.scad>
include <../vitamins/fastons.scad>
module fastons()
for(i = [0, len(fastons) - 1])
translate([i * 20, 0])
let(f = fastons[i]) {
rotate(180)
faston(f);
translate([10, 0])
rotate(180)
faston(f, true);
}
fastons();

View File

@@ -0,0 +1,28 @@
//
// NopSCADlib Copyright Chris Palmer 2023
// 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 <../utils/core/core.scad>
include <../vitamins/photo_interrupters.scad>
use <../utils/layout.scad>
module photo_interrupters()
layout([for(l = photo_interrupters) pi_base_length(l)], 5, true)
photo_interrupter(photo_interrupters[$i]);
photo_interrupters();

View File

@@ -45,9 +45,15 @@ module pin_headers() {
translate([0, 50]) translate([0, 50])
box_header(pin_headers[$i], 8, 1); box_header(pin_headers[$i], 8, 1);
translate([40, 40])
box_header(pin_headers[$i], 8, 1, right_angle = true);
translate([0, 60]) translate([0, 60])
box_header(pin_headers[$i], 10, 2); box_header(pin_headers[$i], 10, 2);
translate([40, 60])
box_header(pin_headers[$i], 10, 2, right_angle = true);
translate([0, 70]) translate([0, 70])
pin_socket(pin_headers[$i], 8, 1); pin_socket(pin_headers[$i], 8, 1);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 KiB

After

Width:  |  Height:  |  Size: 276 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 119 KiB

BIN
tests/png/fastons.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 103 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: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 KiB

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

After

Width:  |  Height:  |  Size: 258 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

After

Width:  |  Height:  |  Size: 168 KiB

BIN
tests/png/radials.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 KiB

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 KiB

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 KiB

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 KiB

After

Width:  |  Height:  |  Size: 171 KiB

32
tests/radials.scad Normal file
View File

@@ -0,0 +1,32 @@
//
// NopSCADlib Copyright Chris Palmer 2023
// 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>
include <../vitamins/pcbs.scad>
module radials() {
pcb = PERF60x40;
pcb(pcb);
for(i = [0 : len(rd_xtals) - 1])
pcb_grid(pcb, [0.5, 1, 1.5, 9, 1][i], [0, 2, 6.5, 6.5, 11][i])
rd_xtal(rd_xtals[i], value = rd_xtals[i][0], z = 1.5, pitch = [inch(0.1), inch(0.2), [inch(0.3), inch(0.3)], [inch(0.6), inch(0.3)], inch(0.2)][i]);
}
if($preview)
radials();

View File

@@ -27,6 +27,9 @@ module rounded_cylinders() {
translate([30, 10]) translate([30, 10])
rounded_cylinder(10, 20, 3, 5, 270); rounded_cylinder(10, 20, 3, 5, 270);
translate([65, 10])
rounded_top_rectangle([30, 20, 5], 3, 2);
} }
rounded_cylinders(); rounded_cylinders();

View File

@@ -56,7 +56,7 @@ module screws() {
screw(screw, length); screw(screw, length);
} }
} }
translate([20, 40, -15]) translate([20, 60, -15])
polysink_stl(); polysink_stl();
} }

View File

@@ -22,7 +22,7 @@ use <../utils/layout.scad>
include <../vitamins/tubings.scad> include <../vitamins/tubings.scad>
module tubings() module tubings()
layout([for(t = tubings) tubing_od(t)], 8) layout([for(t = tubings) tubing_od(t)], 5)
tubing(tubings[$i]); tubing(tubings[$i]);
if($preview) if($preview)

View File

@@ -36,11 +36,11 @@ z_vb = ["z_vb", "z_bed_terminal", 5, z_cable_ways / 2 + 12, inch(0.1), false, M3
module veroboard_test() translate([vero_length(z_vb) / 2, vero_width(z_vb) / 2]) { module veroboard_test() translate([vero_length(z_vb) / 2, vero_width(z_vb) / 2]) {
vflip() vflip()
veroboard_assembly(z_vb, 12, 3); veroboard_assembly(z_vb);
translate([30, 0]) translate([30, 0])
rotate(180) rotate(180)
veroboard_assembly(z_vb, 12, 3); veroboard_fastened_assembly(z_vb, 12, 3);
} }
if($preview) if($preview)

View File

@@ -118,24 +118,24 @@ module position_children(list, t) //! Position children if they are on the Z = 0
// Matrix inversion: https://www.mathsisfun.com/algebra/matrix-inverse-row-operations-gauss-jordan.html // Matrix inversion: https://www.mathsisfun.com/algebra/matrix-inverse-row-operations-gauss-jordan.html
function augment(m) = let(l = len(m), n = identity(l)) [ //! Augment a matrix by adding an identity matrix to the right function augment(m) = let(l = len(m), n = identity(l)) [ // Augment a matrix by adding an identity matrix to the right
for(i = [0 : l - 1]) for(i = [0 : l - 1])
concat(m[i], n[i]) concat(m[i], n[i])
]; ];
function rowswap(m, i, j) = [ //! Swap two rows of a matrix function rowswap(m, i, j) = [ // Swap two rows of a matrix
for(k = [0 : len(m) - 1]) for(k = [0 : len(m) - 1])
k == i ? m[j] : k == j ? m[i] : m[k] k == i ? m[j] : k == j ? m[i] : m[k]
]; ];
function solve_row(m, i) = let(diag = m[i][i]) [ //! Make diagonal one by dividing the row by it and subtract from other rows to make column zero function solve_row(m, i) = let(diag = m[i][i]) [ // Make diagonal one by dividing the row by it and subtract from other rows to make column zero
for(j = [0 : len(m) - 1]) for(j = [0 : len(m) - 1])
i == j ? m[j] / diag : m[j] - m[i] * m[j][i] / diag i == j ? m[j] / diag : m[j] - m[i] * m[j][i] / diag
]; ];
function nearly_zero(x) = abs(x) < 1e-5; //! True if x is close to zero function nearly_zero(x) = abs(x) < 1e-5; //! True if x is close to zero
function solve(m, i = 0, j = 0) = //! Solve each row ensuring diagonal is not zero function solve(m, i = 0, j = 0) = // Solve each row ensuring diagonal is not zero
i < len(m) ? i < len(m) ?
assert(i + j < len(m), "matrix is singular") assert(i + j < len(m), "matrix is singular")
solve(!nearly_zero(m[i + j][i]) ? solve_row(j ? rowswap(m, i, i + j) : m, i) : solve(m, i, j + 1), i + 1) solve(!nearly_zero(m[i + j][i]) ? solve_row(j ? rowswap(m, i, i + j) : m, i) : solve(m, i, j + 1), i + 1)

View File

@@ -45,3 +45,22 @@ module rounded_cylinder(r, h, r2, ir = 0, angle = 360) //! Rounded cylinder give
rotate_extrude(angle = angle) rotate_extrude(angle = angle)
rounded_corner(r, h, r2, ir); rounded_corner(r, h, r2, ir);
} }
module rounded_top_rectangle(size, r, r2) { //! Make a rounded rectangle with a rounded top edge
hull() {
translate([size.x / 2 - r, size.y / 2 - r])
rounded_cylinder(r = r, h = size.z, r2 = r2, angle = 90);
translate([-size.x / 2 + r, size.y / 2 - r])
rotate(90)
rounded_cylinder(r = r, h = size.z, r2 = r2, angle = 90);
translate([-size.x / 2 + r, -size.y / 2 + r])
rotate(180)
rounded_cylinder(r = r, h = size.z, r2 = r2, angle = 90);
translate([size.x / 2 - r, -size.y / 2 + r])
rotate(270)
rounded_cylinder(r = r, h = size.z, r2 = r2, angle = 90);
}
}

View File

@@ -23,8 +23,9 @@
include <../utils/core/core.scad> include <../utils/core/core.scad>
include <../utils/round.scad> include <../utils/round.scad>
module wire_link(d, l, h = 1, tail = 3) { //! Draw a wire jumper link. If `l` is zero then a vertical wire is drawn. module wire_link(d, l, h = 1, tail = 3, sleeve = false) { //! Draw a wire jumper link. `sleeve` can be a list with the diameter and colour. If `l` is zero then a vertical wire is drawn.
vitamin(str("wire_link(", d, ", ", l, arg(h, 1, "h"), arg(tail, 3, "tail"), "): Wire link ", d, "mm x ", l ? str(l / inch(1), "\"") : str(h + tail,"mm"))); vitamin(str("wire_link(", d, ", ", l, arg(h, 1, "h"), arg(tail, 3, "tail"), arg(sleeve, false, "sleeve"),
"): Wire link ", d, "mm x ", l ? str(l / inch(1), "\"") : str(h + tail,"mm"), sleeve ? str(" with ", sleeve[1], " sleeving") : ""));
r = d; r = d;
$fn = 32; $fn = 32;
@@ -48,6 +49,12 @@ module wire_link(d, l, h = 1, tail = 3) { //! Draw a wire jumper link. If `l` is
else else
translate_z(-tail) translate_z(-tail)
cylinder(d = d, h = tail + h); cylinder(d = d, h = tail + h);
if(sleeve)
color(sleeve[1])
translate_z(h)
rotate([0, 90, 0])
cylinder(d = sleeve[0], h = l - 2 * r, center = true);
} }
function ax_res_wattage(type) = type[1]; //! Power rating function ax_res_wattage(type) = type[1]; //! Power rating

View File

@@ -91,7 +91,7 @@ module camera(type, show_lens = true, fov_distance = 0, fov = undef) {
color("orange") color("orange")
hull() { hull() {
translate_z(flex.y /2) translate_z(flex.y /2)
translate(camera_lens_offset(type) + [0, camera_lens(type)[0][0].y / 2]) translate(camera_lens_offset(type) + [0, sign(pos.y) * camera_lens(type)[0][0].y / 2, 0])
cube([flex.x, eps, flex.y], center = true); cube([flex.x, eps, flex.y], center = true);
translate_z(conn.z - flex.y) translate_z(conn.z - flex.y)

View File

@@ -70,6 +70,92 @@ rpi_camera = ["rpi_camera", "Raspberry Pi focusable camera", rpi_camera_pcb, [0,
[0, 18 - 1.5 - 2.5], [8, 5, 1.6] [0, 18 - 1.5 - 2.5], [8, 5, 1.6]
]; ];
cameras = [rpi_camera_v1, rpi_camera_v2, rpi_camera]; esp32_cam_x = 1; // Seems to vary as mine is offset but pictures on the web show it more centered.
ESP32_module = ["", "", 18, 26, 0.8, 0, 0.7, [1.1, 1.1, 0, gold], grey(18), false, [
for(x = [0,1], y = [0:13]) [x * 18, y * 1.27 + 1.4], // Hole positions on the edge
for(x = [0:9]) [18 / 2 + (x - 4.5) * 1.27, 0],
],
[
[18 / 2, 9.7 - 3.4 / 2 , 0, "block", 15.75, 17.6 - 3.4, 2.2, silver, false, 0.3, 0.3], // can
[18 / 2 - 2.65, 9.7 , 0, "block", 10.4, 17.6, 2.2, silver, false, 0.3, 0.3], // can
[12.7, -6.5, 45, "smd_res", RES0502],
[15.15, -8.3, -90, "smd_coax", U_FL_R_SMT_1],
// Antenna
let(x = [0.9, 3.2, 5.7, 8.1, 10.6, 12.8, 15, 15.2])
each [
for(i = [0, 5,6,7]) [x[i], -2.8, 0, "block", 0.6, 4.8, 0.2, gold], // long verticals
for(i = [1: 4]) [x[i], -2.05, 0, "block", 0.6, 3.3, 0.2, gold], // short verticals
for(i = [0, 2, 4,5])[(x[i] + x[i + 1]) / 2, -0.7, 0, "block", x[i + 1] - x[i], 0.6, 0.2, gold], // top horizontals
for(i = [1, 3]) [(x[i] + x[i + 1]) / 2, -3.4, 0, "block", x[i + 1] - x[i], 0.6, 0.2, gold], // lower horizontals
]
],
];
ESP32_CAM_pcb = ["", "", 27, 40, 1.7, 2.5, 0, 0, grey(15), false, [],
[
[27 / 2, 26 / 2, 0, "-pcb", 0, ESP32_module],
for(side = [-1, 1]) [side * inch(0.45) + 27 / 2, -(4.2 + inch(.35)), 0, "-2p54header", 1, 8],
[ 27 / 2, -8, 90, "uSD", [14.85, 14.65, 1.8]],
[ 27 / 2 + 1, 15, 0, "flat_flex", false],
[ 27 / 2 + inch(0.45), 10.5, 0, "block", 3, 3, 0.8, grey(90)],
[ 27 / 2 + inch(0.45), 10.5, 0, "block", 2.9, 2.9, 0.81, "yellow", true, 2.9 / 2 - eps],
[ 27 / 2, 3, 0, "text", 15, 2, "ESP32-CAM", "Liberation Sans:style=Bold"],
[0.5, -(4.7 + inch(.35)), 90, "text", inch(0.75), 0.9, "IO4 IO2 IO14 IO15 IO13 IO12 GND 5V", "Liberation Sans:style=Bold"],
[26.5, -(4.6 + inch(.35)), -90, "text", inch(0.77), 0.9, "3V3 1O16 IO0 GND VCC U0R U0T GND", "Liberation Sans:style=Bold"],
[5.5, -3.3, 90, "-chip", 4, 3, 1.6, silver], // Mock button surround
[5.5, -3.3, 90, "-chip", 1.8,0, 2.0, grey(20)], // Mock button
[10, -10.8, 0, "-smd_led", LED0603, "red"],
[-6.5, -5, 0, "-smd_soic", SOIC8],
[12.2, -4.5, 180, "-smd_sot", SOT223, "AMS1117"],
[25.3, 14, 0, "smd_sot", SOT23],
[3.0, 14, 0, "smd_sot", SOT23],
[8, 20, 90, "smd_sot", SOT23],
[16, 20, 90, "smd_sot", SOT23],
[3.0, 11.5,0, "smd_res", RES0502],
[2.9, 10.3,0, "smd_res", RES0502],
[5.4, 20, 90, "smd_cap", CAP0603, 0.5],
[11.5, 20, 90, "smd_cap", CAP0603, 0.5],
[18.7, 20, 90, "smd_cap", CAP0603, 0.5],
[19.9, 20, 90, "smd_cap", CAP0402, 0.3],
for(i = [0, 1, 2, 4]) [7.6 + i * 1.09, 8.8, 90, "smd_res", RES0502],
for(i = [0 : 3]) [-4.8, 20 + i * 1.09, 0, "smd_res", RES0502],
for(i = [3, 5, 8]) [7.6 + i * 1.09, 8.8, 90, "smd_cap", CAP0502, 0.5],
[-8.1, 23, 90, "smd_res", RES0502],
[-9.2, 23, 90, "smd_res", RES0502],
[-6.3, 23.3, 180, "text", 0.8, 0.7, "5V", "Liberation Sans:style=Bold"],
[-6.5, 22.2, 180, "text", 1.2, 0.7, "3V3", "Liberation Sans:style=Bold"],
[8, -3.3, 90, "-smd_cap", CAP0603, 0.5],
[2, -2, 0, "-text", 2.3, 1, "RST", "Liberation Sans:style=Bold"],
[10,-9.4, 0, "-text", 3.1, 1, "LED1", "Liberation Sans:style=Bold"],
[12.4, -10.8, 0, "-smd_res", RES0502],
[13.7, -9.4, 0, "-smd_cap", CAP0603, 0.5],
[17.2,-9.4, 0, "-smd_cap", CAP0502, 0.4],
[22.1, -10.8, 0, "-smd_res", RES0502],
[16.9, -4.8, 90, "-smd_res", RES0502],
[2.2, 9.0, 90, "-smd_cap", CAP0502, 0.4],
[2.2, 11.6, 90, "-smd_cap", CAP0502, 0.4],
[2.2, 14.2, 90, "-smd_res", RES0502],
[5.9, -9.4, 90, "-smd_tant", TANT_B, "107A"],
],
[],
[(27 - inch(0.9)) / 2, 40 - 4.2 - inch(0.7), 2, 8, silver, inch(0.9), inch(0.1)], // 8x2 grid of holes
];
ESP32_CAM = ["ESP32_CAM", "ESP32-CAM Camera module", ESP32_CAM_pcb, [esp32_cam_x, pcb_width(ESP32_CAM_pcb) / 2 - 12, 1.8],
[
[[8, 8, 2.4], 0],
[[0, 0, 4.2], 4],
[[0, 0, 6.3], 3.5, [1, 1, 0.5]],
],
[1, -4], [15, 2.2, 1],
[54, 41] // FOV
];
cameras = [rpi_camera_v1, rpi_camera_v2, rpi_camera, ESP32_CAM];
use <camera.scad> use <camera.scad>

View File

@@ -41,7 +41,7 @@ function resistor_sleeved(type) = type[9]; //! Are the leads sleeved
splay_angle = 2; // radial lead splay angle splay_angle = 2; // radial lead splay angle
module resistor(type) { //! Draw specified type of resitor module resistor(type) { //! Draw specified type of resistor
length = resistor_length(type); length = resistor_length(type);
dia = resistor_diameter(type); dia = resistor_diameter(type);
@@ -190,10 +190,7 @@ module al_clad_resistor(type, value, leads = true) { //! Draw an aluminium clad
cylinder(r = leads ? 3 : height / 2 - 2, h = length + eps, center = true); cylinder(r = leads ? 3 : height / 2 - 2, h = length + eps, center = true);
} }
module al_clad_resistor_assembly(type, value, sleeved = true) { //* Draw aluminium clad resistor with optional sleaving, positions children at the screw positions module al_clad_resistor_assembly(type, value, sleeved = true, sleeving = HSHRNK32, sleeving_length = 15) { //! Draw aluminium clad resistor with optional sleaving, positions children at the screw positions
sleeving_length = 15;
sleeving = HSHRNK32;
al_clad_resistor(type, value); al_clad_resistor(type, value);
if(sleeved) if(sleeved)
@@ -207,52 +204,55 @@ module al_clad_resistor_assembly(type, value, sleeved = true) { //* Draw alumini
children(); children();
} }
TO220_hole_y = 2.9; // Distance to hole from top of tab
function TO220_size() = [10.2, 15, 4.4]; //! Size of a TO220
function TO220_thickness() = 1.5; //! Thickness of the tab of a TO220 function TO220_thickness() = 1.5; //! Thickness of the tab of a TO220
function TO220_lead_pos(i, l) = //! Position of ith lead end when length = l
[i * inch(0.1), -TO220_size().y + TO220_hole_y - l, 1.9];
module TO220(description, leads = 3, lead_length = 16) { //! Draw a TO220 package, use `description` to describe what it is module TO220(description, leads = 3, lead_length = 16) { //! Draw a TO220 package, use `description` to describe what it is
width = 10.2; s = TO220_size();
inset = 1.5; inset = 1.5;
hole = 3.3; hole = 3.3;
length = 15;
height = 4.4;
lead_height = 1.9;
lead_t = 0.4; lead_t = 0.4;
lead_w = 0.7; lead_w = 0.7;
lead_w2 = 1.4; lead_w2 = 1.4;
lead_l = 4.2; lead_l = 4.2;
body = 8; body = 8;
hole_y = 2.9;
vitamin(str("TO220(\"", description, "\"", arg(leads, 3, "leads"), "): ", description)); vitamin(str("TO220(\"", description, "\"", arg(leads, 3, "leads"), "): ", description));
translate([0, -length + hole_y]) { translate([0, -s.y + TO220_hole_y]) {
color("silver") { color("silver")
linear_extrude(TO220_thickness()) linear_extrude(TO220_thickness())
difference() { difference() {
translate([-width / 2, inset]) translate([-s.x / 2, inset])
square([width, length - inset]); square([s.x, s.y - inset]);
translate([0, length - hole_y]) translate([0, s.y - TO220_hole_y])
circle(d = hole); circle(d = hole);
for(side = [-1, 1]) for(side = [-1, 1])
translate([side * width / 2, 0]) translate([side * s.x / 2, 0])
square([inset * 2, body * 2], center = true); square([inset * 2, body * 2], center = true);
} }
for(i = [-1 : 1])
if(i || leads == 3) {
translate([inch(0.1) * i, -lead_length / 2, lead_height])
cube([lead_w, lead_length, lead_t], center = true);
translate([inch(0.1) * i, -lead_l / 2, lead_height])
cube([lead_w2, lead_l, lead_t], center = true);
}
}
color("dimgrey") color("dimgrey")
translate([-width / 2, 0, eps]) translate([-s.x / 2, 0, eps])
cube([width, body, height]); cube([s.x, body, s.z]);
} }
color(silver)
for(i = [-1 : 1])
if(i || leads == 3) {
translate(TO220_lead_pos(i, lead_length / 2))
cube([lead_w, lead_length, lead_t], center = true);
translate(TO220_lead_pos(i, lead_l / 2))
cube([lead_w2, lead_l, lead_t], center = true);
}
translate_z(TO220_thickness()) translate_z(TO220_thickness())
children(); children();
} }

219
vitamins/faston.scad Normal file
View File

@@ -0,0 +1,219 @@
//
// NopSCADlib Copyright Chris Palmer 2023
// 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/>.
//
//
//! Faston receptacles to mate with spade connectors
//
include <../utils/core/core.scad>
include <../utils/sector.scad>
function faston_width(type) = type[1]; //! Width of matching spade
function faston_size(type) = type[2]; //! Size of the receptical part
function faston_d_top(type) = type[3]; //! Radius of the clips
function faston_d_bot(type) = type[4]; //! Radius of bottom corners
function faston_t(type) = type[5]; //! Thickness
function faston_wire_crimp_l(type) = type[6]; //! Length of the wire crimp
function faston_wire_crimp_d(type) = type[7]; //! Outside diameter of the wire crimp
function faston_wire_crimp_p(type) = type[8]; //! Position of the tip of the wire crimp
function faston_fillet_d(type) = type[9]; //! Fillets at the transition
function faston_wall_h(type) = type[10]; //! Height of transition web wall
function faston_insul_crimp_l(type) = type[11]; //! Length of the insulation crimp
function faston_insul_crimp_d(type) = type[12]; //! Outside diameter of the insulation crimp
function faston_insul_crimp_p(type) = type[13]; //! Position of the tip of the insulation crimp
function faston_insul_crimp_o(type) = type[14]; //! Offset of insulation crimp
function faston_length(type) = //! Total length of crimp
faston_insul_crimp_p(type).z + faston_insul_crimp_l(type);
function faston_insul_stop(type) = //! Position where insulation stops
faston_wire_crimp_p(type).z + faston_wire_crimp_l(type);
module faston(type, closed = false) { //! Draw specified faston
vitamin(str("faston(", type[0], "): Faston part no ", type[0], " to fit ", faston_width(type), "mm spade"));
s = faston_size(type);
r_top = faston_d_top(type) / 2;
r_bot = faston_d_bot(type) / 2;
t = faston_t(type);
wc_l = faston_wire_crimp_l(type);
wc_r = faston_wire_crimp_d(type) / 2;
wc_p = faston_wire_crimp_p(type);
fillet_r = faston_fillet_d(type) / 2;
wall_h = faston_wall_h(type);
ic_l = faston_insul_crimp_l(type);
ic_r = faston_insul_crimp_d(type) / 2;
ic_p = faston_insul_crimp_p(type);
ic_o = faston_insul_crimp_o(type);
$fn = 64;
// Receptical
module reciptical_shape()
for(side = [-1, 1]) mirror([side < 0 ? 1 : 0, 0]) {
translate([s.x / 2 - r_top, s.y - r_top])
difference() {
sector(r_top, 0, 180);
sector(r_top - t, 0, 180);
}
translate([s.x / 2 - r_bot, r_bot])
difference() {
sector(r_bot, -90, 0);
sector(r_bot - t, -90, 0);
}
translate([s.x / 2 - t, r_bot])
square([t, s.y - r_top - r_bot]);
square([s.x / 2 - r_bot, t]);
}
module crimp_shape(p, r, offset = 0) {
hpot = norm([p.x, p.y] - [0, r + offset]);
opp = sqrt(sqr(hpot) - sqr(r));
angle = atan((p.y - (r + offset)) / p.x) - acos(r / hpot);
r_crimp = r / 2 - eps;
lift = -0.1;
z = (opp - r * 2 * PI / -angle / 360 - PI * r_crimp) / 2 + lift / 2;
for(side = [-1, 1]) mirror([side < 0 ? 1 : 0, 0])
translate([0, r + offset]) {
difference() {
sector(r, 270, 360 + (closed ? 0 : angle));
circle(r - t);
}
if(!closed)
rotate(angle)
translate([r - t, -eps])
square([t, opp]);
else {
translate([r - r_crimp, z])
difference() {
sector(r_crimp, 0, 180);
circle(r_crimp - t);
}
translate([r - t, 0])
square([t, z]);
translate([r - 2 * r_crimp, lift])
square([t, z - lift]);
}
}
}
// Wire crimp
module wire_crimp_shape() crimp_shape(wc_p, wc_r);
// Insulation crimp
module insul_crimp_shape() crimp_shape(ic_p, ic_r, ic_o);
module crop(z = 0)
intersection() {
children();
square([s.x, 2 * (wall_h + fillet_r + z)], center = true);
}
color(silver) translate([0, -t]) {
// Transition from reciptical to wire crimp
render() difference() {
hull() {
translate_z(s.z)
linear_extrude(eps)
crop()
reciptical_shape();
translate_z(wc_p.z - eps)
linear_extrude(eps)
crop()
wire_crimp_shape();
}
translate([0, s.y, (s.z + wc_p.z) / 2])
rotate([0, 90, 0])
rounded_rectangle([wc_p.z - s.z, 2 * (s.y - wall_h), s.x + 1], fillet_r, center = true);
hull() {
translate_z(s.z - eps)
linear_extrude(eps)
offset(-t)
crop(t)
hull()
reciptical_shape();
translate_z(wc_p.z + eps / 8)
linear_extrude(eps / 8)
offset(-t)
crop(t)
hull()
wire_crimp_shape();
}
}
// Transition from wire crimp to insulation crimp
render() difference() {
hull() {
translate_z(wc_p.z + wc_l)
linear_extrude(eps)
wire_crimp_shape();
translate_z(ic_p.z - eps)
linear_extrude(eps)
insul_crimp_shape();
}
gap = ic_p.z - wc_p.z - wc_l;
d = gap * 2 / 3;
translate([0, wall_h + fillet_r - gap / 2, ic_p.z - d / 2])
hull() {
rotate([0, 90, 0])
cylinder(d = d, h = 10, center = true);
translate([-5, d / 2, d / 2 - gap])
cube([10, 10, gap]);
}
hull() {
translate_z(wc_p.z + wc_l - eps)
linear_extrude(eps)
offset(-t)
hull()
wire_crimp_shape();
translate_z(ic_p.z + eps / 8)
linear_extrude(eps / 8)
offset(-t)
hull()
insul_crimp_shape();
}
}
linear_extrude(s.z)
reciptical_shape();
translate_z(wc_p.z)
linear_extrude(wc_l)
wire_crimp_shape();
translate_z(ic_p.z)
linear_extrude(ic_l)
insul_crimp_shape();
}
}

28
vitamins/fastons.scad Normal file
View File

@@ -0,0 +1,28 @@
//
// NopSCADlib Copyright Chris Palmer 2023
// 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/>.
//
//
//! Faston receptacles to mate with spade connectors
//
5_160430_7 = ["5_160430_7", 4.75, [5.6, 2.56, 6.3], 2.25, 1.13, 0.32, 3.2, 1.64, [1.64, 3.09, 9], 0.5, 0.96, 1.7, 3.53, [2.08, 4.47, 13.3], -0.4];
fastons = [5_160430_7];
use <faston.scad>

View File

@@ -18,7 +18,7 @@
// //
// //
//! Nicodrone OpenGrab V3 electro-permanent magnet, see <https://nicadrone.com/products/epm-v3>. //! Nicodrone OpenGrab V3 electro-permanent magnet, see <https://kb.zubax.com/display/MAINKB/OpenGrab+EPM+v3>.
//! //!
//! A permanent magnet that can be magnetized and de-magnetized electronically. //! A permanent magnet that can be magnetized and de-magnetized electronically.
// //
@@ -37,14 +37,13 @@ pole_w = 2;
pole_l = 36; pole_l = 36;
poles = 15; poles = 15;
pcb = ["", "", width, width, 0.8, 0, 3.5, 0, "darkgreen", false, [], pcb = ["", "", width, width, 0.8, 0, 3.5, 0, "darkgreen", false, [],
[ [ 3.45, 19, 0, "button_4p5mm"], [ [ 3.475, 19.05, 0, "button_4p5mm"],
[ 2.75, 24.5, 0, "smd_led", LED0805, "green"], [ 2.2, 24.125, 0, "smd_led", LED0805, "green"],
[ 2.75, 28.0, 0, "smd_led", LED0805, "red"], [ 2.375, 27.9, 0, "smd_led", LED0805, "red"],
[ 28.5, 13, 0, "2p54header", 3, 1, false, undef, true], [ 28.4, 13.345, 0, "2p54header", 3, 1, false, undef, true],
]]; ]];
module opengrab_hole_positions() //! Position children at the screw positions module opengrab_hole_positions() //! Position children at the screw positions
let($d = 3.2) let($d = 3.2)
for($x = [-pitch, pitch], $y = [-pitch, pitch]) for($x = [-pitch, pitch], $y = [-pitch, pitch])
@@ -96,6 +95,17 @@ module opengrab() { //! Draw OpenGrab module
if(show_threads) if(show_threads)
female_metric_thread(3, metric_coarse_pitch(3), depth - 1, center = false, colour = brass); 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 module opengrab_target() { //! Draw OpenGrab target

View File

@@ -37,6 +37,7 @@ use <d_connector.scad>
use <led.scad> use <led.scad>
use <dip.scad> use <dip.scad>
use <axial.scad> use <axial.scad>
use <radial.scad>
use <smd.scad> use <smd.scad>
use <terminal.scad> use <terminal.scad>
include <potentiometers.scad> include <potentiometers.scad>
@@ -61,14 +62,14 @@ function pcb_size(type) = [pcb_length(type), pcb_width(type), pcb_thickness(type
function pcb_component(type, name, index = 0) = //! Return the component specified by name and index function pcb_component(type, name, index = 0) = //! Return the component specified by name and index
[for(component = pcb_components(type)) if(component[3] == name) component][index]; [for(component = pcb_components(type)) if(component[3] == name) component][index];
function pcb_grid_pos(type, x, y, z = 0) = //! Returns a pcb grid position function pcb_grid_pos(type, x, y, z = 0, i = 0) = //! Returns a pcb grid position
let(grid = pcb_grid(type)) let(grid = pcb_grid(type))
[-pcb_size(type).x / 2 + grid.x + x * (is_undef(grid[5]) ? 2.54 : grid[5]), [-pcb_size(type).x / 2 + grid[i] + x * (is_undef(grid[i + 5]) ? 2.54 : grid[i + 5]),
-pcb_size(type).y / 2 + grid.y + y * (is_undef(grid[6]) ? 2.54 : grid[6]), -pcb_size(type).y / 2 + grid[i + 1] + y * (is_undef(grid[i + 6]) ? 2.54 : grid[i + 6]),
pcb_size(type).z + z]; pcb_size(type).z + z];
module pcb_grid(type, x, y, z = 0) //! Positions children at specified grid position module pcb_grid(type, x, y, z = 0, i = 0) //! Positions children at specified grid position
translate(pcb_grid_pos(type, x, y, z)) translate(pcb_grid_pos(type, x, y, z, i))
children(); children();
// allows negative ordinates to represent offsets from the far edge // allows negative ordinates to represent offsets from the far edge
@@ -115,6 +116,14 @@ module usb_A_tongue() {
} }
} }
module usb_vAx1(cutout = false) { //! Draw a vertical USB type A single socket
h = 5.8;
w = 13.8;
translate([0, h / 2, w / 2])
rotate([90, 0, 0])
usb_A(h = h, v_flange_l = 0, bar = 0, cutout = cutout, l = 14, h_flange_l = 0, flange_t = 0.3, w = w);
}
module usb_Ax1(cutout = false) { //! Draw USB type A single socket module usb_Ax1(cutout = false) { //! Draw USB type A single socket
usb_A(h = 6.5, v_flange_l = 4.5, bar = 0, cutout = cutout); usb_A(h = 6.5, v_flange_l = 4.5, bar = 0, cutout = cutout);
} }
@@ -123,12 +132,8 @@ module usb_Ax2(cutout = false) { //! Draw USB type A dual socket
usb_A(h = 15.6, v_flange_l = 12.15, bar = 3.4, cutout = cutout); usb_A(h = 15.6, v_flange_l = 12.15, bar = 3.4, cutout = cutout);
} }
module usb_A(h, v_flange_l, bar, cutout) { module usb_A(h, v_flange_l, bar, cutout, l=17, h_flange_l = 11, flange_t = 0.4, w = 13.25) {
l = 17;
w = 13.25;
flange_t = 0.4;
h_flange_h = 0.8; h_flange_h = 0.8;
h_flange_l = 11;
v_flange_h = 1; v_flange_h = 1;
socket_h = (h - 2 * flange_t - bar) / 2; socket_h = (h - 2 * flange_t - bar) / 2;
@@ -154,9 +159,11 @@ module usb_A(h, v_flange_l, bar, cutout) {
translate_z(l / 2 - flange_t) translate_z(l / 2 - flange_t)
linear_extrude(flange_t) difference() { linear_extrude(flange_t) difference() {
union() { union() {
square([h + 2 * h_flange_h, h_flange_l], center = true); if(h_flange_l)
square([h + 2 * h_flange_h, h_flange_l], center = true);
square([v_flange_l, w + 2 * v_flange_h], center = true); if(v_flange_l)
square([v_flange_l, w + 2 * v_flange_h], center = true);
} }
square([h - eps, w - eps], center = true); square([h - eps, w - eps], center = true);
} }
@@ -164,7 +171,8 @@ module usb_A(h, v_flange_l, bar, cutout) {
for(z = bar ? [-1, 1] : [0]) for(z = bar ? [-1, 1] : [0])
translate_z(z * (bar / 2 + socket_h / 2)) translate_z(z * (bar / 2 + socket_h / 2))
usb_A_tongue(); translate([l - 17, 0])
usb_A_tongue();
} }
} }
@@ -921,12 +929,11 @@ module molex_254_housing(ways) { //! Draw a Molex KK housing
for(side = [-1, 1]) for(side = [-1, 1])
translate([-depth / 2 - tab.x / 2, side * (pitch / 2 - tab.y / 4) * ways, tab.z / 2]) translate([-depth / 2 - tab.x / 2, side * (pitch / 2 - tab.y / 4) * ways, tab.z / 2])
cube(tab, center = true); cube(tab, center = true);
} }
} }
module molex_254(ways, right_angle = 0, skip = undef) { //! Draw molex KK header, set `right_angle` to 1 for normal right angle version or -1 for inverted right angle version. module molex_254(ways, right_angle = 0, skip = undef) { //! Draw molex KK header, set `right_angle` to 1 for normal right angle version or -1 for inverted right angle version.
vitamin(str("molex_254(", ways, "): Molex KK header ", ways, " way")); vitamin(str("molex_254(", ways, arg(right_angle, 0, "right_angle"), arg(skip, undef, "skip"), "): Molex KK header ", ways, " way", right_angle ? " right angle" : ""));
pitch = 2.54; pitch = 2.54;
width = ways * pitch - 0.1; width = ways * pitch - 0.1;
depth = 6.35; depth = 6.35;
@@ -937,7 +944,7 @@ module molex_254(ways, right_angle = 0, skip = undef) { //! Draw molex KK header
above = 9; above = 9;
pin_w = 0.64; pin_w = 0.64;
r = 1; r = 1;
a = right_angle ? width / 2 - r - pin_w / 2 : above; a = right_angle ? depth / 2 - r - pin_w / 2 : above;
ra_offset = 2.2; ra_offset = 2.2;
color("white") color("white")
@@ -966,7 +973,7 @@ module molex_254(ways, right_angle = 0, skip = undef) { //! Draw molex KK header
l = above + ra_offset - r - pin_w / 2; l = above + ra_offset - r - pin_w / 2;
if(right_angle) { if(right_angle) {
translate([-l / 2 - r - pin_w / 2, 0, width / 2]) translate([-l / 2 - r - pin_w / 2, 0, depth / 2])
cube([l, pin_w, pin_w], center = true); cube([l, pin_w, pin_w], center = true);
translate([-r - pin_w / 2, 0, a]) translate([-r - pin_w / 2, 0, a])
@@ -1063,7 +1070,7 @@ module trimpot10(vertical, cutout = false) { //! Draw a ten turn trimpot
} }
} }
module block(size, colour, makes_cutout, cutouts) //! Draw a coloured cube to represent a random PCB component module block(size, colour, makes_cutout, cutouts, r = 0, rtop = 0) //! Draw a coloured cube to represent a random PCB component
if(cutouts) { if(cutouts) {
if(makes_cutout) if(makes_cutout)
translate([-50, 0, size.z / 2 - panel_clearance]) translate([-50, 0, size.z / 2 - panel_clearance])
@@ -1071,8 +1078,10 @@ module block(size, colour, makes_cutout, cutouts) //! Draw a coloured cube to re
} }
else else
color(colour) color(colour)
translate_z(size.z / 2) if(rtop)
cube(size, center = true); let($fn = 32) rounded_top_rectangle(size, r, rtop);
else
rounded_rectangle(size, r);
module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb component from description module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb component from description
function show(comp, part) = (comp[3] == part || comp[3] == str("-",part)) && (!cutouts || angle == undef || angle == comp.z); function show(comp, part) = (comp[3] == part || comp[3] == str("-",part)) && (!cutouts || angle == undef || angle == comp.z);
@@ -1083,11 +1092,13 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
pin_header(2p54header, comp[4], comp[5], param(6, false), param(8, false), cutouts, colour = param(7, undef)); pin_header(2p54header, comp[4], comp[5], param(6, false), param(8, false), cutouts, colour = param(7, undef));
if(show(comp, "2p54joiner")) pin_header(2p54joiner, comp[4], comp[5], param(6, false), param(8, false), cutouts, colour = param(7, undef)); if(show(comp, "2p54joiner")) pin_header(2p54joiner, comp[4], comp[5], param(6, false), param(8, false), cutouts, colour = param(7, undef));
if(show(comp, "2p54boxhdr")) let($show_plugs = show_plugs && param(7, true)) if(show(comp, "2p54boxhdr")) let($show_plugs = show_plugs && param(7, true))
box_header(2p54header, comp[4], comp[5], param(6, false), cutouts); box_header(2p54header, comp[4], comp[5], param(6, false), cutouts, param(8, false));
if(show(comp, "2p54socket")) pin_socket(2p54header, comp[4], comp[5], param(6, false), param(7, 0), param(8, false), cutouts, param(9, undef)); if(show(comp, "2p54socket")) pin_socket(2p54header, comp[4], comp[5], param(6, false), param(7, 0), param(8, false), cutouts, param(9, undef));
if(show(comp, "chip")) chip(comp[4], comp[5], comp[6], param(7, grey(30)), cutouts); if(show(comp, "chip")) chip(comp[4], comp[5], comp[6], param(7, grey(30)), cutouts);
if(show(comp, "rj45")) rj45(cutouts); if(show(comp, "rj45")) rj45(cutouts);
if(show(comp, "usb_A")) usb_Ax1(cutouts); if(show(comp, "usb_A")) usb_Ax1(cutouts);
if(show(comp, "usb_vAx1")) usb_vAx1(cutouts);
if(show(comp, "usb_Ax1")) usb_Ax1(cutouts);
if(show(comp, "usb_Ax2")) usb_Ax2(cutouts); if(show(comp, "usb_Ax2")) usb_Ax2(cutouts);
if(show(comp, "usb_uA")) usb_uA(cutouts); if(show(comp, "usb_uA")) usb_uA(cutouts);
if(show(comp, "usb_miniA")) usb_miniA(cutouts); if(show(comp, "usb_miniA")) usb_miniA(cutouts);
@@ -1106,7 +1117,7 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
if(show(comp, "molex_usb_Ax1")) molex_usb_Ax1(cutouts); if(show(comp, "molex_usb_Ax1")) molex_usb_Ax1(cutouts);
if(show(comp, "smd_led")) smd_led(comp[4], comp[5], cutouts); if(show(comp, "smd_led")) smd_led(comp[4], comp[5], cutouts);
if(show(comp, "7seg")) let(z = param(6, 0)) translate_z(z) 7_segment_digits(comp[4], comp[5], pin_length = z + 3, cutout = cutouts); if(show(comp, "7seg")) let(z = param(6, 0)) translate_z(z) 7_segment_digits(comp[4], comp[5], pin_length = z + 3, cutout = cutouts);
if(show(comp, "block")) block(size = [comp[4], comp[5], comp[6]], colour = comp[7], makes_cutout = param(8)); if(show(comp, "block")) block(size = [comp[4], comp[5], comp[6]], colour = comp[7], makes_cutout = param(8), r = param(9, 0), rtop = param(10, 0));
if(!cutouts) { if(!cutouts) {
// Components that don't have a cutout parameter go in this section // Components that don't have a cutout parameter go in this section
if(show(comp, "button_6mm")) square_button(button_6mm); if(show(comp, "button_6mm")) square_button(button_6mm);
@@ -1124,20 +1135,25 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
if(show(comp, "led")) translate_z(eps) led(comp[4], comp[5], 2.6); if(show(comp, "led")) translate_z(eps) led(comp[4], comp[5], 2.6);
if(show(comp, "pdip")) pdip(comp[4], comp[5], param(6, false), param(7, inch(0.3))); if(show(comp, "pdip")) pdip(comp[4], comp[5], param(6, false), param(7, inch(0.3)));
if(show(comp, "ax_res")) ax_res(comp[4], comp[5], param(6, 5), param(7, 0)); if(show(comp, "ax_res")) ax_res(comp[4], comp[5], param(6, 5), param(7, 0));
if(show(comp, "link")) wire_link(l = comp[4], h = param(5, 1), d = param(6, 0.8), tail = param(7, 3)); if(show(comp, "rd_xtal")) rd_xtal(type = comp[4], value = param(5, undef), z = param(6, 0), pitch = param(7, undef)); // type, value, z, forced pitch
if(show(comp, "link")) wire_link(l = comp[4], h = param(5, 1), d = param(6, 0.8), tail = param(7, 3), sleeve = param(8, false));
if(show(comp, "D_plug")) translate_z(d_pcb_offset(comp[4])) d_plug(comp[4], pcb = true); if(show(comp, "D_plug")) translate_z(d_pcb_offset(comp[4])) d_plug(comp[4], pcb = true);
if(show(comp, "molex_hdr")) molex_254(comp[4], param(5, 0), param(6, undef)); if(show(comp, "molex_hdr")) molex_254(comp[4], param(5, 0), param(6, undef));
if(show(comp, "jst_xh")) jst_xh_header(jst_xh_header, comp[4], param(5, false), param(6, "white"), param(7, undef)); if(show(comp, "jst_xh")) jst_xh_header(jst_xh_header, comp[4], param(5, false), param(6, false), param(7, undef));
if(show(comp, "jst_ph")) jst_xh_header(jst_ph_header, comp[4], param(5, false), param(6, "white"), param(7, undef)); if(show(comp, "jst_ph")) jst_xh_header(jst_ph_header, comp[4], param(5, false), param(6, false), param(7, undef));
if(show(comp, "jst_zh")) jst_xh_header(jst_zh_header, comp[4], param(5, false), param(6, false), param(7, undef));
if(show(comp, "potentiometer")) let(pot = param(4, BTT_encoder)) translate_z(pot_size(pot).z) vflip() potentiometer(pot, shaft_length = param(5, undef)); if(show(comp, "potentiometer")) let(pot = param(4, BTT_encoder)) translate_z(pot_size(pot).z) vflip() potentiometer(pot, shaft_length = param(5, undef));
if(show(comp, "buzzer")) buzzer(param(4, 9), param(5, 12), param(6, grey(20))); if(show(comp, "buzzer")) buzzer(param(4, 9), param(5, 12), param(6, grey(20)));
if(show(comp, "smd_res")) smd_resistor(comp[4], comp[5]); 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_cap")) smd_capacitor(comp[4], comp[5], param(6, undef));
if(show(comp, "smd_tant")) smd_tant(comp[4], param(5, undef));
if(show(comp, "smd_sot")) smd_sot(comp[4], comp[5]); 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_soic")) smd_soic(comp[4], comp[5]);
if(show(comp, "smd_diode")) smd_diode(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_inductor")) smd_inductor(comp[4], comp[5]);
if(show(comp, "smd_pot")) smd_pot(comp[4], comp[5]); if(show(comp, "smd_pot")) smd_pot(comp[4], comp[5]);
if(show(comp, "smd_coax")) smd_coax(comp[4]);
if(show(comp, "smd_qfp")) smd_qfp(comp[4], comp[5]);
if(show(comp, "vero_pin")) vero_pin(param(4, false)); if(show(comp, "vero_pin")) vero_pin(param(4, false));
if(show(comp, "terminal")) terminal_block(comp[5], comp[4]); 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"); 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");
@@ -1197,14 +1213,16 @@ module pcb_cutouts(type, angle = undef) //! Make cut outs to clear components o
module pcb_grid_positions(type) { module pcb_grid_positions(type) {
grid = pcb_grid(type); grid = pcb_grid(type);
x0 = grid.x; for(i = [0 : 7 : len(grid) - 1]) {
y0 = grid.y; x0 = grid[i];
y0 = grid[i + 1];
cols = is_undef(grid[2]) ? round((pcb_length(type) - 2 * x0) / inch(0.1)) : grid[2] - 1; cols = is_undef(grid[i + 2]) ? round((pcb_length(type) - 2 * x0) / inch(0.1)) : grid[i + 2] - 1;
rows = is_undef(grid[3]) ? round((pcb_width(type) - 2 * y0) / inch(0.1)) : grid[3] - 1; rows = is_undef(grid[i + 3]) ? round((pcb_width(type) - 2 * y0) / inch(0.1)) : grid[i + 3] - 1;
for(x = [0 : cols], y = [0 : rows]) for(x = [0 : cols], y = [0 : rows])
pcb_grid(type, x, y) pcb_grid(type, x, y, i = i)
children(); children();
}
} }
module pcb(type) { //! Draw specified PCB module pcb(type) { //! Draw specified PCB

View File

@@ -20,6 +20,7 @@ include <microswitches.scad>
include <d_connectors.scad> include <d_connectors.scad>
include <leds.scad> include <leds.scad>
include <axials.scad> include <axials.scad>
include <radials.scad>
include <smds.scad> include <smds.scad>
include <green_terminals.scad> include <green_terminals.scad>
include <7_segments.scad> include <7_segments.scad>
@@ -537,6 +538,37 @@ Melzi = ["Melzi", "Melzi electronics", 203.2, 49.53, 1.6, 3.81, 3.1, 6, "green"
[], [],
[": USB A to Mini B lead", ": Micro SD card"]]; [": USB A to Mini B lead", ": Micro SD card"]];
OPZ2 = ["OPZ2", "Orange Pi Zero 2", 60, 53, 1.4, 1.75, 3, 5, "blue", false, [[2.5, 2.5], [-2.5, 2.5], [-2.5, -2.5], [2.5, -2.5]],
[[-2.54, 53/2, 90, "2p54header", 13, 2],
[-10, -10-2.54*2, 0, "2p54header", 3, 1],
[2.54/2, 53/2, 90, "2p54header", 13, 1],
[6+16/2, -10.5+1, 90, "rj45"],
[24+9/2, -3.6+1, 90, "usb_C"],
[37+6.5/2, -8.5/2+1, 90, "micro_hdmi"],
[-7-5.8/2, -7+1, 90, "usb_vAx1"],
[-17, 18, 0, "chip", 13, 7.5, 1],
[-17, 28, 0, "chip", 13, 7.5, 1],
[26, 23, 0, "chip", 12.2, 14, 1],
[8.1+10.3/2, 3.7+10.3/2, 0, "chip", 10.3, 10.3, 1.8, "silver"],
[10.7+14.6/2, 14.7/2, 90, "-uSD", [14.6, 14.7, 2]],
],
[": Micro SD card"],
[60-2.54*1.5, 53/2 - 6*2.54, 2, 13]];
RPI3A = ["RPI3A", "Raspberry Pi 3 A+", 65, 56, 1.4, 3, 2.75, 6, "green", false, [[3.5, 3.5], [61.5, 3.5], [61.5, -3.5], [3.5, -3.5]],
[[32.5, -3.5, 0, "2p54header", 20, 2],
[27, -24.6, 0, "chip", 14, 14, 1],
[53.5, 6, -90, "jack"],
[32, 4.4, -90, "hdmi"],
[-6.5, 31.45, 0, "usb_Ax1"],
[10.6, 2, -90, "usb_uA"],
[3.6, 28, 90, "flex"],
[45, 11.5,-90, "flex"],
[7.75, 28, 180, "-uSD", [12, 11.5, 1.28]],
],
[": Micro SD card"],
[32.5 - 9.5 * 2.54, 52.5 - 1.27, 20, 2]];
RPI3 = ["RPI3", "Raspberry Pi 3", 85, 56, 1.4, 3, 2.75, 6, "green", false, [[3.5, 3.5], [61.5, 3.5], [61.5, -3.5], [3.5, -3.5]], RPI3 = ["RPI3", "Raspberry Pi 3", 85, 56, 1.4, 3, 2.75, 6, "green", false, [[3.5, 3.5], [61.5, 3.5], [61.5, -3.5], [3.5, -3.5]],
[[32.5, -3.5, 0, "2p54header", 20, 2], [[32.5, -3.5, 0, "2p54header", 20, 2],
[27, -24.6, 0, "chip", 14, 14, 1], [27, -24.6, 0, "chip", 14, 14, 1],
@@ -627,6 +659,14 @@ ArduinoUno3 = ["ArduinoUno3", "Arduino Uno R3", 68.58, 53.34, 1.6, 0, 3.3, 0, "#
[4.7625, 7.62, 180,"barrel_jack"], [4.7625, 7.62, 180,"barrel_jack"],
[1.5875, 37.78, 180,"usb_B"], [1.5875, 37.78, 180,"usb_B"],
[46.99, 17, 270,"pdip", 28, "ATMEGA328", true], [46.99, 17, 270,"pdip", 28, "ATMEGA328", true],
[18.7, 25.8, 0, "rd_xtal", HC49_4H],
[7.5, 17.2, 90, "smd_sot", SOT223],
[7.9, 26.5, 90, "smd_sot", SOT23],
[21.3, 2.7, 0, "smd_diode", DO214AC],
[27.8, 34.6, 0, "smd_led", LED0805, "red"],
[27.8, 37, 0, "smd_led", LED0805, "red"],
[27.8, 42.3, 0, "smd_led", LED0805, "red"],
[58.8, 37.1, 0, "smd_led", LED0805, "red"],
], ],
[],[], [],[],
inch([ inch([
@@ -745,7 +785,7 @@ WD2002SJ = ["WD2002SJ", "WD2002SJ Buck Boost DC-DC converter", 78, 47, 1.6, 0, 3
[]]; []];
MP1584EN = ["MP1584EN", "MP1584EN 3A buck converter", 22, 17, 1.25, 0, 1, [2, 2], "green", false, 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, 1.75], [-1.75, -1.75], [-1.75, -4.4], [-1.75, 4.4], [1.75, -4.4], [1.75, 4.4]], [[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],
[-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"], [7.5, 8.5, 0, "smd_soic", SOIC8, "WP1584EN"],
@@ -756,12 +796,17 @@ MP1584EN = ["MP1584EN", "MP1584EN 3A buck converter", 22, 17, 1.25, 0, 1, [2, 2]
[6.2, 2.1, 0, "smd_cap", CAP0603, 0.5], [6.2, 2.1, 0, "smd_cap", CAP0603, 0.5],
[9.2, 3.5, 0, "smd_res", RES0603, "104"], [9.2, 3.5, 0, "smd_res", RES0603, "104"],
[9.2, 2.1, 0, "smd_res", RES0603, "104"], [9.2, 2.1, 0, "smd_res", RES0603, "104"],
[6.3, 14.4, 0, "smd_diode",DO241AC, "SS34"], [6.3, 14.4, 0, "smd_diode",DO214AC, "SS34"],
[12.1, 4.9, 0, "smd_cap", CAP0603, 0.5], [12.1, 4.9, 0, "smd_cap", CAP0603, 0.5],
[15.8, 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.5, 10, 90, "smd_inductor", IND2525, "4R7"],
[14.7, 1.8,-90,"smd_pot", TC33X1, "10K"], [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]]; 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]];
@@ -813,7 +858,8 @@ ESP_01 = [
[ -6.6, -5.8, 0, "block", 0.7, 7.5, 0.1, gold ], [ -6.6, -5.8, 0, "block", 0.7, 7.5, 0.1, gold ],
[ -4.8, -2.3, 0, "block", 8.8, 0.7, 0.1, gold ], [ -4.8, -2.3, 0, "block", 8.8, 0.7, 0.1, gold ],
], ],
[] // accessories [], // accessories
[2.8 - 1.27, 3.54, 2, 4, silver, 2.54, 2.54] // grid
]; ];
XIAO = [ XIAO = [
@@ -827,7 +873,7 @@ XIAO = [
[for(x = [0:6], y = [-1,1]) [x * 2.54 + 2.71, y * 3 * 2.54 + 9], // Inboard hole positions [for(x = [0:6], y = [-1,1]) [x * 2.54 + 2.71, y * 3 * 2.54 + 9], // Inboard hole positions
for(x = [0:6], y = [-1,1]) [x * 2.54 + 2.71, y * 9 + 9]], // Hole positions on the edge, pad overlaps the inboard holes for(x = [0:6], y = [-1,1]) [x * 2.54 + 2.71, y * 9 + 9]], // Hole positions on the edge, pad overlaps the inboard holes
[ // components [ // components
[7.6, 9, 0, "block", 12.3, 12, 2.41, silver], // can [7.6, 9, 0, "block", 12.3, 12, 2.41, silver, false, 0.3, 0.3], // can
[21 + 1.76 - 7.35 / 2, 9, 0, "usb_C"], [21 + 1.76 - 7.35 / 2, 9, 0, "usb_C"],
], ],
[] // accessories [] // accessories
@@ -876,7 +922,7 @@ ESP32_DOIT_V1 = let(l = 51.45, w = 28.33, pitch = inch(1), pins = 15, poffset =
[l / 2 + poffset, w / 2 - pitch / 2, 0, "-2p54joiner", pins, 1], [l / 2 + poffset, w / 2 - pitch / 2, 0, "-2p54joiner", pins, 1],
[l / 2 + poffset, w / 2 + pitch / 2, 0, "-2p54joiner", pins, 1], [l / 2 + poffset, w / 2 + pitch / 2, 0, "-2p54joiner", pins, 1],
[1.75, w / 2, 180, "usb_uA" ], [1.75, w / 2, 180, "usb_uA" ],
[35, w / 2, 0, "block", 17.7, 16, 3, silver], // can [35, w / 2, 0, "block", 17.7, 16, 3, silver, false, 0.3, 0.3], // can
for(y=[-1,1]) [3.5, y * 6.5, 0, "chip", 4, 3, 1.6, silver], // Mock button surround for(y=[-1,1]) [3.5, y * 6.5, 0, "chip", 4, 3, 1.6, silver], // Mock button surround
for(y=[-1,1]) [3.5, y * 6.5, 0, "chip", 1.8,0, 2.0, grey(20)], // Mock buttons for(y=[-1,1]) [3.5, y * 6.5, 0, "chip", 1.8,0, 2.0, grey(20)], // Mock buttons
for(y=[-1,1]) [21.6, y * 9, 0, "smd_led", LED0603, y < 0 ? "red" : "blue"], for(y=[-1,1]) [21.6, y * 9, 0, "smd_led", LED0603, y < 0 ? "red" : "blue"],
@@ -932,10 +978,73 @@ L9110S = ["L9110S", "L9110S 2-Channel motor driver module", 29.2, 23, 1.6, 0, 3,
], ],
[]]; []];
PanelDue_v3 = ["PanelDue_v3", "Panel Due v3.0a LCD Display interface", 53, 73, 1.2, 0, 3.2, 0, "#2140BE", false, [[5,5], [5, -5], [43.7, 37.2]],
[
[ 45.0, 26.5, 45, "buzzer", 6, 12],
[ 32.8, 36.5, 90, "2p54socket", 20, 2],
[ 31.3, 5.9, 180, "molex_hdr", 4, 1],
[ 38.0, 53.2, -90, "2p54boxhdr", 5, 2, false, true, true],
[ 40.8, 67.4, 0, "button_6mm"],
[ 45.1, 16.5, 0, "button_6mm"],
[ 51.2, 68.0, 0, "usb_uA"],
[ 13.6, 35.2, 0, "smd_qfp", QFP50P1200X1200X160_64N, "ATSAM4S4BA"],
[ 14.6, 7.9, 180, "smd_sot", SOT223],
[ 23.2, 14, 0, "smd_sot", SOT23],
[ 31.7, 65, 180, "smd_diode", DO214AC],
[ 24.9, 3.8, 180, "smd_diode", DO214AC],
[ 1.9, 33, -90, "smd_cap", CAP0603, 0.5],
[ 1.9, 28.9, 90, "smd_cap", CAP0603, 0.5],
[ 14.6, 13.2, 0, "smd_cap", CAP0805, 0.85],
[ 20.3, 57.5, 90, "smd_res", RES0603],
[ 18.1, 57.5, 90, "smd_res", RES0603],
[ 27.6, 57, 0, "smd_res", RES0603],
[ 27.3, 7.2, 0, "smd_res", RES0603],
[ 27.3, 9.7, 0, "smd_res", RES0603],
[ 18.5, 11.5, 90, "smd_cap", CAP0805, 0.85],
[ 32.5, 71.2, 180, "smd_cap", CAP0603, 0.5],
[ 14.1, 25.1, 90, "smd_cap", CAP0603, 0.5],
[ 4.2, 36.9, 0, "smd_cap", CAP0603, 0.5],
[ 7.7, 28.4, 90, "smd_cap", CAP0603, 0.5],
[ 22.0, 34.6, 0, "smd_cap", CAP0603, 0.5],
[ 11.4, 44.5, 90, "smd_cap", CAP0603, 0.5],
[ 22.1, 31.2, 0, "smd_cap", CAP0603, 0.5],
[ 12.0, 25.5, 90, "smd_cap", CAP0603, 0.5],
[ 16.2, 24.2, 90, "smd_cap", CAP0603, 0.85],
[ 9.3, 44.5, 90, "smd_cap", CAP0603, 0.85],
[ 5.3, 34.9, 0, "smd_cap", CAP0603, 0.5],
[ 37.5, 61.9, 90, "smd_res", RES0603, "0"],
[ 4.8, 26.5, 0, "smd_cap", CAP0603, 0.85],
[ 3.3, 24.5, 0, "smd_res", RES0603, "1"],
[ 4.8, 30.8, 90, "chip", 5, 3.2, 1.1],
[ 6.9, 24.5, 0, "smd_res", L2012C],
[ 21.8, 7.4, 0, "smd_res", L2012C],
[ 40.8, 71.9, 0, "text", 6, 1.42, "Erase"],
[ 51.4, 16.5, 90, "text", 6, 1.42, "Reset"],
[ 51.4, 52.2, 90, "text", 7.4, 1.42, "CONN_SD"],
[ 2.7, 9.7, 0, "text", 4, 1.27, "GND"],
[ 8.0, 9.7, 0, "text", 4, 1.27, "3.3V"],
[ 38.1, 21.2, 0, "text", 4, 1.42, "3.3V"],
[ 40.7, 12.2, 0, "text", 2, 1.42, "5V"],
[ 49.8, 9.8, 0, "text", 3, 1.27, "Din"],
[ 50.3, 7.3, 0, "text", 4, 1.27, "Dout"],
[ 49.8, 4.7, 0, "text", 3, 1.27, "Gnd"],
[ 49.8, 2.2, 0, "text", 3, 1.27, "+5V"],
],
[],
[6, 60.8 - inch(0.3), 1, 4, silver, 2.54, 2.54, // X4
38, 16.1 - inch(0.1), 1, 3, silver, 2.54, 2.54, // JP1
3.1, 12, 2, 1, silver, 4.6, 2.54, // test points
31.3, 5.9 - inch(0.15), 1, 4, silver, 2.54, 2.64, // X1
38 - inch(0.05), 53.2 - inch(0.2), 2, 5, silver, 2.54, 2.54, // X5
32.8- inch(0.05),36.5 - inch(0.95),2, 20, silver, 2.54, 2.54, // X3
],
];
tiny_pcbs = [XIAO, MP1584EN, TP4056, ESP_01, LIPO_fuel_gauge]; tiny_pcbs = [XIAO, MP1584EN, TP4056, ESP_01, LIPO_fuel_gauge];
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]; big_pcbs = [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, OPZ2, PanelDue_v3, RPI3A, RPI3, RPI4];
pcbs_not_shown = [Melzi, Duex2, PSU12V1A, Keyes5p1, PI_IO, ExtruderPCB]; pcbs_not_shown = [Melzi, Duex2, PSU12V1A, Keyes5p1, PI_IO, ExtruderPCB];

View File

@@ -0,0 +1,103 @@
//
// NopSCADlib Copyright Chris Palmer 2023
// 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/>.
//
//
//! Photo interrupter modules popular in robot kits and from China.
//
include <../utils/core/core.scad>
include <../utils/rounded_polygon.scad>
function pi_base_width(type) = type[1]; //! Width of the base
function pi_base_length(type) = type[2]; //! Length of the base
function pi_base_height(type) = type[3]; //! Height of the base
function pi_gap_height(type) = type[4]; //! Height of the gap where the light can be interrupted
function pi_gap_width(type) = type[6]; //! Width of the gap
function pi_stem_width(type) = type[5]; //! Width of the stems
function pi_hole_diameter(type) = type[7]; //! Diameter of the mounting holes
function pi_color(type) = type[8]; //! Color of photo interrupter
function pi_pcb(type) = type[9]; //! Parameter for the support PCB, created with pi_pcb
module pi_hole_locations(type) { //! Locations of photo interrupter mounting holes
translate([0, -(pi_base_length(type) - pi_base_width(type)) / 2, 0])
children();
translate([0, (pi_base_length(type) - pi_base_width(type)) / 2, 0])
children();
}
module pi_pcb_hole_locations(pcb) { //! Locations of the PCB holes
for (xy = pcb[7]) {
translate([xy[0], xy[1], 0])
children();
}
}
module pi_pcb(type) { //! Draw the support PCB
pcb = pi_pcb(type);
color(pcb[6]) {
translate([0, 0, -pcb[2]]) {
linear_extrude(pcb[2]) {
difference() {
rounded_polygon([[0, -(pi_base_length(type) - pi_base_width(type)) / 2, -pi_base_width(type) / 2],
[pi_base_width(type) / 2, -pcb[1]/2, eps],
[pcb[0]+1, -pcb[1]/2, eps],
[pcb[0]+1, pcb[1]/2, eps],
[pi_base_width(type) / 2, pcb[1]/2, eps],
[0, (pi_base_length(type) - pi_base_width(type)) / 2, -pi_base_width(type) / 2]
]);
pi_pcb_hole_locations(pcb)
circle(d = pcb[8]);
pi_hole_locations(type)
circle(d=pi_hole_diameter(type));
}
}
}
}
}
module photo_interrupter(type) { //! Draw the photo interrupter, with PCB
vitamin(str("photo_interrupter(", type[0], "): ", type[0], " Photo interrupter"));
color(pi_color(type)) {
linear_extrude(pi_base_height(type)) {
difference() {
hull() {
pi_hole_locations(type)
circle(d = pi_base_width(type));
}
pi_hole_locations(type)
circle(d = pi_hole_diameter(type));
}
}
translate([-pi_base_width(type)/2, -(pi_gap_width(type)/2 + pi_stem_width(type)), 0])
cube([pi_base_width(type), pi_stem_width(type), pi_gap_height(type) + pi_base_height(type)]);
translate([-pi_base_width(type)/2, pi_gap_width(type)/2, 0])
cube([pi_base_width(type), pi_stem_width(type), pi_gap_height(type) + pi_base_height(type)]);
}
pi_pcb(type);
}
module pi_cutout(type) { //! Shape to subtract for fitting a photo interrupter
hull() {
pi_hole_locations(type)
cylinder(h = pi_base_height(type), d = pi_base_width(type));
}
translate([-pi_base_width(type)/2, -(pi_gap_width(type)/2 + pi_stem_width(type)), 0])
cube([pi_base_width(type), pi_stem_width(type), pi_gap_height(type) + pi_base_height(type)]);
translate([-pi_base_width(type)/2, pi_gap_width(type)/2, 0])
cube([pi_base_width(type), pi_stem_width(type), pi_gap_height(type) + pi_base_height(type)]);
};

View File

@@ -0,0 +1,23 @@
//
// NopSCADlib Copyright Chris Palmer 2023
// 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/>.
//
PH1 = ["PH1", 6.4, 25.9 , 3.5, 8.6, 4.1, 5.9, 3, grey(20), [22, 20, 1.6, true, 11-3.2, 0, "blue",[[8.3, -7.5], [8.3, 7.5]], 3]];
photo_interrupters = [PH1];
use <photo_interrupter.scad>

View File

@@ -20,7 +20,7 @@
include <../utils/core/core.scad> include <../utils/core/core.scad>
use <../utils/dogbones.scad> use <../utils/dogbones.scad>
panel_clearance = 0.2; panel_clearance = 0.5;
housing_height = 14.12; // measured height of a Dupont connector. housing_height = 14.12; // measured height of a Dupont connector.
housing_colour = grey(25); housing_colour = grey(25);
@@ -74,8 +74,11 @@ module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cu
translate_z(smt ? 3.5 - h : 0) { translate_z(smt ? 3.5 - h : 0) {
for(x = [0 : cols - 1], y = [0 : rows - 1]) { for(x = [0 : cols - 1], y = [0 : rows - 1]) {
py = pitch * (y - (rows - 1) / 2);
pin = [pitch * (x - (cols - 1) / 2), py, py + width / 2]; // Position of pin joint
// Vertical part of the pin // Vertical part of the pin
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2)]) translate([pin.x, pin.y])
if(right_angle) if(right_angle)
pin(type, hdr_pin_below(type) + (y + 0.5) * pitch); pin(type, hdr_pin_below(type) + (y + 0.5) * pitch);
else else
@@ -84,11 +87,12 @@ module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cu
if(right_angle) { if(right_angle) {
w = hdr_pin_width(type); w = hdr_pin_width(type);
// Horizontal part of the pin // Horizontal part of the pin
rotate([-90, 0, 180]) translate([pin.x, pin.y - hdr_pin_below(type), pin.z])
translate([pitch * (x - (cols - 1) / 2), -pitch * (y - (rows - 1) / 2) - width / 2, hdr_pin_below(type) - (y - (rows - 1) / 2) * pitch]) rotate([-90, 0, 180])
pin(type, hdr_pin_length(type) - hdr_pin_below(type) + ra_offset + pitch / 2 + (y - 0.5) * pitch); pin(type, hdr_pin_length(type) - hdr_pin_below(type) + ra_offset + y * pitch);
// corner // corner
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2) - w / 2, pitch * (y - (rows - 1) / 2) + width / 2 - w / 2]) translate([pin.x, pin.y - w / 2, pin.z - w / 2])
rotate([0, -90, 0]) rotate([0, -90, 0])
color(hdr_pin_colour(type)) color(hdr_pin_colour(type))
rotate_extrude(angle = 90, $fn = 32) rotate_extrude(angle = 90, $fn = 32)
@@ -119,7 +123,7 @@ module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cu
} }
} }
module box_header(type, cols = 1, rows = 1, smt = false, cutout = false) { //! Draw box header module box_header(type, cols = 1, rows = 1, smt = false, cutout = false, right_angle = false) { //! Draw box header
pitch = hdr_pitch(type); pitch = hdr_pitch(type);
size = hdr_box_size(type); size = hdr_box_size(type);
w = cols * pitch + 7.62; w = cols * pitch + 7.62;
@@ -127,36 +131,63 @@ module box_header(type, cols = 1, rows = 1, smt = false, cutout = false) { //! D
h = size.z; h = size.z;
t = hdr_box_wall(type); t = hdr_box_wall(type);
base = h - 6.4; base = h - 6.4;
ra_offset = 2.4;
if(cutout) if(cutout)
dogbone_rectangle([cols * pitch + 2 * panel_clearance, rows * pitch + 2 * panel_clearance, 100], center = false); dogbone_rectangle([cols * pitch + 2 * panel_clearance, rows * pitch + 2 * panel_clearance, 100], center = false);
else { else {
vitamin(str("box_header(", type[0], ", ", cols, ", ", rows, arg(smt, false, "smt"), "): Box header ", cols, " x ", rows)); vitamin(str("box_header(", type[0], ", ", cols, ", ", rows, arg(smt, false, "smt"), arg(right_angle, false, "right_angle"), "): Box header ", cols, " x ", rows, right_angle ? " right angle " : ""));
translate_z(smt ? 3.5 - h : 0) { translate_z(smt ? 3.5 - h : 0) {
for(x = [0 : cols - 1], y = [0 : rows - 1]) for(x = [0 : cols - 1], y = [0 : rows - 1]) {
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2), 0]) py = -pitch * (y - (rows - 1) / 2);
pin(type, hdr_pin_length(type) - pitch + base); pin = [pitch * (x - (cols - 1) / 2), py, l / 2 - py]; // Position of pin joint
color(hdr_base_colour(type)) { translate([pin.x, pin.y])
linear_extrude(base) if(right_angle)
square([w, l], center = true); pin(type, hdr_pin_below(type) + pin.z);
else
pin(type, hdr_pin_length(type) - pitch + base);
linear_extrude(h) if(right_angle) {
difference() { pw = hdr_pin_width(type);
square([w, l], center = true); // Horizontal part of the pin
translate([pin.x, pin.y + hdr_pin_below(type), pin.z])
rotate([-90, 0, 0])
pin(type, hdr_pin_length(type) - hdr_pin_below(type) + ra_offset + y * pitch);
square([w - t, l - t], center = true); // corner
translate([pin.x, pin.y + pw / 2, pin.z - pw / 2])
translate([0, -l / 2]) rotate([0, -90, 180])
square([4.5, 4.5], center = true); color(hdr_pin_colour(type))
} rotate_extrude(angle = 90, $fn = 32)
translate([0, -pw / 2])
square(pw);
}
} }
if(show_plugs)
color(housing_colour) translate([0, right_angle ? ra_offset + (rows - 1) * pitch / 2 : 0, right_angle ? l / 2 : 0])
translate_z(base) rotate([right_angle ? -90 : 0, 0, 0]) {
linear_extrude(housing_height) color(hdr_base_colour(type)) {
square([cols * pitch, rows * pitch], center = true); linear_extrude(base)
square([w, l], center = true);
linear_extrude(h)
difference() {
square([w, l], center = true);
square([w - t, l - t], center = true);
translate([0, -l / 2])
square([4.5, 4.5], center = true);
}
}
if(show_plugs)
color(housing_colour)
translate_z(base)
linear_extrude(housing_height)
square([cols * pitch, rows * pitch], center = true);
}
} }
} }
} }
@@ -242,9 +273,11 @@ module pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt
} }
} }
module jst_xh_header(type, pin_count, right_angle = false, colour = false, pin_colour = false, smt = false) { //! Draw JST XH connector module jst_xh_header(type, pin_count, right_angle = false, colour = false, pin_colour = false, smt = false) { //! Draw JST XH, PH or ZH connector
colour = colour ? colour : hdr_base_colour(type); series = chr([ord(type[0][4]) - 32, ord(type[0][5]) - 32]);
pin_colour = pin_colour ? pin_colour : hdr_pin_colour(type); vitamin(str("jst_xh_header(", type[0], ", ", pin_count, arg(right_angle, false, "right_angle"), arg(colour, false, "colour"), arg(smt, false, "smt"), "): JST ", series, " connector ",
pin_count, " way", right_angle ? " right_angle" :""));
pitch = hdr_pitch(type); pitch = hdr_pitch(type);
size = hdr_box_size(type) + [(pin_count - 1) * pitch, 0, 0]; size = hdr_box_size(type) + [(pin_count - 1) * pitch, 0, 0];
pinOffsetX = hdr_box_size(type).x / 2; // Offset from last pin to box edge pinOffsetX = hdr_box_size(type).x / 2; // Offset from last pin to box edge
@@ -255,6 +288,7 @@ module jst_xh_header(type, pin_count, right_angle = false, colour = false, pin_c
ra_z = ra_h - size.y / 2; ra_z = ra_h - size.y / 2;
ra_extra = ra_h - size.y; // thicker base for right angle version ra_extra = ra_h - size.y; // thicker base for right angle version
pinWidth = hdr_pin_width(type); pinWidth = hdr_pin_width(type);
pin_colour = pin_colour ? pin_colour : hdr_pin_colour(type);
module jst_xh_socket(type, pin_count, ra = false) { module jst_xh_socket(type, pin_count, ra = false) {
module wall() { module wall() {
@@ -308,7 +342,7 @@ module jst_xh_header(type, pin_count, right_angle = false, colour = false, pin_c
} }
} // end module } // end module
color(colour) color(colour ? colour : hdr_base_colour(type))
if(right_angle) if(right_angle)
translate([0, -ra_box_offset, ra_z]) translate([0, -ra_box_offset, ra_z])
rotate([-90, 0, 180]) rotate([-90, 0, 180])

View File

@@ -27,9 +27,9 @@
2p54header = ["2p54header", 2.54, 11.6, 3.2, 0.66, gold, grey(20), 8.5, [0, 0, 8.7], 2.4, 0, 0, 0 ]; 2p54header = ["2p54header", 2.54, 11.6, 3.2, 0.66, gold, grey(20), 8.5, [0, 0, 8.7], 2.4, 0, 0, 0 ];
2p54joiner = ["2p54joiner", 2.54, 6.86, 2.5, 0.66, gold, grey(20), 8.5, [0, 0, 8.7], 2.4, 0, 0, 0 ]; // Cropped pins for joining PCBs 2p54joiner = ["2p54joiner", 2.54, 6.86, 2.5, 0.66, gold, grey(20), 8.5, [0, 0, 8.7], 2.4, 0, 0, 0 ]; // Cropped pins for joining PCBs
jst_xh_header = ["jst_xh_header",2.5, 10, 3.4, 0.64, gold, grey(90), 0, [4.9, 5.75, 7], 0.8, 0.525, 0.6, 6.1]; jst_xh_header = ["jst_xh_header",2.5, 10, 3.4, 0.64, gold, "white", 0, [4.9, 5.75, 7], 0.8, 0.525, 0.6, 6.1];
jst_ph_header = ["jst_ph_header",2.0, 9, 3.4, 0.64, silver, grey(90), 0, [3.9, 4.5, 6], 0.6, 0.55, 0.25, 4.8]; jst_ph_header = ["jst_ph_header",2.0, 9, 3.4, 0.64, silver, "white", 0, [3.9, 4.5, 6], 0.6, 0.55, 0.25, 4.8];
jst_zh_header = ["jst_zh_header",1.5, 7.4, 3.4, 0.5 , silver, grey(90), 0, [3.0, 3.5,4.5], 0.5, 0.45, 0.25, 3.7]; jst_zh_header = ["jst_zh_header",1.5, 7.4, 3.4, 0.5 , silver, "white", 0, [3.0, 3.5,4.5], 0.5, 0.45, 0.25, 3.7];
pin_headers = [ 2p54header ]; pin_headers = [ 2p54header ];

View File

@@ -32,7 +32,7 @@ function pot_face(type) = type[2]; //! Faceplate rib width, plate depth and
function pot_wafer(type) = type[3]; //! Width, diameter and thickness of the track wafer plus true if curved function pot_wafer(type) = type[3]; //! Width, diameter and thickness of the track wafer plus true if curved
function pot_gangs(type) = type[4]; //! Number of gangs for mult-gang pot function pot_gangs(type) = type[4]; //! Number of gangs for mult-gang pot
function pot_thread_d(type) = type[5]; //! Nomininal thread diameter function pot_thread_d(type) = type[5]; //! Nomininal thread diameter
function pot_thread_p(type) = type[6]; //! Thread pritch function pot_thread_p(type) = type[6]; //! Thread pitch
function pot_thread_h(type) = type[7]; //! Height of threaded part function pot_thread_h(type) = type[7]; //! Height of threaded part
function pot_boss_d(type) = type[8]; //! Boss diameter function pot_boss_d(type) = type[8]; //! Boss diameter
function pot_boss_h(type) = type[9]; //! Boss height function pot_boss_h(type) = type[9]; //! Boss height

137
vitamins/radial.scad Normal file
View File

@@ -0,0 +1,137 @@
//
// NopSCADlib Copyright Chris Palmer 2023
// 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/>.
//
//
//! Radial components for PCBs.
//
include <../utils/core/core.scad>
include <../utils/sweep.scad>
include <../utils/rounded_polygon.scad>
include <../utils/rounded_cylinder.scad>
function rd_xtal_size(type) = type[1]; //! Crystal length, width and height and optional corner radius
function rd_xtal_flange(type) = type[2]; //! Crystal flange width and thickness
function rd_xtal_pitch(type) = type[3]; //! Crystal lead pitch
function rd_xtal_lead_d(type) = type[4]; //! Crystal lead diameter
module cylindrical_wrap(r, h = eps) { //! Wrap a 2D child extruded to height `h` around a cylinder with radius `r`.
sides = r2sides(r);
dx = 2 * r * tan(180 / sides);
for(i = [0 : sides - 1])
rotate((i - 0.5) * 360 / sides)
translate([0, r])
rotate([-90, 0, 0])
linear_extrude(h, center = true)
intersection() {
translate([(sides / 2 - i) * -dx, 0])
children();
square([dx, inf], center = true);
}
}
module lead_positions(p, z) {
if(is_list(p))
for($x = [-1, 1], $y = [-1, 1])
translate([$x * p.x / 2, $y * p.y / 2, z])
children();
else
for($x = [-1, 1])
translate([$x * p / 2, 0, z])
children();
}
module radial_leads(ap, p, z, d, tail)
color(silver) {
assert(p == ap || z > 3 * d, "Must be space to bend the wires");
zl = tail + (p == ap ? z : 0);
let($fn = 16) {
lead_positions(p, -tail)
rotate(90)
cylinder(d = d, h = zl);
if(p != ap) {
assert(!is_list(p), "Bending four leads not supported yet");
sd = d * sign(p - ap);
path = [[0, z, 0], [0 + sd, z - d / 2, -sd], [p / 2 - ap / 2 - sd, d / 2, sd], [p / 2 - ap / 2, 0, 0]];
rpath = let($fn = 32) rounded_polygon(path);
lead_positions(ap, 0)
rotate([90, 0, 90 * -$x + 90])
sweep([for(p = rpath) [p.x, p.y, 0]], circle_points(d / 2));
}
}
}
module rd_xtal(type, value, z = 0, pitch = undef, tail = 3) { //! Draw a crystal
vitamin(str("rd_xtal(", type[0], ", \"", value, "\"): Crystal ", type[0], " ", value));
s = rd_xtal_size(type);
r = len(s) < 4 ? s.y / 2 - eps : s[3];
f = rd_xtal_flange(type);
cp = rd_xtal_pitch(type);
p = is_undef(pitch) ? cp : pitch;
d = rd_xtal_lead_d(type);
r2 = 0.2;
color(silver) {
translate_z(z) {
if(s.y) {
$fn = 32;
rounded_rectangle([s.x, s.y, s.z - r2], r);
translate_z(s.z - r2)
rounded_top_rectangle([s.x, s.y, r2], r, r2);
}
else
let($fn = 32)
rounded_cylinder(r = s.x / 2, h = s.z, r2 = r2);
if(f) {
rounded_rectangle([s.x + 2 * f.x, s.y + 2 * f.x, f[1]], r + f.x);
if(is_list(cp))
translate([-s.x / 2 - f.x, -s.y / 2 - f.x])
cube([r + f.x, r + f.x, f[1]]); // Pin 1 marked by sharp corner on 4 pin packages
}
}
radial_leads(cp, p, z, d, tail);
}
color(grey(10)) {
if(!is_undef(value))
if(s.y)
translate_z(z + s.z)
linear_extrude(eps)
resize([s.x * 0.75, s.y / 2])
text(value, halign = "center", valign = "center");
else
translate_z(z + s.z / 2)
let($fn = 32)
cylindrical_wrap(s.x / 2)
rotate(-90)
resize([s.z * 0.9, s.x * PI / 4])
text(value, halign = "center", valign = "center");
if(s.y)
lead_positions(cp, z)
cylinder(d = d * 4, h = 2 * eps, center = true);
else
translate_z(z)
cylinder(d = (s.x + cp) / 2, h = 2 * eps, center = true);
}
}

33
vitamins/radials.scad Normal file
View File

@@ -0,0 +1,33 @@
//
// NopSCADlib Copyright Chris Palmer 2023
// 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/>.
//
//
//! Radial components for PCBs.
//
// Crystals
HC49 = ["HC49", [10.5, 3.7, 13.5], [0.475, 0.6], 4.88, 0.45];
HC49_4H = ["HC49_4H", [10.5, 3.7, 3.5], [0.475, 0.6], 4.88, 0.43];
C_002RX = ["C_002RX", [ 2.0, 0, 6], false, 0.7, 0.2];
ACT1700 = ["ACT1700", [10.8, 10.8, 5.3, 1], [1, 0.6], [ inch(0.3), inch(0.3)], 0.45 ];
ACT1100 = ["ACT1100", [20.4, 10.8, 5.3, 1], [1, 0.6], [ inch(0.6), inch(0.3)], 0.45 ];
rd_xtals = [C_002RX, HC49_4H, ACT1700, ACT1100, HC49];
use <radial.scad>

View File

@@ -41,6 +41,7 @@ function screw_washer(type) = type[9]; //! Default washer
function screw_nut(type) = type[10]; //! Default nut function screw_nut(type) = type[10]; //! Default nut
function screw_pilot_hole(type) = type[11]; //! Pilot hole radius for wood screws, tap radius for machine screws function screw_pilot_hole(type) = type[11]; //! Pilot hole radius for wood screws, tap radius for machine screws
function screw_clearance_radius(type) = type[12]; //! Clearance hole radius function screw_clearance_radius(type) = type[12]; //! Clearance hole radius
function screw_thread_diameter(type) = type[13]; //! Thread diameter, if different from nominal diameter
function screw_nut_radius(type) = screw_nut(type) ? nut_radius(screw_nut(type)) : 0; //! Radius of matching nut function screw_nut_radius(type) = screw_nut(type) ? nut_radius(screw_nut(type)) : 0; //! Radius of matching nut
function screw_boss_diameter(type) = max(washer_diameter(screw_washer(type)) + 1, 2 * (screw_nut_radius(type) + 3 * extrusion_width)); //! Boss big enough for nut trap and washer function screw_boss_diameter(type) = max(washer_diameter(screw_washer(type)) + 1, 2 * (screw_nut_radius(type) + 3 * extrusion_width)); //! Boss big enough for nut trap and washer
function screw_head_depth(type, d = 0) = //! How far a counter sink head will go into a straight hole diameter d function screw_head_depth(type, d = 0) = //! How far a counter sink head will go into a straight hole diameter d
@@ -87,47 +88,50 @@ module screw(type, length, hob_point = 0, nylon = false) { //! Draw specified sc
vitamin(str("screw(", type[0], "_screw, ", length, arg(hob_point, 0, "hob_point"), arg(nylon, false, "nylon"), "): ", description)); vitamin(str("screw(", type[0], "_screw, ", length, arg(hob_point, 0, "hob_point"), arg(nylon, false, "nylon"), "): ", description));
head_type = screw_head_type(type); head_type = screw_head_type(type);
rad = screw_radius(type) - eps; shaft_rad = screw_radius(type) - eps;
head_rad = screw_head_radius(type); head_rad = screw_head_radius(type);
head_height = screw_head_height(type); head_height = screw_head_height(type);
socket_af = screw_socket_af(type); socket_af = screw_socket_af(type);
socket_depth= screw_socket_depth(type); socket_depth= screw_socket_depth(type);
socket_rad = socket_af / cos(30) / 2; socket_rad = socket_af / cos(30) / 2;
max_thread = screw_max_thread(type); max_thread = screw_max_thread(type);
has_shoulder = !is_undef(screw_thread_diameter(type));
thread_rad = has_shoulder ? screw_thread_diameter(type) / 2 : screw_radius(type);
thread = max_thread ? length >= max_thread + 5 ? max_thread thread = max_thread ? length >= max_thread + 5 ? max_thread
: length : length
: length; : length;
d = 2 * screw_radius(type); thread_offset = has_shoulder ? thread : 0;
pitch = metric_coarse_pitch(d); thread_d = 2 * thread_rad;
pitch = metric_coarse_pitch(thread_d);
colour = nylon || head_type == hs_grub ? grey(40) : grey(80); colour = nylon || head_type == hs_grub ? grey(40) : grey(80);
module shaft(socket = 0, headless = false) { module shaft(socket = 0, headless = false) {
point = screw_nut(type) ? 0 : 3 * rad; point = screw_nut(type) ? 0 : 3 * shaft_rad;
shank = length - thread - socket; shank = length - socket - (has_shoulder ? 0 : thread);
if(show_threads && !point && pitch) if(show_threads && !point && pitch)
translate_z(-length) translate_z(-length - thread_offset)
male_metric_thread(d, pitch, thread - (shank > 0 || headless ? 0 : socket), false, top = headless ? -1 : 0, solid = !headless, colour = colour); male_metric_thread(thread_d, pitch, thread - (shank > 0 || headless ? 0 : socket), false, top = headless ? -1 : 0, solid = !headless, colour = colour);
else else
color(colour * 0.9) color(colour * 0.9)
rotate_extrude() { rotate_extrude() {
translate([0, -length + point]) translate([0, -length + point - thread_offset])
square([rad, length - socket - point]); square([thread_rad - eps, length - socket - point]);
if(point) if(point)
polygon([ polygon([
[0.4, -length], [0, point - length], [rad, point - length] [0.4, -length], [0, point - length], [shaft_rad, point - length]
]); ]);
} }
if(shank > 0) if(shank > 0)
color(colour) color(colour)
translate_z(-shank - socket) translate_z(-shank - socket)
cylinder(r = rad + eps, h = shank); cylinder(r = shaft_rad + eps, h = shank);
} }
module cs_head(socket_rad, socket_depth) { module cs_head(socket_rad, socket_depth) {
head_t = rad / 5; head_t = shaft_rad / 5;
head_height = head_rad + head_t; head_height = head_rad + head_t;
color(colour) { color(colour) {
@@ -173,7 +177,7 @@ module screw(type, length, hob_point = 0, nylon = false) { //! Draw specified sc
} }
if(head_type == hs_grub) { if(head_type == hs_grub) {
color(colour) { color(colour) {
r = show_threads ? rad - pitch / 2 : rad; r = show_threads ? shaft_rad - pitch / 2 : shaft_rad;
translate_z(-socket_depth) translate_z(-socket_depth)
linear_extrude(socket_depth) linear_extrude(socket_depth)
difference() { difference() {

View File

@@ -103,6 +103,9 @@ M8_hex_screw = ["M8_hex", "M8 hex", hs_hex, 8, 15, 5.65, 0, 0
M3_low_cap_screw = ["M3_low_cap", "M3 low cap", hs_cap, 3, 5.5, 2, 1.5, 2.0, 18, M3_washer, M3_nut, M3_tap_radius, M3_clearance_radius]; M3_low_cap_screw = ["M3_low_cap", "M3 low cap", hs_cap, 3, 5.5, 2, 1.5, 2.0, 18, M3_washer, M3_nut, M3_tap_radius, M3_clearance_radius];
M3_shoulder_screw= ["M3_shoulder", "M3 shoulder",hs_cap, 4, 7.0, 2.4, 1.5, 3.0, 6, M4_washer, M3_nut, M3_tap_radius, 2, 3];
M4_shoulder_screw= ["M4_shoulder", "M4 shoulder",hs_cap, 5, 9.0, 2.4, 1.5, 3.0, 8, M5_washer, M4_nut, M4_tap_radius, 2.5, 4];
M3_grub_screw = ["M3_grub", "M3 grub", hs_grub, 3, 0, 0, 2.5, 1.5, 0, M3_washer, M3_nut, M3_tap_radius, M3_clearance_radius]; M3_grub_screw = ["M3_grub", "M3 grub", hs_grub, 3, 0, 0, 2.5, 1.5, 0, M3_washer, M3_nut, M3_tap_radius, M3_clearance_radius];
M4_grub_screw = ["M4_grub", "M4 grub", hs_grub, 4, 0, 0, 2.4, 2.0, 0, M4_washer, M4_nut, M4_tap_radius, M4_clearance_radius]; M4_grub_screw = ["M4_grub", "M4 grub", hs_grub, 4, 0, 0, 2.4, 2.0, 0, M4_washer, M4_nut, M4_tap_radius, M4_clearance_radius];
M5_grub_screw = ["M5_grub", "M5 grub", hs_grub, 5, 0, 0, 2.4, 2.5, 0, M5_washer, M5_nut, M5_tap_radius, M5_clearance_radius]; M5_grub_screw = ["M5_grub", "M5 grub", hs_grub, 5, 0, 0, 2.4, 2.5, 0, M5_washer, M5_nut, M5_tap_radius, M5_clearance_radius];
@@ -117,6 +120,7 @@ No8_screw = ["No8", "No8 pan wood", hs_pan, 4.2, 8.2, 3.05, 0, 0
screw_lists = [ screw_lists = [
[ M2_cap_screw, M2p5_cap_screw, M3_cap_screw, M4_cap_screw, M5_cap_screw, M6_cap_screw, M8_cap_screw], [ M2_cap_screw, M2p5_cap_screw, M3_cap_screw, M4_cap_screw, M5_cap_screw, M6_cap_screw, M8_cap_screw],
[ 0, 0, M3_low_cap_screw], [ 0, 0, M3_low_cap_screw],
[ 0, 0, M3_shoulder_screw, M4_shoulder_screw],
[ M2_cs_cap_screw, 0, M3_cs_cap_screw, M4_cs_cap_screw, M5_cs_cap_screw, M6_cs_cap_screw, M8_cs_cap_screw], [ M2_cs_cap_screw, 0, M3_cs_cap_screw, M4_cs_cap_screw, M5_cs_cap_screw, M6_cs_cap_screw, M8_cs_cap_screw],
[ M2_dome_screw, M2p5_dome_screw,M3_dome_screw, M4_dome_screw, M5_dome_screw], [ M2_dome_screw, M2p5_dome_screw,M3_dome_screw, M4_dome_screw, M5_dome_screw],
[ 0, 0, M3_hex_screw, M4_hex_screw, M5_hex_screw, M6_hex_screw, M8_hex_screw], [ 0, 0, M3_hex_screw, M4_hex_screw, M5_hex_screw, M6_hex_screw, M8_hex_screw],

View File

@@ -19,6 +19,21 @@
// //
//! Surface mount components for PCBs. //! Surface mount components for PCBs.
//!
//! Note that the value string for tantalum capacitors is the the capacitance in pico farads expressed as two digits plus an exponent plus a single letter voltage code.
//! E.g. 475A is 4.7uF 10V on the parts list.
//!
//! | Code | Voltage |
//! | ---- | ------- |
//! | e | 2.5 |
//! | G | 4 |
//! | J | 6.3 |
//! | A | 10 |
//! | C | 16 |
//! | D | 20 |
//! | E | 25 |
//! | V | 35 |
//! | H | 50 |
// //
include <../utils/core/core.scad> include <../utils/core/core.scad>
@@ -84,11 +99,16 @@ module smd_led(type, colour, cutout) { //! Draw an SMD LED with specified `colou
function smd_res_size(type) = type[1]; //! Body length, width and height function smd_res_size(type) = type[1]; //! Body length, width and height
function smd_res_end_cap(type) = type[2]; //! End cap width function smd_res_end_cap(type) = type[2]; //! End cap width
function smd_res_power(type) = type[3]; //! Power rating in Watts function smd_res_power(type) = type[3]; //! Power rating in Watts, 0 for choke
module smd_resistor(type, value) { //! Draw an SMD resistor with specified value module smd_resistor(type, value) { //! Draw an SMD resistor with specified value
size = smd_res_size(type); size = smd_res_size(type);
vitamin(str("smd_resistor(", type[0], ", ", value, "): SMD resistor ", smd_size(size), " ", value, " ", smd_res_power(type), "W")); power = smd_res_power(type);
call = str("smd_resistor(", type[0], ", ", value, "): SMD ");
if(power)
vitamin(str(call, "resistor ", smd_size(size), " ", value, " ", power, "W"));
else
vitamin(str(call, "choke ", smd_size(size), " ", value));
t = 0.04; t = 0.04;
cap = smd_res_end_cap(type); cap = smd_res_end_cap(type);
@@ -234,6 +254,7 @@ 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_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_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 function smd_diode_leads(type) = type[4]; //! Lead extent in x, width, thickness and gap
function smd_diode_colour(type) = type[5]; //! Body colour
module smd_diode(type, value) { //! Draw an SMD diode module smd_diode(type, value) { //! Draw an SMD diode
vitamin(str("smd_diode(", type[0], "): ", type[0], " package ", value)); vitamin(str("smd_diode(", type[0], "): ", type[0], " package ", value));
@@ -248,7 +269,7 @@ module smd_diode(type, value) { //! Draw an SMD diode
gap = leads[3]; gap = leads[3];
gap2 = gap - leads.z * 2; gap2 = gap - leads.z * 2;
color(grey(20)) color(smd_diode_colour(type))
difference() { difference() {
hull() hull()
for(z = [z0, z1, z2], inset = abs(z - z1) * tan(slant)) for(z = [z0, z1, z2], inset = abs(z - z1) * tan(slant))
@@ -287,6 +308,75 @@ module smd_diode(type, value) { //! Draw an SMD diode
} }
function smd_tant_size(type) = type[1]; //! Body length, width and height
function smd_tant_z(type) = type[2]; //! Height above PCB surface
function smd_tant_lead_z(type) = type[3]; //! Top of lead frame from top
function smd_tant_leads(type) = type[4]; //! Lead extent in x, width, thickness and gap
function smd_tant_colours(type)= type[5]; //! Colours of body and stripe
module smd_tant(type, value) { //! Draw an SMD tantalum capacitor
function dig(c) = let(x = ord(c) - ord("0")) assert(x >= 0 && x <= 9, "expected value in the form 475A for 4.7uF 10V") x;
uF = is_undef(value) ? "" : str(" ,", (dig(value[0]) * 10 + dig(value[1])) * 10 ^ dig(value[2]) / 10^6, "uF");
codes = "eGJACDEVH";
voltages = [2.5, 4, 6.3, 10, 16, 20, 25, 35, 50];
volts = is_undef(value) ? "" : let(c = value[3])
assert(in(codes, c), str("expected the 4th character of value to be a voltage code: ", codes, ", got ", c))
str(", ", voltages[search(c, codes)[0]], "V");
vitamin(str("smd_tant(", type[0], "): SMD Tantalum capacitor package ", type[0][len(type[0]) -1], uF, volts));
size = smd_tant_size(type);
slant = 5; //! 5 degree body draft angle
z0 = smd_tant_z(type);
z2 = z0 + size.z;
z1 = z2 - smd_tant_lead_z(type);
stripe = size.x / 5;
leads = smd_tant_leads(type);
gap = leads[3];
gap2 = gap - leads.z * 2;
colours = smd_tant_colours(type);
inset = (z2 - z1) * tan(slant);
color(colours[0])
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") {
w = 0.9 * (size.x - stripe - inset);
translate([-size.x / 2 + inset + stripe + w / 2, 0, z2])
linear_extrude(eps)
resize([w, size.y / 2])
text(value, halign = "center", valign = "center");
}
color(colours[1]) {
translate([-size.x / 2 + stripe * 0.2, -size.y / 2 + inset, z2])
cube([(stripe - inset) * 0.8, 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_size(type) = type[1]; //! Body length, width and height
function smd_inductor_z(type) = type[2]; //! Height above PCB surface 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_lead_z(type) = type[3]; //! Top of lead frame from top
@@ -431,3 +521,125 @@ module smd_pot(type, value) { //! Draw an SMD pot
square([track_w, track_l], center = true); square([track_w, track_l], center = true);
} }
} }
function smd_coax_base_size(type) = type[1]; //! Size of the insulating base
function smd_coax_base_r(type) = type[2]; //! Corner radius of the base
function smd_coax_tube(type) = type[3]; //! OD, ID, height
function smd_coax_groove(type) = type[4]; //! Groove id, width and z
function smd_coax_pin_d(type) = type[5]; //! Central pin diameter
function smd_coax_lug_size(type) = type[6]; //! lug size
function smd_contact_size(type) = type[7]; //! contact size
module smd_coax(type) { //! Draw an SMD coaxial connector
vitamin(str("smd_coax(", type[0], "): SMD coax connector type: ", type[0]));
size = smd_coax_base_size(type);
t = smd_coax_tube(type);
g = smd_coax_groove(type);
chamfer = (t.x - g.x) / 2;
pin_r = smd_coax_pin_d(type) / 2;
lug = smd_coax_lug_size(type);
contact = smd_contact_size(type);
$fn = 64;
color(grey(90))
translate_z(eps)
rounded_rectangle(size, smd_coax_base_r(type));
color(gold) {
rotate_extrude() {
polygon([
[t.y / 2, 0.1],
[t.y / 2, t.z],
[g.x / 2, t.z],
[t.x / 2, t.z - chamfer],
[t.x / 2, g.z + g.y / 2 + chamfer],
[g.x / 2, g.z + g.y / 2],
[g.x / 2, g.z - g.y / 2],
[t.x / 2, g.z - g.y / 2 - chamfer],
[t.x / 2, 0.1],
]);
}
hull() {
translate_z(t.z - pin_r)
sphere(pin_r);
translate_z(0.1)
cylinder(r = pin_r, h = eps);
}
for(side = [-1, 1])
translate([side * size.x / 2, 0, lug.z / 2])
cube(lug, center = true);
rotate(180)
translate([-contact.x / 2, 0])
cube([contact.x, contact.y / 2, contact.z]);
cylinder(r = pin_r * 9 / 5, h = 0.1);
tube_wall = (t.x - t.y) / 2;
translate([-contact.x / 2, 0, (size.z - tube_wall) / 2])
cube([contact.x, contact.y / 2, tube_wall]);
}
}
function smd_qfp_body_size(type) = type[1]; //! Size of the body
function smd_qfp_slant(type) = type[2]; //! Angle of the slope
function smd_qfp_pins(type) = type[3]; //! Number of pins
function smd_qfp_pitch(type) = type[4]; //! Pin pitch
function smd_qfp_pin_size(type) = type[5]; //! Pins dimensions
function smd_qfp_gullwing(type) = type[6]; //! Gullwing S, L, R1, R2
module smd_qfp(type, value) { //! Draw and SMD QFP package
vitamin(str("smd_qfp(", type[0], "): SMD chip: ", value, ", package : ", type[0]));
size = smd_qfp_body_size(type);
offset = size.z / 2 * tan(smd_qfp_slant(type));
d = 3 * offset;
pitch = smd_qfp_pitch(type);
pin = smd_qfp_pin_size(type);
pins = smd_qfp_pins(type);
g = smd_qfp_gullwing(type);
s = g[0]; // length of top flat
l = g[1]; // length of bottom flat
r1 = g[2]; // top radius
r2 = g[3] + pin.z / 2; // bottom radius
pz = -size.z / 2 + pin.z / 2;
gullwing = rounded_path([[-1, 0, 0], [s, 0, 0], r1, [pin.x - l + r2, 0, pz], r2, [pin.x, 0, pz]], $fn = 32);
color(grey(20))
hull() {
translate_z(size.z / 2)
linear_extrude(eps)
offset(delta = d, chamfer = true)
offset(-d)
square([size.x, size.y], center = true);
translate_z(size.z - eps)
linear_extrude(eps)
offset(-offset)
square([size.x, size.y], center = true);
linear_extrude(eps)
offset(-offset)
square([size.x, size.y], center = true);
}
color(silver)
for(a = [0 : 90: 270])
rotate(a)
for(i = [0 : pins / 4 - 1])
translate([size.x / 2, (i - (pins / 4 - 1) / 2) * pitch, size.z / 2])
sweep(gullwing, rectangle_points(pin.y, pin.z));
color("white")
translate_z(size.z)
linear_extrude(eps) {
resize([size.x * 0.9, size.y / 8])
text(value, halign = "center", valign = "center");
translate([(-(pins / 4 - 1) * pitch) / 2, (-(pins / 4 - 1) * pitch) / 2])
circle(r = pin.y, $fn = 32);
}
}

View File

@@ -27,32 +27,44 @@ LED1206 = ["LED1206", [3.2, 1.6, 0.5], [2.0, 1.6, .6]];
smd_leds = [LED0603, LED0805, LED1206]; smd_leds = [LED0603, LED0805, LED1206];
RES0402 = ["RES0402", [1.0, 0.5, 0.35], 0.2, 1/16];
RES0502 = ["RES0502", [1.3, 0.6, 0.38], 0.2, 1/20];
RES0603 = ["RES0603", [1.6, 0.8, 0.45], 0.3, 1/10]; RES0603 = ["RES0603", [1.6, 0.8, 0.45], 0.3, 1/10];
RES0805 = ["RES0805", [2.0, 1.2, 0.45], 0.4, 1/8]; RES0805 = ["RES0805", [2.0, 1.2, 0.45], 0.4, 1/8];
RES1206 = ["RES1206", [3.1, 1.6, 0.6], 0.5, 1/4]; RES1206 = ["RES1206", [3.1, 1.6, 0.6], 0.5, 1/4];
L2012C = ["L2012C", [2.0, 1.25,0.9], 0.5, 0];
smd_resistors = [RES0603, RES0805, RES1206]; smd_resistors = [RES0402, RES0502, RES0603, RES0805, RES1206, L2012C];
CAP0402 = ["CAP0402", [1.0, 0.5], 0.2];
CAP0502 = ["CAP0502", [1.3, 0.6], 0.2];
CAP0603 = ["CAP0603", [1.6, 0.8], 0.3]; CAP0603 = ["CAP0603", [1.6, 0.8], 0.3];
CAP0805 = ["CAP0805", [2.0, 1.2], 0.4]; CAP0805 = ["CAP0805", [2.0, 1.2], 0.4];
CAP1206 = ["CAP1206", [3.1, 1.6], 0.5]; CAP1206 = ["CAP1206", [3.1, 1.6], 0.5];
smd_capacitors = [CAP0603, CAP0805, CAP1206]; smd_capacitors = [CAP0402, CAP0502, CAP0603, CAP0805, CAP1206];
SOT23 = ["SOT23", [3, 1.4, 1.0], 0.05, 0.66, 1.9, 2.6, [0.4, 0.45, 0.15], 0.4]; SOT23 = ["SOT23", [3, 1.4, 1.0], 0.05, 0.66, 1.9, 2.6, [0.4, 0.45, 0.15], 0.4];
SOT223 = ["SOT223", [6.5, 3.5, 1.6], 0.05, 0.89, 2.3, 7.0, [0.7, 0.95, 0.25], 3]; 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]; 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]]; 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]]; SOIC14 = ["SOIC14", [8.70, 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]]; 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]; smd_soics = [SOIC8, SOIC14, SOIC16, SOIC18];
DO241AC = ["DO241AC", [4.0, 2.5, 2.0], 0.1, 1, [4.8, 1.2, 0.15, 2]]; DO214AC = ["DO214AC", [4.0, 2.5, 2.0], 0.1, 1, [4.8, 1.2, 0.15, 2], grey(20)];
smd_diodes = [DO241AC]; smd_diodes = [DO214AC];
TANT_A = ["TANT_A", [3.0, 1.6, 1.6], 0.1, 0.8, [3.2, 1.2, 0.08, 1.1], ["#E9D769", "#E9B44A"]];
TANT_B = ["TANT_B", [3.3, 2.8, 1.9], 0.1, 0.95, [3.5, 2.2, 0.08, 1.4], ["#E9D769", "#E9B44A"]];
TANT_C = ["TANT_C", [5.8, 3.2, 2.6], 0.1, 1.3, [6.0, 2.2, 0.08, 2.9], ["#E9D769", "#E9B44A"]];
smd_tants = [TANT_A, TANT_B, TANT_C];
IND2525 = ["IND2525", [6.75, 6.75, 2], 0.1, 1.75, [7.24, 3.2, 0.15, 4.4], grey(50)]; IND2525 = ["IND2525", [6.75, 6.75, 2], 0.1, 1.75, [7.24, 3.2, 0.15, 4.4], grey(50)];
@@ -62,4 +74,13 @@ TC33X1 = ["TC33X1", [3.0, 3.8, 0.5], [0.95, 0.9, 0.88, 1.5, 0.2, 0.75],[3.0, 0.1
smd_pots = [TC33X1]; smd_pots = [TC33X1];
U_FL_R_SMT_1 = ["U_FL_R_SMT_1", [2.6, 2.6, 0.35], 0.2, [2, 1.7, 1.25], [1.86, 0.09, 0.6], 0.5, [0.4, 1.8, 0.2], [0.6, 3.1, 0.2]];
smd_coaxs = [U_FL_R_SMT_1];
QFP50P1200X1200X160_64N = ["QFP50P1200X1200X160_64N", [10, 10, 1.6], 12, 64, 0.5, [1, 0.2, 0.1], [0.2, 0.6, 0.1, 0.1]];
smd_qfps = [ QFP50P1200X1200X160_64N ];
use <smd.scad> use <smd.scad>

Binary file not shown.

View File

@@ -19,23 +19,25 @@
// //
// Tubing and sleeving // Tubing and sleeving
// Description OD ID Colour // Description OD ID Colour
PVC64 = ["PVC64", "PVC aquarium tubing", 6, 4, [0.8, 0.8, 0.8, 0.75 ]]; PVC64 = ["PVC64", "PVC aquarium tubing", 6, 4, [0.8, 0.8, 0.8, 0.75 ]];
PVC85 = ["PVC85", "PVC aquarium tubing", 8, 5, [0.8, 0.8, 0.8, 0.75 ]]; PVC85 = ["PVC85", "PVC aquarium tubing", 8, 5, [0.8, 0.8, 0.8, 0.75 ]];
NEOP85 = ["NEOP85", "Neoprene tubing", 8, 5, [0.2,0.2,0.2]]; NEOP85 = ["NEOP85", "Neoprene tubing", 8, 5, [0.2,0.2,0.2]];
PTFE07 = ["PTFE07", "PTFE sleeving", 1.2, 0.71, [0.95, 0.95, 0.95, 0.9]]; PTFE07 = ["PTFE07", "PTFE sleeving", 1.2, 0.71, [0.95, 0.95, 0.95, 0.9]];
PTFE20 = ["PTFE20", "PTFE sleeving", 2.6, 2, [0.95, 0.95, 0.95, 0.9]]; PTFE20 = ["PTFE20", "PTFE sleeving", 2.6, 2, [0.95, 0.95, 0.95, 0.9]];
PTFE2_4 = ["PTFE2_4", "PTFE tubing", 4, 2, [0.95, 0.95, 0.95, 0.9]]; PTFE2_4 = ["PTFE2_4", "PTFE tubing", 4, 2, [0.95, 0.95, 0.95, 0.9]];
PTFE2_3 = ["PTFE2_3", "PTFE tubing", 3, 2, [0.95, 0.95, 0.95, 0.9]]; PTFE2_3 = ["PTFE2_3", "PTFE tubing", 3, 2, [0.95, 0.95, 0.95, 0.9]];
PTFE4_6 = ["PTFE4_6", "PTFE tubing", 6, 4, [0.95, 0.95, 0.95, 0.9]]; PTFE4_6 = ["PTFE4_6", "PTFE tubing", 6, 4, [0.95, 0.95, 0.95, 0.9]];
PF7 = ["PF7", "PTFE tubing", 46/10, 3.84, [0.95, 0.95, 0.95, 0.9]]; PF7 = ["PF7", "PTFE tubing", 46/10, 3.84, [0.95, 0.95, 0.95, 0.9]];
HSHRNK16 = ["HSHRNK16", "Heatshrink sleeving", 2.0, 1.6, "grey"]; HSHRNK16 = ["HSHRNK16", "Heatshrink sleeving", 2.0, 1.6, "grey"];
HSHRNK24 = ["HSHRNK24", "Heatshrink sleeving", 2.8, 2.4, "grey"]; HSHRNK24 = ["HSHRNK24", "Heatshrink sleeving", 2.8, 2.4, "grey"];
HSHRNK32 = ["HSHRNK32", "Heatshrink sleeving", 3.6, 3.2, "grey"]; HSHRNK32 = ["HSHRNK32", "Heatshrink sleeving", 3.6, 3.2, "grey"];
HSHRNK64 = ["HSHRNK64", "Heatshrink sleeving", 6.8, 6.4, "grey"]; HSHRNK64 = ["HSHRNK64", "Heatshrink sleeving", 6.8, 6.4, "grey"];
HSHRNK100 = ["HSHRNK100", "Heatshrink sleeving",10.4, 10.0, [0.2,0.2,0.2]]; HSHRNK100 = ["HSHRNK100", "Heatshrink sleeving", 10.4, 10.0, [0.2,0.2,0.2]];
CARBONFIBER10 = ["CBNFIB10", "Carbon fiber", 10.0, 8.0, [0.3,0.3,0.3]]; STFE4_3p2_CLR = ["STFE4_3p2_CLR", "PTFE heatshrink sleeving", 3.7, 3.2, [0.95, 0.95, 0.95, 0.5]];
STFE4_6p4_CLR = ["STFE4_6p4_CLR", "PTFE heatshrink sleeving", 7.0, 6.4, [0.95, 0.95, 0.95, 0.5]];
CARBONFIBER10 = ["CBNFIB10", "Carbon fiber", 10.0, 8.0, [0.3,0.3,0.3]];
tubings = [PVC64, PVC85, NEOP85, PTFE07, PTFE20, PF7, PTFE2_3, PTFE2_4, PTFE4_6, HSHRNK16, HSHRNK24, HSHRNK64, HSHRNK100, CARBONFIBER10]; tubings = [PVC64, PVC85, NEOP85, PTFE07, PTFE20, PF7, PTFE2_3, PTFE2_4, PTFE4_6, HSHRNK16, HSHRNK24, HSHRNK64, HSHRNK100, STFE4_3p2_CLR, STFE4_6p4_CLR, CARBONFIBER10];
use <tubing.scad> use <tubing.scad>

View File

@@ -60,13 +60,14 @@ module solder_meniscus(type, ir = 0.3, r = undef) { //! Draw a solder meniscus
} }
} }
module vero_grid_pos(type, x, y) { //! Convert grid position to offset from the centre function vero_grid_pos(type, x, y) = //! Convert grid position to offset from the centre
holes = vero_holes(type); let(holes = vero_holes(type), strips = vero_strips(type))
strips = vero_strips(type); [((x + holes) % holes) - holes / 2 + 0.5,
translate([((x + holes) % holes) - holes / 2 + 0.5, ((y + strips) % strips) - strips / 2 + 0.5] * vero_pitch(type);
((y + strips) % strips) - strips / 2 + 0.5] * vero_pitch(type))
module vero_grid_pos(type, x, y) //! Convert grid position to offset from the centre
translate(vero_grid_pos(type, x, y))
children(); children();
}
module vero_mounting_hole_positions(type) //! Positions children at the mounting holes module vero_mounting_hole_positions(type) //! Positions children at the mounting holes
for(p = vero_mounting_holes(type)) for(p = vero_mounting_holes(type))
@@ -147,23 +148,25 @@ module vero_components(type, cutouts = false, angle = undef)
module vero_cutouts(type, angle = undef) //! Make cutouts to clear components module vero_cutouts(type, angle = undef) //! Make cutouts to clear components
vero_components(type, true, angle); vero_components(type, true, angle);
module veroboard_assembly(type, height, thickness, flip = false, ngb = false) //! Draw the assembly with components and fasteners in place module veroboard_assembly(type, ngb = false) //! Draw the assembly with components
pose_vflip(exploded = true)
assembly(vero_assembly(type), ngb = ngb) { assembly(vero_assembly(type), ngb = ngb) {
veroboard(type);
vero_components(type);
for(r = vero_joints(type))
for(x = r.x, y = r.y)
vero_grid_pos(type, x, y)
vflip()
solder_meniscus(type);
}
module veroboard_fasteners(type, height, thickness, flip = false) { //! Draw the fasteners in place
screw = vero_screw(type); screw = vero_screw(type);
nut = screw_nut(screw); nut = screw_nut(screw);
screw_length = screw_length(screw, height + thickness + vero_thickness(type), 2, nyloc = true); screw_length = screw_length(screw, height + thickness + vero_thickness(type), 2, nyloc = true);
translate_z(height) {
veroboard(type);
vero_components(type);
for(r = vero_joints(type))
for(x = r.x, y = r.y)
vero_grid_pos(type, x, y)
vflip()
solder_meniscus(type);
}
vero_mounting_hole_positions(type) { vero_mounting_hole_positions(type) {
translate_z(height + vero_thickness(type)) translate_z(height + vero_thickness(type))
if(flip) if(flip)
@@ -181,3 +184,11 @@ assembly(vero_assembly(type), ngb = ngb) {
nut_and_washer(nut, true); nut_and_washer(nut, true);
} }
} }
module veroboard_fastened_assembly(type, height, thickness, flip = false, ngb = false) { //! Draw the assembly with components and fasteners in place
translate_z(height)
veroboard_assembly(type, ngb = ngb);
veroboard_fasteners(type, height, thickness, flip);
}

View File

@@ -25,8 +25,12 @@ use <../utils/sweep.scad>
use <../utils/maths.scad> use <../utils/maths.scad>
include <zipties.scad> include <zipties.scad>
module wire(colour, strands, length, strand = 0.2) //! Add stranded wire to the BOM module wire(colour, strands, length, strand = 0.2, d = 0, path = []) { //! Add stranded wire to the BOM and draw it if diameter and path specified
vitamin(str(": Wire ", colour, " ", strands, "/", strand, "mm strands, length ",length, "mm")); vitamin(str(": Wire ", colour, " ", strands, "/", strand, "mm strands, length ", ceil(length + path_length(path)), "mm"));
if(path && d)
color(colour) sweep(path, circle_points(r = d / 2));
}
module ribbon_cable(ways, length) //! Add ribbon cable to the BOM module ribbon_cable(ways, length) //! Add ribbon cable to the BOM
vitamin(str(": Ribbon cable ", ways, " way ", length, "mm")); vitamin(str(": Ribbon cable ", ways, " way ", length, "mm"));