1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-09-03 12:22:46 +02:00

Compare commits

...

74 Commits

Author SHA1 Message Date
Chris
664d04ad93 Now logs the time taken to run non OpenSCAD commands in cmd_times.txt 2022-07-16 08:21:17 +01:00
Chris
78b8c2031e Updated changelog. 2022-07-15 11:56:49 +01:00
Chris
2001de2408 Merge branch 'martinbudden-bldc_includes' 2022-07-15 11:55:01 +01:00
Chris
64fb562f58 Merge branch 'bldc_includes' of https://github.com/martinbudden/NopSCADlib into martinbudden-bldc_includes 2022-07-15 11:30:10 +01:00
Chris
bf163587fa Merge branch 'martinbudden-typos' 2022-07-15 11:29:37 +01:00
Chris
1238dba90a Updated readme. 2022-07-15 11:29:27 +01:00
Chris
f40a7d19a9 Merge branch 'typos' of https://github.com/martinbudden/NopSCADlib into martinbudden-typos 2022-07-15 09:13:36 +01:00
Chris
a054eb8216 Updated changelog. 2022-07-04 10:17:29 +01:00
Chris
05edd923b8 Merge branch 'MS3FGX-SOIC' 2022-07-04 10:16:04 +01:00
Chris
b58a59dab7 Updated images and readme. 2022-07-04 10:15:39 +01:00
Chris
6b6ffb2b74 Added SOICs to tests. 2022-07-04 10:15:01 +01:00
Chris
1e30ad24e8 Added smd_soic to pcb_component(). 2022-07-04 10:14:22 +01:00
Chris
dc715ff2b7 Tweaked SOIC text size. 2022-07-04 10:13:11 +01:00
MS3FGX
c57c202e31 Adjust lead sizing 2022-07-04 00:42:36 -04:00
MS3FGX
26bfe96614 Add SOIC SMD Package 2022-07-02 20:10:35 -04:00
Chris
fa49ae09fa Updated changelog. 2022-07-02 23:38:55 +01:00
Chris
974457eabd Merge branch 'MS3FGX-LED1206' 2022-07-02 23:37:01 +01:00
Chris
2cc3c6ec7c Updated images and readme. 2022-07-02 23:36:40 +01:00
Chris
633843d45e Added LED1206 example to PCB test. 2022-07-02 23:35:59 +01:00
MS3FGX
1a472c8ed5 Add 1206 SMD LED 2022-07-02 18:12:31 -04:00
Martin Budden
f44d9ae424 Made includes relative in bldc_motors. 2022-06-30 13:34:32 +01:00
Chris Palmer
4f0c443c8e Updated changelog. 2022-06-23 18:26:22 +01:00
Chris Palmer
ecd534b577 Added NEMA_connection_pos().
Changed motor wire colours and tweaked wire position and size,
2022-06-23 18:24:44 +01:00
Martin Budden
aec72118fa Fixed typos. 2022-06-22 06:02:36 +01:00
Chris Palmer
0d828f8f7f Updated changelog. 2022-06-21 12:35:00 +01:00
Chris Palmer
28c36a4e96 rounded_polygon() now copes with the degenrate case when tangents intersect to form a sharp corner with no arc.
Added an offset() function with some limitations.
2022-06-21 12:29:57 +01:00
Chris Palmer
1ddfb35bda Updated changelog. 2022-06-21 11:59:32 +01:00
Chris Palmer
235caa4101 Merge branch 'martinbudden-extrusion1515_dimensions' 2022-06-21 11:48:46 +01:00
Chris Palmer
6a9af0af8a Updates images 2022-06-21 11:48:15 +01:00
Chris Palmer
f066b1b8ae Merge branch 'extrusion1515_dimensions' of https://github.com/martinbudden/NopSCADlib into martinbudden-extrusion1515_dimensions 2022-06-21 11:39:31 +01:00
Chris Palmer
4be7b2f0ea Merge branch 'martinbudden-typos' 2022-06-21 11:14:45 +01:00
Chris Palmer
3cc3c52b54 Merge branch 'typos' of https://github.com/martinbudden/NopSCADlib into martinbudden-typos 2022-06-21 10:37:27 +01:00
Chris Palmer
7f1634ef06 Merge branch 'martinbudden-image_size' 2022-06-21 10:28:08 +01:00
Chris Palmer
34c8c31cae Merge branch 'image_size' of https://github.com/martinbudden/NopSCADlib into martinbudden-image_size 2022-06-21 10:26:03 +01:00
Martin Budden
a6a08088d9 Fixed dimensions of E1515 extrusion. 2022-06-21 08:32:13 +01:00
Martin Budden
06443a558b Standardised setting of imgsize in scripts. 2022-06-21 07:19:11 +01:00
Martin Budden
bcf9fb38df Fixed typos. 2022-06-21 06:54:08 +01:00
Chris Palmer
18f3d43780 Added convexity parameter to clip(). 2022-06-14 15:13:21 +01:00
Chris Palmer
eda88cc8d7 Fixed vero() constructor documentation.
Fixed missing space in veroboard vitamin decription.
2022-06-14 15:10:59 +01:00
Chris Palmer
630268d71a Changed screw_knob() facets to be suitable for 3D printing.
Fixed knob_height() so it can take a screw as a type.
2022-06-14 15:08:20 +01:00
Chris
66f793b00b Updated changelog. 2022-05-31 17:22:27 +01:00
Chris
cc5654d7d7 Added usb_miniA(). 2022-05-31 17:20:52 +01:00
Chris Palmer
9989f13edf Updated changelog. 2022-04-01 16:33:37 +01:00
Chris Palmer
d46913ce4f Printed screw_knob() is now fully customisable by passing a parameter
list, constructed by screw_knob(), in place of the screw.

Screws can still be passed for backwards compaibility.
2022-04-01 16:31:45 +01:00
Chris Palmer
b9f676a753 Documented insert_hole_length(). 2022-04-01 15:43:17 +01:00
Chris Palmer
1a649060bd Updated changelog. 2022-03-17 23:57:57 +00:00
Chris Palmer
68fd04f6d5 Merge branch 'MorrieG-master' 2022-03-17 23:56:03 +00:00
Chris Palmer
ddc4150ed7 Updated images and readme. 2022-03-17 23:55:41 +00:00
Chris Palmer
ed7e55808a Merge branch 'master' of https://github.com/MorrieG/NopSCADlib into MorrieG-master 2022-03-17 21:53:49 +00:00
Chris Palmer
3eff5fc2e0 Updated changelog. 2022-03-17 21:47:20 +00:00
Chris Palmer
744ebc2935 Added functions for generating twisted cable paths and calculating its radius.
Top row of cable bundles reversed to match a twisted cable.
2022-03-17 21:24:54 +00:00
Chris Palmer
99a5570e24 Fixed ziptie bug for small wires and corners made sharper. 2022-03-17 20:48:43 +00:00
Chris Palmer
b70911dc13 Image odd pixel changes due to move to summer computer. 2022-03-17 20:37:16 +00:00
Mozza
50d62b4170 Merge branch 'master' of https://github.com/MorrieG/NopSCADlib 2022-03-16 19:11:38 +11:00
Mozza
7e126c94ca Add A23 cell 2022-03-16 19:10:07 +11:00
Chris Palmer
2d20fb130a Removed dead code in spiral_paths(). 2022-03-01 08:12:30 +00:00
Chris Palmer
738c7914e2 Updated chnagelog. 2022-02-25 10:41:11 +00:00
Chris Palmer
7596bcacf4 Merge branch 'martinbudden-typos' 2022-02-25 10:38:21 +00:00
Chris Palmer
943deededf Updated the readme. 2022-02-25 10:37:33 +00:00
Chris Palmer
c8f16f4cdb Merge branch 'typos' of https://github.com/martinbudden/NopSCADlib into martinbudden-typos 2022-02-25 10:27:55 +00:00
Chris Palmer
a30aff9613 Fixed missing brackets for sheets with chamfered corners. 2022-02-25 10:27:23 +00:00
Martin Budden
c0d9067b74 Fixed typos. 2022-02-24 09:13:25 +00:00
Chris Palmer
7e8f03df2e Updated changelog. 2022-02-23 23:54:42 +00:00
Chris Palmer
f173284709 Can now inhibit exploded lines for issue #220. 2022-02-23 23:52:25 +00:00
Chris Palmer
6850953e71 Updated changelog. 2022-02-23 22:44:36 +00:00
Chris Palmer
2f60f568ff Merge branch 'martinbudden-washer_colour' 2022-02-23 22:42:49 +00:00
Chris Palmer
0206b2e868 Updated images. 2022-02-23 22:42:27 +00:00
Chris Palmer
38e2a22a11 Merge branch 'washer_colour' of https://github.com/martinbudden/NopSCADlib into martinbudden-washer_colour 2022-02-23 21:41:54 +00:00
Chris Palmer
4f68353f70 Updated changelog. 2022-02-23 21:13:13 +00:00
Chris Palmer
fbaae66d27 Merge branch 'martinbudden-nema_name' 2022-02-23 21:06:31 +00:00
Chris Palmer
f8d17c6f16 Updated readme. 2022-02-23 21:06:13 +00:00
Chris Palmer
97a6a65158 Merge branch 'nema_name' of https://github.com/martinbudden/NopSCADlib into martinbudden-nema_name 2022-02-23 20:16:43 +00:00
Martin Budden
662db2bd41 Improved stepper motor naming convention. 2022-02-22 10:14:51 +00:00
Martin Budden
1ac5a6f6cb Made hard washers slightly lighter.
This means they can be distinguished from bolts when viewed from directly
above.
2022-02-03 12:47:54 +00:00
78 changed files with 640 additions and 194 deletions

1
.gitignore vendored
View File

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

View File

@@ -3,6 +3,114 @@
This changelog is generated by `changelog.py` using manually added semantic version tags to classify commits as breaking changes, additions or fixes.
#### [v20.10.1](https://github.com/nophead/NopSCADlib/releases/tag/v20.10.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v20.10.0...v20.10.1 "diff with v20.10.0")
* 2022-06-30 [`f44d9ae`](https://github.com/nophead/NopSCADlib/commit/f44d9ae424f407baa4f8b5187819b43b30800257 "show commit") [M.B.](# "Martin Budden") Made includes relative in `bldc_motors`.
* 2022-07-15 [`1238dba`](https://github.com/nophead/NopSCADlib/commit/1238dba90ac5c48ba01abb9e7926a064353489de "show commit") [C.](# "Chris") Updated readme.
* 2022-06-22 [`aec7211`](https://github.com/nophead/NopSCADlib/commit/aec72118fac218ca033264fa7b28db2bff7db10a "show commit") [M.B.](# "Martin Budden") Fixed typos.
### [v20.10.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.10.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.9.0...v20.10.0 "diff with v20.9.0")
* 2022-07-04 [`b58a59d`](https://github.com/nophead/NopSCADlib/commit/b58a59dab70bb414dd90dc5a9055d6bf3b4f6144 "show commit") [C.](# "Chris") Updated images and readme.
* 2022-07-04 [`6b6ffb2`](https://github.com/nophead/NopSCADlib/commit/6b6ffb2b74cc89ffecbcad7c304c3c4f047a8805 "show commit") [C.](# "Chris") Added SOICs to tests.
* 2022-07-04 [`1e30ad2`](https://github.com/nophead/NopSCADlib/commit/1e30ad24e802dc6e075fd73185551202101d4793 "show commit") [C.](# "Chris") Added `smd_soic` to `pcb_component()`.
* 2022-07-04 [`dc715ff`](https://github.com/nophead/NopSCADlib/commit/dc715ff2b70ae98615ee43750f3bb7613b481f7b "show commit") [C.](# "Chris") Tweaked SOIC text size.
* 2022-07-04 [`c57c202`](https://github.com/nophead/NopSCADlib/commit/c57c202e31c70351f38ef6299c60b0deb54bd296 "show commit") [M.](# "MS3FGX") Adjust lead sizing
* 2022-07-02 [`26bfe96`](https://github.com/nophead/NopSCADlib/commit/26bfe96614741206c8da6d126edfa9eb5326cb8f "show commit") [M.](# "MS3FGX") Add SOIC SMD Package
### [v20.9.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.9.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.8.0...v20.9.0 "diff with v20.8.0")
* 2022-07-02 [`2cc3c6e`](https://github.com/nophead/NopSCADlib/commit/2cc3c6ec7c9d8ee285d49111559d40fb2a3112e1 "show commit") [C.](# "Chris") Updated images and readme.
* 2022-07-02 [`633843d`](https://github.com/nophead/NopSCADlib/commit/633843d45eacd42619581a4619752700e1cd687b "show commit") [C.](# "Chris") Added LED1206 example to PCB test.
* 2022-07-02 [`1a472c8`](https://github.com/nophead/NopSCADlib/commit/1a472c8ed549e230f7df93989f3e1db729b4b281 "show commit") [M.](# "MS3FGX") Add 1206 SMD LED
### [v20.8.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.8.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.7.0...v20.8.0 "diff with v20.7.0")
* 2022-06-23 [`ecd534b`](https://github.com/nophead/NopSCADlib/commit/ecd534b5773928b9987023bd4370f661cc750fbd "show commit") [C.P.](# "Chris Palmer") Added `NEMA_connection_pos()`.
Changed motor wire colours and tweaked wire position and size,
### [v20.7.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.7.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.6.1...v20.7.0 "diff with v20.6.1")
* 2022-06-21 [`28c36a4`](https://github.com/nophead/NopSCADlib/commit/28c36a4e966cceccbbdc330cf9a6fdeaa0283889 "show commit") [C.P.](# "Chris Palmer") `rounded_polygon()` now copes with the degenerate case when tangents intersect to form a sharp corner with no arc.
Added an `offset()` function with some limitations.
#### [v20.6.1](https://github.com/nophead/NopSCADlib/releases/tag/v20.6.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v20.6.0...v20.6.1 "diff with v20.6.0")
* 2022-06-21 [`6a9af0a`](https://github.com/nophead/NopSCADlib/commit/6a9af0af8aef68978b8be248810d07c85150341b "show commit") [C.P.](# "Chris Palmer") Updates images
* 2022-06-21 [`a6a0808`](https://github.com/nophead/NopSCADlib/commit/a6a08088d986dbcbc4d01c06e0475176ec8bc76f "show commit") [M.B.](# "Martin Budden") Fixed dimensions of E1515 extrusion.
* 2022-06-21 [`bcf9fb3`](https://github.com/nophead/NopSCADlib/commit/bcf9fb38dfabaf93508a380b85b12e3b23f28cf8 "show commit") [M.B.](# "Martin Budden") Fixed typos.
* 2022-06-21 [`06443a5`](https://github.com/nophead/NopSCADlib/commit/06443a558b407292a1e73f60c24cc90ec618d511 "show commit") [M.B.](# "Martin Budden") Standardised setting of imgsize in scripts.
### [v20.6.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.6.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.5.1...v20.6.0 "diff with v20.5.1")
* 2022-06-14 [`18f3d43`](https://github.com/nophead/NopSCADlib/commit/18f3d43780d7e083fc3b21290db2049fb4364a46 "show commit") [C.P.](# "Chris Palmer") Added convexity parameter to `clip()`.
#### [v20.5.1](https://github.com/nophead/NopSCADlib/releases/tag/v20.5.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v20.5.0...v20.5.1 "diff with v20.5.0")
* 2022-06-14 [`eda88cc`](https://github.com/nophead/NopSCADlib/commit/eda88cc8d75eb4c0cb59b368b4e2ad3db2115834 "show commit") [C.P.](# "Chris Palmer") Fixed `vero()` constructor documentation.
Fixed missing space in veroboard vitamin description.
* 2022-06-14 [`630268d`](https://github.com/nophead/NopSCADlib/commit/630268d71a0b478c28b6bde2a7c3ff9074c7a8fb "show commit") [C.P.](# "Chris Palmer") Changed `screw_knob()` facets to be suitable for 3D printing.
Fixed `knob_height()` so it can take a screw as a type.
### [v20.5.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.5.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.4.0...v20.5.0 "diff with v20.4.0")
* 2022-05-31 [`cc5654d`](https://github.com/nophead/NopSCADlib/commit/cc5654d7d756287f5311e35104003f38a4a94475 "show commit") [C.](# "Chris") Added `usb_miniA()`.
### [v20.4.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.4.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.3.1...v20.4.0 "diff with v20.3.1")
* 2022-04-01 [`d46913c`](https://github.com/nophead/NopSCADlib/commit/d46913ce4f64656889fd29dccc0709d84d4d9c49 "show commit") [C.P.](# "Chris Palmer") Printed `screw_knob()` is now fully customisable by passing a parameter
list, constructed by `screw_knob(),` in place of the screw.
* Screws can still be passed for backwards compatibility.
#### [v20.3.1](https://github.com/nophead/NopSCADlib/releases/tag/v20.3.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v20.3.0...v20.3.1 "diff with v20.3.0")
* 2022-04-01 [`b9f676a`](https://github.com/nophead/NopSCADlib/commit/b9f676a75369d666540f79abe0392e209e20d0f0 "show commit") [C.P.](# "Chris Palmer") Documented `insert_hole_length()`.
### [v20.3.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.3.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.2.0...v20.3.0 "diff with v20.2.0")
* 2022-03-17 [`ddc4150`](https://github.com/nophead/NopSCADlib/commit/ddc4150ed73c8300bc3ef4326a91cd4ec54ed9e3 "show commit") [C.P.](# "Chris Palmer") Updated images and readme.
* 2022-03-16 [`7e126c9`](https://github.com/nophead/NopSCADlib/commit/7e126c94cadd120d686eaad8459723e0c1dfc0b2 "show commit") [M.](# "Mozza") Add A23 cell
### [v20.2.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.2.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.1.2...v20.2.0 "diff with v20.1.2")
* 2022-03-17 [`744ebc2`](https://github.com/nophead/NopSCADlib/commit/744ebc293594e2d049220bba7325f3a22f40a71a "show commit") [C.P.](# "Chris Palmer") Added functions for generating twisted cable paths and calculating its radius.
Top row of cable bundles reversed to match a twisted cable.
#### [v20.1.2](https://github.com/nophead/NopSCADlib/releases/tag/v20.1.2 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v20.1.1...v20.1.2 "diff with v20.1.1")
* 2022-03-17 [`99a5570`](https://github.com/nophead/NopSCADlib/commit/99a5570e248be32747bead61e17feaa3bde13f9b "show commit") [C.P.](# "Chris Palmer") Fixed ziptie bug for small wires and corners made sharper.
* 2022-03-17 [`b70911d`](https://github.com/nophead/NopSCADlib/commit/b70911dc132727f24798e92be06a87ab37f2917e "show commit") [C.P.](# "Chris Palmer") Image odd pixel changes due to move to summer computer.
* 2022-03-01 [`2d20fb1`](https://github.com/nophead/NopSCADlib/commit/2d20fb130a260b1f7358ea9fbb9fca2b5a18a65b "show commit") [C.P.](# "Chris Palmer") Removed dead code in `spiral_paths()`.
#### [v20.1.1](https://github.com/nophead/NopSCADlib/releases/tag/v20.1.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v20.1.0...v20.1.1 "diff with v20.1.0")
* 2022-02-25 [`943deed`](https://github.com/nophead/NopSCADlib/commit/943deededfe2b258f23ca64001ae7c010ed626bc "show commit") [C.P.](# "Chris Palmer") Updated the readme.
* 2022-02-24 [`c0d9067`](https://github.com/nophead/NopSCADlib/commit/c0d9067b740fc5ea4a41e696c88613a284685118 "show commit") [M.B.](# "Martin Budden") Fixed typos.
* 2022-02-25 [`a30aff9`](https://github.com/nophead/NopSCADlib/commit/a30aff9613f51092bbad7052bfe1194a61557efc "show commit") [C.P.](# "Chris Palmer") Fixed missing brackets for sheets with chamfered corners.
### [v20.1.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.1.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.0.1...v20.1.0 "diff with v20.0.1")
* 2022-02-23 [`f173284`](https://github.com/nophead/NopSCADlib/commit/f173284709acdbd32de21f0d27cb3ab10b42eb2a "show commit") [C.P.](# "Chris Palmer") Can now inhibit exploded lines for issue [#220](https://github.com/nophead/NopSCADlib/issues/220 "show issue").
#### [v20.0.1](https://github.com/nophead/NopSCADlib/releases/tag/v20.0.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v20.0.0...v20.0.1 "diff with v20.0.0")
* 2022-02-23 [`0206b2e`](https://github.com/nophead/NopSCADlib/commit/0206b2e868119b3b5fdea6111839bf5055eae438 "show commit") [C.P.](# "Chris Palmer") Updated images.
* 2022-02-03 [`1ac5a6f`](https://github.com/nophead/NopSCADlib/commit/1ac5a6f6cbe518646f19c4372a2393eb2e020a18 "show commit") [M.B.](# "Martin Budden") Made hard washers slightly lighter.
This means they can be distinguished from bolts when viewed from directly
above.
## [v20.0.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.0.0 "show release") Breaking Changes [...](https://github.com/nophead/NopSCADlib/compare/v19.21.0...v20.0.0 "diff with v19.21.0")
* 2022-02-23 [`f8d17c6`](https://github.com/nophead/NopSCADlib/commit/f8d17c6f1615b9ff9b615ad2947c4b0119bf7597 "show commit") [C.P.](# "Chris Palmer") Updated readme.
* 2022-02-22 [`662db2b`](https://github.com/nophead/NopSCADlib/commit/662db2bd4103dbeb4265c148d5f7e31c98d5dae2 "show commit") [M.B.](# "Martin Budden") Improved stepper motor naming convention.
### [v19.21.0](https://github.com/nophead/NopSCADlib/releases/tag/v19.21.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v19.20.0...v19.21.0 "diff with v19.20.0")
* 2022-02-23 [`42fccc1`](https://github.com/nophead/NopSCADlib/commit/42fccc1afbf28ef6a94f0480d1306e5bc2e48e46 "show commit") [C.P.](# "Chris Palmer") Added `bezier_join()`.
Moved `path_length()` from `sweep.scad` to `maths.scad`.
### [v19.20.0](https://github.com/nophead/NopSCADlib/releases/tag/v19.20.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v19.9.1...v19.20.0 "diff with v19.9.1")
* 2022-02-15 [`0e2778e`](https://github.com/nophead/NopSCADlib/commit/0e2778e13de2e68fc21a7b4c706aada27a17842c "show commit") [C.P.](# "Chris Palmer") Cables can now have a list of wire colours.
Added a constructor for cables.
@@ -366,8 +474,6 @@ Fixed `M6_cs_cap_screw` and `M4_grub_screw` socket sizes.
#### [v15.21.1](https://github.com/nophead/NopSCADlib/releases/tag/v15.21.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v15.21.0...v15.21.1 "diff with v15.21.0")
* 2021-08-09 [`be53547`](https://github.com/nophead/NopSCADlib/commit/be53547728834d8e786ad4cb5637c768320a3105 "show commit") [M.B.](# "Martin Budden") Fixed display of BLDC prop shaft when thread length `=` 0.
* 2021-07-04 [`ba7d7d3`](https://github.com/nophead/NopSCADlib/commit/ba7d7d32adf554d163143c0ae1707565340bb35b "show commit") [C.P.](# "Chris Palmer") Updated chnagelog.
### [v15.21.0](https://github.com/nophead/NopSCADlib/releases/tag/v15.21.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v15.20.0...v15.21.0 "diff with v15.20.0")
* 2021-07-01 [`df35e14`](https://github.com/nophead/NopSCADlib/commit/df35e14fc71794c3826d6c99ce3cab93a4cfa5fe "show commit") [M.B.](# "Martin Budden") Improved handling of pcb plating colour.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 982 KiB

After

Width:  |  Height:  |  Size: 984 KiB

View File

@@ -163,14 +163,11 @@ corner_blocks_y = fixing_blocks_y + 30;
translate([x5, corner_blocks_y])
corner_blocks();
feet_y = corner_blocks_y + 70;
translate([x5, feet_y])
feet();
translate([x5 + 70, feet_y])
screw_knobs_y = corner_blocks_y + 70;
translate([x5, screw_knobs_y])
screw_knobs();
knobs_y = feet_y + 40;
knobs_y = screw_knobs_y + 40;
translate([640, knobs_y])
printed_pulley_test();
@@ -185,6 +182,9 @@ strap_y = clips_y + 50;
translate([x5 + 60, strap_y])
strap_handles();
translate([x6, strap_y])
feet();
handle_y = strap_y + 50;
translate([x5, handle_y])
handle();

View File

@@ -31,7 +31,7 @@
//! Star washers can be omitted by setting `star_washers` to false.
//!
//! A 2screw_block is a thinner version with two screws and two mating surfaces. It can be used as an alternative to fixing blocks when
//! high lateral rigity is not required.
//! high lateral rigidity is not required.
//
include <../core.scad>
use <../vitamins/insert.scad>

View File

@@ -20,7 +20,7 @@
//
//! Parametric knobs for potentiometers and encoders.
//!
//! A knob can be constructed by specififying all the parameters or the potentiometer can be specified to customise it for its shaft with a recess to clear the nut, washer and thread.
//! A knob can be constructed by specifying all the parameters or the potentiometer can be specified to customise it for its shaft with a recess to clear the nut, washer and thread.
//! An optional skirt and / or a pointer can be specified.
//!
//! The STL includes a support membrane that needs to be cut out and a thread needs to be tapped for the grub screw.

View File

@@ -20,7 +20,7 @@
//
//! Clamp for ribbon cable and polypropylene strip or one or more ribbon cables.
//!
//! * When `ways` is a scalar number the slot is sized for one rubbon cable and a PP strip.
//! * When `ways` is a scalar number the slot is sized for one ribbon cable and a PP strip.
//! * When `ways` is a two element vector the second element indicates the number of cables and the slot is size for just the cables.
//
include <../core.scad>

View File

@@ -19,53 +19,102 @@
//
//! Knob with embedded hex head screw.
//!
//! Most aspects can be customised, e.g. the flange thickness and radius. It can also be solid or just a wall and be wavey edged or fluted.
//
include <../core.scad>
use <../utils/hanging_hole.scad>
knob_wall = 2;
function screw_knob_screw(type) = type[0]; //! The hex screw
function screw_knob_wall(type) = type[1]; //! Wall thickness
function screw_knob_stem_h(type) = type[2]; //! The stem height below the flange
function screw_knob_flange_t(type) = type[3]; //! The thickness of the flange
function screw_knob_flange_r(type) = type[4]; //! The flange outside radius
function screw_knob_solid(type) = type[5]; //! Is the flange solid or just a wall
function screw_knob_waves(type) = type[6]; //! Number of waves around the flange edge
function screw_knob_wave_amp(type) = type[7]; //! Wave amplitude
function screw_knob_fluted(type) = type[8]; //! Fluted instead of sine wave
function screw_knob(screw, wall = 2, stem_h = 6, flange_t = 4, flange_r = 9, solid = true, waves = 5, wave_amp = 2, fluted = false) = //! Constructor
[screw, wall, stem_h, flange_t, flange_r, solid, waves, wave_amp, fluted];
function knob_nut_trap_depth(screw) = round_to_layer(screw_head_height(screw));
knob_stem_h = 6;
knob_thickness = 4;
knob_r = 8;
knob_wave = 1;
knob_waves = 5;
knob_height = knob_stem_h + knob_thickness;
function knob_height() = knob_height;
function knob_height(type) = //! Total height of the knob
let(type = !is_list(type[0]) ? screw_knob(type) : type)
screw_knob_stem_h(type) + screw_knob_flange_t(type);
module screw_knob(screw) { //! Generate the STL for a knob to fit the specified hex screw
knob_stem_r = nut_trap_radius(screw_nut(screw)) + knob_wall;
module screw_knob(type) { //! Generate the STL for a knob to fit the specified hex screw
type = !is_list(type[0]) ? screw_knob(type) : type; // Allow just the screw to be specified for backwards compatibility
screw = screw_knob_screw(type);
wall = screw_knob_wall(type);
trap_r = nut_trap_radius(screw_nut(screw));
stem_r = trap_r + wall;
amp = screw_knob_wave_amp(type);
flange_r = max(screw_knob_flange_r(type), stem_r + amp);
flange_t = screw_knob_flange_t(type);
knob_h = knob_height(type);
waves = screw_knob_waves(type);
function wave(a) = knob_r + sin(a * knob_waves) * knob_wave;
function wave(a) = flange_r - amp / 2 + sin(a * waves) * amp / 2;
fn = r2sides(flange_r);
points = [for(i = [0 : fn - 1], a = i * 360 / fn) wave(a) * [sin(a), cos(a)]];
solid = screw_knob_solid(type);
module shape()
if(screw_knob_fluted(type))
difference() {
circle4n(flange_r);
c = flange_r * sin(90 / waves); // Flute half chord
d = flange_r - flange_r * cos(90 / waves); // Distance from chord to perimeter
b = amp - d; // Distance from chord to flute bottom
flute_r = (b^2 + c^2) / b / 2;
for(i = [0 : waves - 1])
rotate(360 * i / waves)
translate([0, flange_r - amp + flute_r])
circle4n(flute_r);
}
else
polygon(points);
stl(str("screw_knob_M", screw_radius(screw) * 20))
union() {
render() difference() {
cylinder(r = knob_stem_r, h = knob_thickness + knob_stem_h);
cylinder(r = stem_r, h = knob_h);
hanging_hole(knob_nut_trap_depth(screw), screw_clearance_radius(screw))
rotate(45)
circle(r = nut_trap_radius(screw_nut(screw)), $fn = 6);
circle(r = trap_r, $fn = 6);
}
linear_extrude(knob_thickness, convexity = 3)
difference() {
polygon(points = [for(a = [0 : 359]) [wave(a) * sin(a), wave(a) * cos(a)]]);
for(i = [0 : 1])
linear_extrude(i ? flange_t : round_to_layer(wall), convexity = 3)
difference() {
shape();
circle(knob_stem_r - eps);
}
if(i && ! solid)
offset(-wall)
shape();
circle(stem_r - eps);
}
}
}
//! Place the screw through the printed part
module screw_knob_assembly(screw, length) //! Assembly with the screw in place
assembly(str("screw_knob_M", 20 * screw_radius(screw), "_", length), ngb = true) {
translate_z(knob_height)
vflip()
stl_colour(pp1_colour) screw_knob(screw);
module screw_knob_assembly(type, length) { //! Assembly with the screw in place
type = !is_list(type[0]) ? screw_knob(type) : type;
screw = screw_knob_screw(type);
knob_h = knob_height(type);
translate_z(knob_height - knob_nut_trap_depth(screw))
rotate(-45)
screw(screw, length);
assembly(str("screw_knob_M", 20 * screw_radius(screw), "_", length), ngb = true) {
translate_z(knob_h)
vflip()
stl_colour(pp1_colour) screw_knob(type);
translate_z(knob_h - knob_nut_trap_depth(screw))
rotate(-45)
screw(screw, length);
}
}
module screw_knob_M30_stl() screw_knob(M3_hex_screw);

119
readme.md
View File

@@ -234,8 +234,9 @@ exposing enough information to make a battery box.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 6 | `battery_contact(bcontact, false)` | Battery negative contact |
| 6 | `battery_contact(bcontact, true)` | Battery positive contact |
| 7 | `battery_contact(bcontact, false)` | Battery negative contact |
| 7 | `battery_contact(bcontact, true)` | Battery positive contact |
| 1 | `battery(A23CELL)` | Cell A23 12v |
| 1 | `battery(AACELL)` | Cell AA |
| 1 | `battery(AAACELL)` | Cell AAA |
| 1 | `battery(CCELL)` | Cell C |
@@ -1511,6 +1512,7 @@ Heatfit threaded inserts. Can be pushed into thermoplastics using a soldering ir
| Function | Description |
|:--- |:--- |
| `insert_boss_radius(type, wall)` | Compute the outer radius of an insert boss |
| `insert_hole_length(type)` | Length of the insert rounded to layer height |
| `insert_nose_length(type, d)` | The length before the second ring. |
### Modules
@@ -2401,6 +2403,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| `usb_Ax2(cutout = false)` | Draw USB type A dual socket |
| `usb_B(cutout = false)` | Draw USB B connector |
| `usb_C(cutout = false)` | Draw USB C connector |
| `usb_miniA(cutout = false)` | Draw USB mini A connector |
| `usb_uA(cutout = false)` | Draw USB micro A connector |
| `vero_pin(cropped = false)` | Draw a vero pin |
@@ -2437,12 +2440,16 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `ax_res(res1_8, 1e+6, tol = 1)` | Resistor 1e+6 Ohms 1% 0.125W |
| 1 | `smd_led(LED0603, orange)` | SMD LED 0603 orange |
| 1 | `smd_led(LED0805, red)` | SMD LED 0805 red |
| 1 | `smd_led(LED1206, blue)` | SMD LED 1306 blue |
| 1 | `smd_capacitor(CAP0603)` | SMD capacitor 0603 |
| 1 | `smd_capacitor(CAP0805)` | SMD capacitor 0805 |
| 1 | `smd_capacitor(CAP1206)` | SMD capacitor 1206 |
| 1 | `smd_resistor(RES0603, 1K)` | SMD resistor 0603 1K 0.1W |
| 1 | `smd_resistor(RES0805, 1K)` | SMD resistor 0805 1K 0.125W |
| 1 | `smd_resistor(RES1206, 1K)` | SMD resistor 1206 1K 0.25W |
| 1 | `smd_soic(SOIC16)` | SOIC16 package ICL323 |
| 1 | `smd_soic(SOIC18)` | SOIC18 package PIC18F88 |
| 1 | `smd_soic(SOIC8)` | SOIC8 package M34063 |
| 1 | `smd_sot(SOT223)` | SOT223 package LM117 |
| 1 | `smd_sot(SOT23)` | SOT23 package 2N7000 |
| 1 | `square_button(button_4p5mm)` | Square button 4.5mm |
@@ -2551,6 +2558,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| `usb_Ax2(cutout = false)` | Draw USB type A dual socket |
| `usb_B(cutout = false)` | Draw USB B connector |
| `usb_C(cutout = false)` | Draw USB C connector |
| `usb_miniA(cutout = false)` | Draw USB mini A connector |
| `usb_uA(cutout = false)` | Draw USB micro A connector |
| `vero_pin(cropped = false)` | Draw a vero pin |
@@ -3639,6 +3647,12 @@ Surface mount components for PCBs.
| `smd_res_end_cap(type)` | End cap width |
| `smd_res_power(type)` | Power rating in Watts |
| `smd_res_size(type)` | Body length, width and height |
| `smd_soic_lead_pitch(type)` | Lead pitch |
| `smd_soic_lead_size(type)` | Lead width, foot depth, lead thickness |
| `smd_soic_lead_span(type)` | Total span of leads |
| `smd_soic_lead_z(type)` | Top of lead frame from top |
| `smd_soic_size(type)` | Body length, width and height |
| `smd_soic_z(type)` | Height above PCB surface |
| `smd_sot_lead_pitch(type)` | Lead pitch |
| `smd_sot_lead_size(type)` | Lead width, foot depth, lead thickness |
| `smd_sot_lead_span(type)` | Total span of leads |
@@ -3660,6 +3674,7 @@ Surface mount components for PCBs.
| `smd_capacitor(type, height, value = undef)` | Draw an SMD capacitor with specified height |
| `smd_led(type, colour, cutout)` | Draw an SMD LED with specified `colour` |
| `smd_resistor(type, value)` | Draw an SMD resistor with specified value |
| `smd_soic(type, value)` | Draw an SMD SOIC |
| `smd_sot(type, value)` | Draw an SMD transistor |
![smds](tests/png/smds.png)
@@ -3669,12 +3684,16 @@ Surface mount components for PCBs.
| ---:|:--- |:---|
| 1 | `smd_led(LED0603, green)` | SMD LED 0603 green |
| 1 | `smd_led(LED0805, blue)` | SMD LED 0805 blue |
| 1 | `smd_led(LED1206, red)` | SMD LED 1306 red |
| 1 | `smd_capacitor(CAP0603)` | SMD capacitor 0603 |
| 1 | `smd_capacitor(CAP0805)` | SMD capacitor 0805 |
| 1 | `smd_capacitor(CAP1206)` | SMD capacitor 1206 |
| 1 | `smd_resistor(RES0603, 1R0)` | SMD resistor 0603 1R0 0.1W |
| 1 | `smd_resistor(RES0805, 10M)` | SMD resistor 0805 10M 0.125W |
| 1 | `smd_resistor(RES1206, 100K)` | SMD resistor 1206 100K 0.25W |
| 1 | `smd_soic(SOIC16)` | SOIC16 package SOIC16 |
| 1 | `smd_soic(SOIC18)` | SOIC18 package SOIC18 |
| 1 | `smd_soic(SOIC8)` | SOIC8 package SOIC8 |
| 1 | `smd_sot(SOT223)` | SOT223 package FZT851 |
| 1 | `smd_sot(SOT23)` | SOT23 package 2N7000 |
@@ -3883,6 +3902,7 @@ NEMA stepper motor model.
| Function | Description |
|:--- |:--- |
| `NEMA_big_hole(type)` | Clearance hole for the big boss |
| `NEMA_connection_pos(type, jst_connector = false)` | Position of the wires or the connector |
| `NEMA_holes(type)` | Screw positions for for loop |
### Modules
@@ -3900,15 +3920,15 @@ NEMA stepper motor model.
| ---:|:--- |:---|
| 4 | `ring_terminal(M3_ringterm)` | Ring terminal 3mm |
| 20 | `screw(M3_pan_screw, 8)` | Screw M3 pan x 8mm |
| 1 | `NEMA(NEMA14)` | Stepper motor NEMA14 x 36mm |
| 1 | `NEMA(NEMA16)` | Stepper motor NEMA16 x 19.2mm |
| 1 | `NEMA(NEMA17P)` | Stepper motor NEMA17 x 26.5mm |
| 1 | `NEMA(NEMA17S)` | Stepper motor NEMA17 x 34mm |
| 1 | `NEMA(NEMA17M)` | Stepper motor NEMA17 x 40mm |
| 1 | `NEMA(NEMA17)` | Stepper motor NEMA17 x 47mm |
| 1 | `NEMA(NEMA23)` | Stepper motor NEMA22 x 51.2mm |
| 1 | `NEMA(NEMA8)` | Stepper motor NEMA8 x 30mm |
| 1 | `NEMA(NEMA8BH)` | Stepper motor NEMA8 x 30mm |
| 1 | `NEMA(NEMA14_36)` | Stepper motor NEMA14 x 36mm |
| 1 | `NEMA(NEMA16_19)` | Stepper motor NEMA16 x 19.2mm |
| 1 | `NEMA(NEMA17_27)` | Stepper motor NEMA17 x 26.5mm |
| 1 | `NEMA(NEMA17_34)` | Stepper motor NEMA17 x 34mm |
| 1 | `NEMA(NEMA17_40)` | Stepper motor NEMA17 x 40mm |
| 1 | `NEMA(NEMA17_47)` | Stepper motor NEMA17 x 47mm |
| 1 | `NEMA(NEMA23_51)` | Stepper motor NEMA22 x 51.2mm |
| 1 | `NEMA(NEMA8_30)` | Stepper motor NEMA8 x 30mm |
| 1 | `NEMA(NEMA8_30BH)` | Stepper motor NEMA8 x 30mm |
| 16 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
| 20 | `star_washer(M3_washer)` | Washer star M3 x 0.5mm |
@@ -4242,7 +4262,7 @@ Veroboard with mounting holes, track breaks, removed tracks, solder points and c
### Functions
| Function | Description |
|:--- |:--- |
| `vero(name, assembly, holes, strips, pitch = inch(0.1)` | Constructor |
| `vero(name, assembly, holes, strips, pitch = 2.54, fr4 = false, screw = M3_cap_screw, mounting_holes = [], breaks = [], no_tracks = [], components = [], joints = [])` | Constructor |
| `vero_length(type)` | Length of the board |
| `vero_size(type)` | Board size |
| `vero_thickness(type)` | Thickness of the substrate |
@@ -4270,7 +4290,7 @@ Veroboard with mounting holes, track breaks, removed tracks, solder points and c
| 4 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc |
| 4 | `screw(M3_dome_screw, 25)` | Screw M3 dome x 25mm |
| 2 | `green_terminal(gt_2p54, 10)` | Terminal block 10 way 0.1" |
| 2 | `veroboard(z_vb)` | Veroboard 5 holes x 22strips |
| 2 | `veroboard(z_vb)` | Veroboard 5 holes x 22 strips |
| 8 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
### Printed
@@ -4382,7 +4402,7 @@ If a washer is given a child, usually a screw or a nut, then it is placed on its
---
<a name="Wire"></a>
## Wire
Just a BOM entry at the moment and cable bundle size functions for holes, plus cable ties.
Utilities for adding wires to the BOM and optionally drawing them and cable bundle size functions for holes, plus cable ties.
[vitamins/wire.scad](vitamins/wire.scad) Implementation.
@@ -4391,21 +4411,25 @@ Just a BOM entry at the moment and cable bundle size functions for holes, plus c
### Functions
| Function | Description |
|:--- |:--- |
| `cable(wires, size, colours, ribbon = false)` | Cable constructor |
| `cable_bundle(cable)` | Arrangement of a bundle in a flat cable clip |
| `cable(wires, size, colours, ribbon = false, tlen = 25)` | Cable constructor |
| `cable_bundle(cable)` | Dimensions of the bounding rectangle of a bundle of wires in a flat cable clip |
| `cable_bundle_positions(cable)` | Positions of wires in a bundle to go through a cable strip |
| `cable_height(cable)` | Height in flat clip |
| `cable_is_ribbon(cable)` | Is a ribbon cable? |
| `cable_radius(cable)` | Radius of a bundle of wires, see <http://mathworld.wolfram.com/CirclePacking.html>. |
| `cable_tlen(cable)` | Twisted cable twist length |
| `cable_twisted_radius(cable)` | Approximate radius of a cable when twisted |
| `cable_width(cable)` | Width in flat clip |
| `cable_wire_colours(cable)` | Individual wire colours |
| `cable_wire_size(cable)` | Size of each wire in a bundle |
| `cable_wires(cable)` | Number of wires in a bundle |
| `twisted_cable(cable, path, irot = 0, frot = 0)` | Return the paths for a twisted cable, `irot` is the initial rotation and frot the final rotation |
| `wire_hole_radius(cable)` | Radius of a hole to accept a bundle of wires, rounded up to standard metric drill size |
### Modules
| Module | Description |
|:--- |:--- |
| `cable(cable, paths)` | Draw a cable, given a list of paths |
| `cable_tie(cable_r, thickness)` | A ziptie threaded around cable radius `cable_r` and through a panel with specified `thickness`. |
| `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. |
@@ -4417,13 +4441,13 @@ Just a BOM entry at the moment and cable bundle size functions for holes, plus c
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | | Wire black 7/0.2mm strands, length 90mm |
| 1 | | Wire blue 7/0.2mm strands, length 90mm |
| 1 | | Wire brown 7/0.2mm strands, length 90mm |
| 1 | | Wire green 7/0.2mm strands, length 90mm |
| 1 | | Wire orange 7/0.2mm strands, length 90mm |
| 1 | | Wire red 7/0.2mm strands, length 90mm |
| 1 | | Wire yellow 7/0.2mm strands, length 90mm |
| 1 | | Wire black 7/0.2mm strands, length 60mm |
| 1 | | Wire blue 7/0.2mm strands, length 60mm |
| 1 | | Wire brown 7/0.2mm strands, length 60mm |
| 1 | | Wire green 7/0.2mm strands, length 60mm |
| 1 | | Wire orange 7/0.2mm strands, length 60mm |
| 1 | | Wire red 7/0.2mm strands, length 60mm |
| 1 | | Wire yellow 7/0.2mm strands, length 60mm |
| 1 | `ziptie(small_ziptie)` | Ziptie 2.5mm x 100mm min length |
@@ -4890,7 +4914,7 @@ This allows the block and one set of fasteners to be on one assembly and the oth
Star washers can be omitted by setting `star_washers` to false.
A 2screw_block is a thinner version with two screws and two mating surfaces. It can be used as an alternative to fixing blocks when
high lateral rigity is not required.
high lateral rigidity is not required.
[printed/corner_block.scad](printed/corner_block.scad) Implementation.
@@ -5449,7 +5473,7 @@ Printed handle that can be printed without needing support material due to its t
## Knob
Parametric knobs for potentiometers and encoders.
A knob can be constructed by specififying all the parameters or the potentiometer can be specified to customise it for its shaft with a recess to clear the nut, washer and thread.
A knob can be constructed by specifying all the parameters or the potentiometer can be specified to customise it for its shaft with a recess to clear the nut, washer and thread.
An optional skirt and / or a pointer can be specified.
The STL includes a support membrane that needs to be cut out and a thread needs to be tapped for the grub screw.
@@ -5847,7 +5871,7 @@ The stl and assembly must be given a name and parameterless wrappers for the stl
## Ribbon_clamp
Clamp for ribbon cable and polypropylene strip or one or more ribbon cables.
* When `ways` is a scalar number the slot is sized for one rubbon cable and a PP strip.
* When `ways` is a scalar number the slot is sized for one ribbon cable and a PP strip.
* When `ways` is a two element vector the second element indicates the number of cables and the slot is size for just the cables.
[printed/ribbon_clamp.scad](printed/ribbon_clamp.scad) Implementation.
@@ -5908,15 +5932,36 @@ Clamp for ribbon cable and polypropylene strip or one or more ribbon cables.
## Screw_knob
Knob with embedded hex head screw.
Most aspects can be customised, e.g. the flange thickness and radius. It can also be solid or just a wall and be wavey edged or fluted.
[printed/screw_knob.scad](printed/screw_knob.scad) Implementation.
[tests/screw_knob.scad](tests/screw_knob.scad) Code for this example.
### Properties
| Function | Description |
|:--- |:--- |
| `screw_knob_flange_r(type)` | The flange outside radius |
| `screw_knob_flange_t(type)` | The thickness of the flange |
| `screw_knob_fluted(type)` | Fluted instead of sine wave |
| `screw_knob_screw(type)` | The hex screw |
| `screw_knob_solid(type)` | Is the flange solid or just a wall |
| `screw_knob_stem_h(type)` | The stem height below the flange |
| `screw_knob_wall(type)` | Wall thickness |
| `screw_knob_wave_amp(type)` | Wave amplitude |
| `screw_knob_waves(type)` | Number of waves around the flange edge |
### Functions
| Function | Description |
|:--- |:--- |
| `knob_height(type)` | Total height of the knob |
| `screw_knob(screw, wall = 2, stem_h = 6, flange_t = 4, flange_r = 9, solid = true, waves = 5, wave_amp = 2, fluted = false)` | Constructor |
### Modules
| Module | Description |
|:--- |:--- |
| `screw_knob(screw)` | Generate the STL for a knob to fit the specified hex screw |
| `screw_knob_assembly(screw, length)` | Assembly with the screw in place |
| `screw_knob(type)` | Generate the STL for a knob to fit the specified hex screw |
| `screw_knob_assembly(type, length)` | Assembly with the screw in place |
![screw_knob](tests/png/screw_knob.png)
@@ -5925,18 +5970,24 @@ Knob with embedded hex head screw.
| ---:|:--- |:---|
| 1 | `screw(M3_hex_screw, 16)` | Screw M3 hex x 16mm |
| 1 | `screw(M4_hex_screw, 16)` | Screw M4 hex x 16mm |
| 1 | `screw(M5_hex_screw, 16)` | Screw M5 hex x 16mm |
| 1 | `screw(M6_hex_screw, 16)` | Screw M6 hex x 16mm |
### Printed
| Qty | Filename |
| ---:|:--- |
| 1 | screw_knob_M30.stl |
| 1 | screw_knob_M40.stl |
| 1 | screw_knob_M50.stl |
| 1 | screw_knob_M60.stl |
### Assemblies
| Qty | Name |
| ---:|:--- |
| 1 | screw_knob_M30_16_assembly |
| 1 | screw_knob_M40_16_assembly |
| 1 | screw_knob_M50_16_assembly |
| 1 | screw_knob_M60_16_assembly |
<a href="#top">Top</a>
@@ -6242,7 +6293,7 @@ allows flexible positioning of the motors.
| 2 | `pulley(GT2x20ob_pulley)` | Pulley GT2OB 20 teeth |
| 8 | `screw(M3_cap_screw, 20)` | Screw M3 cap x 20mm |
| 4 | `screw(M3_grub_screw, 6)` | Screw M3 grub x 6mm |
| 2 | `NEMA(NEMA17M)` | Stepper motor NEMA17 x 40mm |
| 2 | `NEMA(NEMA17_40)` | Stepper motor NEMA17 x 40mm |
<a href="#top">Top</a>
@@ -6573,6 +6624,8 @@ Because the tangents need to be calculated to find the length these can be calcu
| Function | Description |
|:--- |:--- |
| `circle_tangent(p1, p2)` | Compute the clockwise tangent between two circles represented as [x,y,r] |
| `line_intersection(l0, l1)` | Return the point where two 2D lines intersect or undef if they don't. |
| `offset(points, offset)` | Offset a 2D polygon, breaks for concave shapes and negative offsets if the offset is more than half the smallest feature size. |
| `rounded_polygon(points, _tangents = undef)` | Return the rounded polygon from the point list, can pass the tangent list to save it being calculated |
| `rounded_polygon_arcs(points, tangents)` | Compute the arcs at the points, for each point [angle, rotate_angle, length] |
| `rounded_polygon_length(points, tangents)` | Calculate the length given the point list and the list of tangents computed by `rounded_polygon_tangents` |
@@ -6661,7 +6714,7 @@ Each vertex, apart from the first and the last, has an associated radius and the
| `rounded_path_vertices(path)` | Show the unrounded version of a rounded_path for debug |
| `segmented_path(path, min_segment)` | Add points to a path to enforce a minimum segment length |
| `skin_faces(points, npoints, facets, loop, offset = 0)` | Create the mesh for the swept volume without end caps |
| `spiral_paths(path, n, r, twists, start_angle)` | Create a new paths which sprial around the given path. Use for making twisted cables |
| `spiral_paths(path, n, r, twists, start_angle)` | Create a new paths which spiral around the given path. Use for making twisted cables |
| `sweep(path, profile, loop = false, twist = 0)` | Generate the point list and face list of the swept volume |
### Modules
@@ -6787,7 +6840,7 @@ The `pose()` module allows assembly views in the readme to be posed differently
|:--- |:--- |
| `assembly(name, big = undef, ngb = false)` | Name an assembly that will appear on the BOM, there needs to a module named `<name>_assembly` to make it. `big` can force big or small assembly diagrams. |
| `dxf(name)` | Name a dxf that will appear on the BOM, there needs to a module named `<name>_dxf` to make it |
| `explode(d, explode_children = false, offset = [0,0,0])` | Explode children by specified Z distance or vector `d`, option to explode grand children |
| `explode(d, explode_children = false, offset = [0,0,0], show_line = true)` | Explode children by specified Z distance or vector `d`, option to explode grand children |
| `hidden()` | Make item invisible, except on the BOM |
| `no_explode()` | Prevent children being exploded |
| `no_pose()` | Force children not to be posed even if parent is |
@@ -6807,7 +6860,7 @@ The `pose()` module allows assembly views in the readme to be posed differently
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `insert(F1BM3)` | Heatfit insert M3 |
| 1 | `widget(3)` | Rivit like thing for 3mm sheets |
| 1 | `widget(3)` | Rivet like thing for 3mm sheets |
| 1 | `screw(M3_cap_screw, 8)` | Screw M3 cap x 8mm |
| 1 | `sheet(PMMA3, 20, 20, 1)` | Sheet acrylic 20mm x 20mm x 3mm |
| 1 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
@@ -6848,7 +6901,7 @@ Original version by Doug Moen on the OpenSCAD forum
| Module | Description |
|:--- |:--- |
| `box(xmin, ymin, zmin, xmax, ymax, zmax)` | Construct a box given its bounds |
| `clip(xmin = -inf, ymin = -inf, zmin = -inf, xmax = inf, ymax = inf, zmax = inf)` | Clip child to specified boundaries |
| `clip(xmin = -inf, ymin = -inf, zmin = -inf, xmax = inf, ymax = inf, zmax = inf, convexity = 1)` | Clip child to specified boundaries |
![clip](tests/png/clip.png)

View File

@@ -157,11 +157,11 @@ if __name__ == '__main__':
break
j += 1
# Print verson info
# Print version info
print('%s [%s](%s "show release") %s %s' % ('#' * (level + 1), ver, url + '/releases/tag/' + ver, type, diff), file = file)
# Print commits excluding merges
if not c.comment.startswith('Merge branch') and not c.comment.startswith('Merge pull') and not re.match(r'U..ated chang.*log.*', c.comment):
if not c.comment.startswith('Merge branch') and not c.comment.startswith('Merge pull') and not re.match(r'U..ated ch.*log.*', c.comment):
print('* %s [`%s`](%s "show commit") %s %s\n' % (c.date, c.hash[:7], url + '/commit/' + c.hash, initials(c.author), fixup_comment(c.comment, url)), file = file)
do_cmd(('codespell -w -L od ' + filename).split())

View File

@@ -26,7 +26,7 @@ from set_config import *
from exports import bom_to_parts
import os
import openscad
from tests import do_cmd, update_image, colour_scheme, background
from tests import do_cmd, update_image, colour_scheme, background, image_size
from deps import mtime
from colorama import init
import json
@@ -95,7 +95,7 @@ def render(target, type):
render = "--preview" if type == 'stl' or colour != pp1 else "--render"
tmp_name = tmp_dir + '/' + part[:-4] + '.png'
dummy_deps_name = tmp_dir + '/tmp.deps' # work around for OpenSCAD issue #3879
openscad.run("-o", tmp_name, png_maker_name, colour_scheme, "--projection=p", "--imgsize=4096,4096", cam, render, "--autocenter", "--viewall", "-d", dummy_deps_name)
openscad.run("-o", tmp_name, png_maker_name, colour_scheme, "--projection=p", image_size, cam, render, "--autocenter", "--viewall", "-d", dummy_deps_name)
do_cmd(("magick "+ tmp_name + " -trim -resize 280x280 -background %s -gravity Center -extent 280x280 -bordercolor %s -border 10 %s"
% (background, background, tmp_name)).split())
update_image(tmp_name, png_name)

View File

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

View File

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

View File

@@ -25,7 +25,7 @@
from __future__ import print_function
from set_config import *
import openscad
from tests import do_cmd, update_image, colour_scheme, background
from tests import do_cmd, update_image, colour_scheme, background, image_size
import time
import times
import options
@@ -223,7 +223,7 @@ def views(target, do_assemblies = None):
target_def = ['-D$target="%s"' % target] if target else []
cwd_def = ['-D$cwd="%s"' % os.getcwd().replace('\\', '/')]
view_def = ['--viewall', '--autocenter'] if not (zoomed & (1 << explode)) else ['--camera=0,0,0,55,0,25,140']
openscad.run_list(["-o", tmp_name, png_maker_name] + options.list() + target_def + cwd_def + view_def + ["-D$pose=1", "-D$explode=%d" % explode, colour_scheme, "--projection=p", "--imgsize=4096,4096", "-d", dname]);
openscad.run_list(["-o", tmp_name, png_maker_name] + options.list() + target_def + cwd_def + view_def + ["-D$pose=1", "-D$explode=%d" % explode, colour_scheme, "--projection=p", image_size, "-d", dname]);
times.add_time(png_name, t)
do_cmd(["magick", tmp_name, "-trim", "-resize", "1004x1004", "-bordercolor", background, "-border", "10", tmp_name])
update_image(tmp_name, png_name)
@@ -422,7 +422,7 @@ def views(target, do_assemblies = None):
times.add_time(html_name, t)
times.print_times(pngs + [html_name])
#
# Make the printme.html by replacing empty spans that invisbly mark the page breaks by page break divs.
# Make the printme.html by replacing empty spans that invisibly mark the page breaks by page break divs.
#
with open(html_name, 'rt') as src:
lines = src.readlines()

View File

@@ -32,7 +32,7 @@ height = 10;
insert = screw_insert(screw);
module widget(thickness) {
vitamin(str("widget(", thickness, "): Rivit like thing for ", thickness, "mm sheets"));
vitamin(str("widget(", thickness, "): Rivet like thing for ", thickness, "mm sheets"));
t = 1;
color("silver") {
cylinder(d = 3, h = thickness + 2 * eps, center = true);
@@ -85,7 +85,7 @@ assembly("widget_top") {
module widget_assembly()
assembly("widget") {
widget_base_assembly(); // Note this is not exloded because it is sub-assembly
widget_base_assembly(); // Note this is not exploded because it is sub-assembly
translate_z(height) {
translate_z(sheet_thickness(sheet))

View File

@@ -61,6 +61,7 @@ test_pcb = ["test_pcb", "Test PCB",
[
[ 20, -5, 180, "trimpot10"],
[ 20, -15, 90, "trimpot10", true],
[ 7, 2, 90, "smd_led", LED1206, "blue"],
[ 10, 2, 90, "smd_led", LED0805, "red"],
[ 13, 2, 90, "smd_led", LED0603, "orange"],
[ 16, 2, 90, "smd_res", RES1206, "1K"],
@@ -85,16 +86,18 @@ test_pcb = ["test_pcb", "Test PCB",
[ 8, 105, 180, "usb_Ax2"],
[ 7, 85, 180, "molex_usb_Ax1"],
[ 8.5,125, 180, "molex_usb_Ax2"],
[ 3, 140, 180, "usb_uA"],
[ 8, 155, 180, "usb_B"],
[ 3, 138, 180, "usb_uA"],
[ 4.6,148, 180, "usb_miniA"],
[ 3.7,158, 180, "usb_C"],
[ 8, 170, 180, "usb_B"],
[ 6, 184, 180, "uSD", [12, 11.5, 1.4]],
[ 8, 196, 180, "jack"],
[ 6, 206, 180, "barrel_jack"],
[ 5, 220, 180, "hdmi"],
[ 3, 235, 180, "mini_hdmi"],
[ 38, 190, -90, "text", 25, 4, "Silkscreen", "Liberation Sans:style=Bold"],
[ 25, 200, 0, "buzzer", 4.5, 8.5],
[ 25, 218, 0, "buzzer"],
[ 38, 190, -90, "text", 25, 4, "Silkscreen", "Liberation Sans:style=Bold"],
[ 8, 190, 180, "jack"],
[ 6, 200, 180, "barrel_jack"],
[ 5, 218, 180, "hdmi"],
[ 3, 235, 180, "mini_hdmi"],
[ 6, 175, 180, "uSD", [12, 11.5, 1.4]],
[ 65, 9, 0, "link", inch(0.4)],
[ 65, 12, 0, "ax_res", res1_8, 1000],
@@ -112,7 +115,6 @@ test_pcb = ["test_pcb", "Test PCB",
[ 60, 3, 0, "flex"],
[ 50, 15, -90, "flat_flex"],
[ 40, 15, -90, "flat_flex", true],
[ 60, 35, 0, "D_plug", DCONN9],
[ 50, 50, 0, "molex_hdr", 2],
[ 50, 60, 0, "jst_xh", 2],
@@ -137,8 +139,11 @@ test_pcb = ["test_pcb", "Test PCB",
[ 55, 170, 0, "button_4p5mm"],
[ 50, 185, 0, "microswitch", small_microswitch],
[ 52, 200, 0, "pcb", 11, TMC2130 ],
[ 80, 200, 0, "pdip", 24, "27C32", true, inch(0.6) ],
[ 80, 170, 0, "pdip", 8, "NE555" ],
[ 80, 210, 0, "pdip", 24, "27C32", true, inch(0.6) ],
[ 80, 180, 0, "pdip", 8, "NE555" ],
[ 80, 166, -90, "smd_soic", SOIC18, "PIC18F88"],
[ 71, 166, -90, "smd_soic", SOIC16, "ICL323"],
[ 64, 166, -90, "smd_soic", SOIC8, "M34063"],
[ 80, 150, 0, "chip", 10, 5, 1, grey(20)],
[ 52, 206, 0, "2p54socket", 8, 1 ],
@@ -146,7 +151,8 @@ test_pcb = ["test_pcb", "Test PCB",
[ 50, 220, 0, "standoff", 5, 4.5, 12.5, 2.54],
[ 50, 240, 0, "potentiometer"],
[ 75, 240, 0, "potentiometer", KY_040_encoder, 8],
[ 30, 85, -90, "7seg", WT5011BSR, 2],
[ 30, 85, -90, "7seg", WT5011BSR, 2],
[ 30, 55, -90, "D_plug", DCONN9],
],
// accessories
[]

View File

@@ -38,6 +38,12 @@ module smds() {
layout([for(s = smd_sots) smd_sot_size(s).x], 1)
let(s = smd_sots[$i])
smd_sot(s, ["2N7000", "FZT851"][$i]);
translate([0, 20])
layout([for(s = smd_soics) smd_soic_size(s).x], 1)
let(s = smd_soics[$i])
smd_soic(s, s[0]);
}
if($preview)

View File

@@ -55,7 +55,7 @@ module coreXY_belts_test() {
translate([coreXYPosBL.x + separation.x/2, coreXYPosTR.y + upper_drive_pulley_offset.y, separation.z/2]) {
// add the upper drive pulley stepper motor
translate([coreXY_drive_pulley_x_alignment(coreXY_type) + upper_drive_pulley_offset.x, 0, -pulley_height(coreXY_drive_pulley(coreXY_type))])
NEMA(NEMA17M);
NEMA(NEMA17_40);
// add the screws for the upper drive offset idler pulleys if required
if (upper_drive_pulley_offset.x > 0) {
@@ -78,7 +78,7 @@ module coreXY_belts_test() {
translate([coreXYPosTR.x - separation.x/2, coreXYPosTR.y + lower_drive_pulley_offset.y, -separation.z/2]) {
// add the lower drive pulley stepper motor
translate([-coreXY_drive_pulley_x_alignment(coreXY_type) + lower_drive_pulley_offset.x, 0, -pulley_height(coreXY_drive_pulley(coreXY_type))])
NEMA(NEMA17M);
NEMA(NEMA17_40);
// add the screws for the lower drive offset idler pulleys if required
if (lower_drive_pulley_offset.x < 0) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 90 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: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

After

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 182 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: 49 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 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: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 KiB

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

After

Width:  |  Height:  |  Size: 218 KiB

View File

@@ -17,20 +17,26 @@
// If not, see <https://www.gnu.org/licenses/>.
//
include <../core.scad>
use <../utils/layout.scad>
use <../printed/screw_knob.scad>
screws = [M3_hex_screw, M4_hex_screw];
knobs = [
M3_hex_screw,
M4_hex_screw,
screw_knob(M5_hex_screw, flange_r = 12, flange_t = 6, stem_h = 2, waves = 6),
screw_knob(M6_hex_screw, flange_r = 15, flange_t = 6, solid = false, stem_h = 2, waves = 6, wall = 1.6, fluted = true),
];
module do_screw_knob(screw)
module do_screw_knob(knob) {
if($preview)
screw_knob_assembly(screw, 16);
screw_knob_assembly(knob, 16);
else
screw_knob(screw);
screw_knob(knob);
}
module screw_knobs()
for(i = [0 : len(screws) - 1])
translate([i * 30, 0])
do_screw_knob(screws[i]);
layout([for(k = knobs) 2 * screw_knob_flange_r(k)], 10)
do_screw_knob(knobs[$i]);
screw_knobs();

View File

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

View File

@@ -17,18 +17,25 @@
// If not, see <https://www.gnu.org/licenses/>.
//
include <../utils/core/core.scad>
use <../utils/sweep.scad>
use <../utils/bezier.scad>
use <../vitamins/wire.scad>
bundle = [7, 1.4];
twist_len = 25; // [5 : 50]
wires = 7; // [1 : 7]
irot = -60; // [-90 : 0]
/* [Hidden] */
wire_d = 1.4;
bundle = cable(wires, wire_d);
bundle_r = cable_radius(bundle);
thickness = 2;
w = 60;
d = 20;
h = 40;
wire_l = 90;
h = 10;
wire_l = 60;
mouse_y = 10;
cable_pitch = 7;
@@ -49,6 +56,7 @@ module wires() {
translate([bundle_r - d / 2, 0]) {
colour = ["black", "brown", "red", "orange", "yellow", "blue", "purple"][i];
wire(colour, 7, wire_l);
color(colour)
cylinder(d = d, h = wire_l, center = true);
}
@@ -66,7 +74,7 @@ module wires() {
mouse_hole(bundle, 0, true);
for(i = [1 : 6])
let(cable = [i, 1.4], bundle = cable_bundle(cable))
let(cable = cable(i, wire_d), bundle = cable_bundle(cable))
translate([mouse_y + cable_pitch * i - bundle.x / 2, -eps])
square([bundle.x, bundle.y]);
}
@@ -81,18 +89,28 @@ module wires() {
cable_tie_holes(bundle_r, 0);
}
}
translate([-15, mouse_y])
cable_tie(bundle_r, thickness);
for(i = [1 : 6]) let(cable = [i, 1.4])
translate([0, mouse_y + cable_pitch * i])
let(positions = cable_bundle_positions(cable))
for(i = [0 : len(positions) - 1])
let(p = positions[i])
translate([0, p.x, p.y])
rotate([0, 90, 0])
color([grey(10), "blue", "red", "orange", "yellow", "green"][i])
cylinder(d = cable_wire_size(cable), h = 60, center = true);
for(i = [1 : 6]) let(cable = cable(i, wire_d, [grey(10), "blue", "red", "orange", "yellow", "green"], tlen = twist_len))
translate([0, mouse_y + cable_pitch * i]) {
tr = cable_twisted_radius(cable);
bend_r = 5;
x = -d + thickness - bend_r;
path = [
[-5, 0, tr],
[x, 0, tr],
bend_r, [x, 0, -25]
];
rpath = rounded_path(path);
tpaths = twisted_cable(cable, rpath, irot = irot, frot = -irot);
positions = cable_bundle_positions(cable);
ends = [for(p = positions) [[30, p.x, p.y], [0, p.x, p.y]]];
paths = [for(i = [0 : len(tpaths) - 1]) bezier_join(ends[i], tpaths[i], 1.3, 3)];
cable(cable, paths, $fn = 32);
}
}
if($preview)

View File

@@ -16,14 +16,23 @@
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
wire_r = 5; // [1 : 20]
t = 0; // [0 : 3]
include <../utils/core/core.scad>
use <../utils/layout.scad>
include <../vitamins/zipties.scad>
module zipties()
layout([for(z = zipties) 9], 10)
ziptie(zipties[$i], 5);
layout([for(z = zipties) 9], 2 * wire_r) {
ziptie(zipties[$i], wire_r, t);
if(t)
color(grey(20))
cylinder(r = wire_r, h = 10, center = true);
}
if($preview)
zipties();

View File

@@ -49,17 +49,18 @@ function show_supports() = !$preview || exploded(); //! True if
module no_explode() //! Prevent children being exploded
let($exploded_parent = true) children();
module explode(d, explode_children = false, offset = [0,0,0]) { //! Explode children by specified Z distance or vector `d`, option to explode grand children
module explode(d, explode_children = false, offset = [0,0,0], show_line = true) { //! Explode children by specified Z distance or vector `d`, option to explode grand children
v = is_list(d) ? d : [0, 0, d];
o = is_list(offset) ? offset : [0, 0, offset];
if(exploded() && norm(v)) {
translate(o) // Draw the line first in case the child is transparent
color("yellow") hull() {
sphere(0.2);
translate(v * exploded())
if(show_line)
translate(o) // Draw the line first in case the child is transparent
color("yellow") hull() {
sphere(0.2);
}
translate(v * exploded())
sphere(0.2);
}
translate(v * exploded())
let($exploded_parent = explode_children ? undef : true)

View File

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

View File

@@ -33,7 +33,7 @@ function circle_tangent(p1, p2) = //! Compute the clockwise tangent between two
dx = p2.x - p1.x,
dy = p2.y - p1.y,
d = sqrt(dx * dx + dy * dy),
theta = atan2(dy, dx) + acos((r1 - r2) / d),
theta = assert(d, str("points conicident ", p1)) atan2(dy, dx) + acos((r1 - r2) / d),
v = [cos(theta), sin(theta)]
)[ p1 + r1 * v, p2 + r2 * v ];
@@ -72,24 +72,52 @@ function rounded_polygon_length(points, tangents) = //! Calculate the length giv
arcs = rounded_polygon_arcs(points, tangents)
) sumv( map( concat(tangents, arcs), function(e) e[2] ) );
function line_intersection(l0, l1) = //! Return the point where two 2D lines intersect or undef if they don't.
assert(Len(l0) == 2 && Len(l1) == 2, "Two 2D vectors expected")
let(
p0 = l0[0], p1 = l0[1], p2 = l1[0], p3 = l1[1],
v1 = p1 - p0,
v2 = p3 - p2,
v3 = p0 - p2,
det = v1.x * v2.y - v2.x * v1.y,
s = det ? (-v1.y * v3.x + v1.x * v3.y) / det : inf,
t = det ? ( v2.x * v3.y - v2.y * v3.x) / det : inf
) s >= 0 && s <= 1 && t >= 0 && t <= 1 ? p0 + t * v1 : undef;
function rounded_polygon(points, _tangents = undef) = //! Return the rounded polygon from the point list, can pass the tangent list to save it being calculated
let(
len = len(points),
tangents = _tangents ? _tangents : rounded_polygon_tangents(points),
arcs = rounded_polygon_arcs(points, tangents)
) [for(i = [0 : len - 1], last = (i - 1 + len) % len, R = points[i][2]) each [
vec2(tangents[last][1]), // End of last tangent
if(R) // If rounded
let(r = abs(R), // Get radius
n = r2sides4n(r), // Decide number of vertices
step = 360 / n, // Angular step
arc = arcs[i], // Get corner arc details
start = ceil(arc[1] / step + eps), // Starting index
end = floor((arc[0] + arc[1]) / step - eps), // Ending index
c = vec2(points[i]) // Centre of arc
) for(j = R > 0 ? [end : -1 : start] : [start : 1 : end], a = j * step) c + r * [cos(a), sin(a)], // Points on the arc
vec2(tangents[i][0])] // Start of next tangent
) [for(i = [0 : len - 1], last = (i - 1 + len) % len)
let(
t0 = vec2(tangents[last]),
t1 = vec2(tangents[i]),
p = line_intersection(t0, t1), // Do the tangents cross?
R = points[i][2]
)
if(!is_undef(p)) // Tangents intersect, so just add the intersection point
p
else
each [ // Else link the two tangent ends with an arc
t0[1], // End of last tangent
if(R) // If rounded
let(r = abs(R), // Get radius
n = r2sides4n(r), // Decide number of vertices
step = 360 / n, // Angular step
arc = arcs[i], // Get corner arc details
start = ceil(arc[1] / step + eps), // Starting index
end = floor((arc[0] + arc[1]) / step - eps), // Ending index
c = vec2(points[i]) // Centre of arc
) for(j = R > 0 ? [end : -1 : start] : [start : 1 : end], a = j * step)
c + r * [cos(a), sin(a)], // Points on the arc
if(R)
t1[0], // Start of next tangent
]
];
function offset(points, offset) = //! Offset a 2D polygon, breaks for concave shapes and negative offsets if the offset is more than half the smallest feature size.
rounded_polygon([for(p = points) [p.x, p.y, offset]]);
module rounded_polygon(points, _tangents = undef) //! Draw the rounded polygon from the point list, can pass the tangent list to save it being calculated
polygon(rounded_polygon(points, _tangents), convexity = len(points));

View File

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

View File

@@ -44,7 +44,8 @@ AACELL = ["AACELL", "Cell AA", 50.5, 14.5
AAACELL = ["AAACELL", "Cell AAA", 44.5, 10.5, 8, 3.8, 0.8, "grey", [], 0, bcontact];
CCELL = ["CCELL", "Cell C", 50, 26.2, 20, 7.5, 1.5, "brown", [], 0, bcontact];
DCELL = ["DCELL", "Cell D", 61.5, 34.2, 22, 8.2, 2.4, "brown", [], 0, bcontact];
A23CELL = ["A23CELL", "Cell A23 12v", 28.5, 10.3, 5.2,5.2, 1.0, "silver", [], 0, bcontact];
batteries = [AAACELL, AACELL, CCELL, DCELL, LUMINTOP, S25R18650];
batteries = [AAACELL, AACELL, CCELL, DCELL, LUMINTOP, S25R18650, A23CELL];
use <battery.scad>

View File

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

View File

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

View File

@@ -33,7 +33,7 @@ function insert_ring1_h(type) = type[6]; //! Height of the top and mi
function insert_ring2_d(type) = type[7]; //! Diameter of the middle ring
function insert_ring3_d(type) = type[8]; //! Diameter of the bottom ring
function insert_hole_length(type) = round_to_layer(insert_length(type));
function insert_hole_length(type) = round_to_layer(insert_length(type)); //! Length of the insert rounded to layer height
function insert_nose_length(type, d) = let( //! The length before the second ring.
length = insert_length(type),

View File

@@ -485,6 +485,50 @@ module usb_uA(cutout = false) { //! Draw USB micro A connector
}
}
module usb_miniA(cutout = false) { //! Draw USB mini A connector
l = 9.2;
iw1 = 7.0;
iw2 = 6.0;
ih1 = 1.05;
ih2 = 1.0;
h = 4.0;
t = 0.4;
module D() {
hull() {
translate([-iw1 / 2, h - t - ih1])
square([iw1, ih1]);
translate([-iw2 / 2, t + ih2])
square([iw2, eps]);
}
translate([-iw2 / 2, t])
square([iw2, ih2]);
}
if(cutout)
rotate([90, 0, 90])
linear_extrude(100)
offset(2 * panel_clearance)
D();
else
color("silver") rotate([90, 0, 90]) {
linear_extrude(l, center = true)
difference() {
offset(t)
D();
D();
}
translate_z(-l / 2)
linear_extrude(1)
offset(t)
D();
}
}
module usb_C(cutout = false) { //! Draw USB C connector
l = 7.35;
w = 8.94;
@@ -1046,6 +1090,7 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
if(show(comp, "usb_A")) usb_Ax1(cutouts);
if(show(comp, "usb_Ax2")) usb_Ax2(cutouts);
if(show(comp, "usb_uA")) usb_uA(cutouts);
if(show(comp, "usb_miniA")) usb_miniA(cutouts);
if(show(comp, "usb_B")) usb_B(cutouts);
if(show(comp, "usb_C")) usb_C(cutouts);
if(show(comp, "jack")) jack(cutouts);
@@ -1089,6 +1134,7 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
if(show(comp, "smd_res")) smd_resistor(comp[4], comp[5]);
if(show(comp, "smd_cap")) smd_capacitor(comp[4], comp[5], param(6, undef));
if(show(comp, "smd_sot")) smd_sot(comp[4], comp[5]);
if(show(comp, "smd_soic")) smd_soic(comp[4], comp[5]);
if(show(comp, "vero_pin")) vero_pin(param(4, false));
if(show(comp, "terminal")) terminal_block(comp[5], comp[4]);
if(show(comp, "text")) color("white") linear_extrude(eps) resize([comp[4], comp[5]]) text(comp[6], font = param(7, "Liberation Mono"), valign = "center", halign = "center");

View File

@@ -885,7 +885,7 @@ ArduinoNano = let(l = 43.18, w = 17.78, pitch = inch(0.6), 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 + inch(0.75), w / 2, 0, "2p54header", 2, 3, false, undef, false, false],
[1.75, w / 2, 180, "usb_uA" ],
[3.1, w / 2, 180, "usb_miniA" ],
[l / 2 - inch(0.25), w / 2, 45, "chip", 7, 7, 1.3],
[l / 2 + poffset + inch(0.15), w / 2, 0, "chip", 3.5, 6, 1.8, silver ], // mock button
[l / 2 + poffset + inch(0.15), w / 2, 0, "chip", 1.3, 2.6, 2.6, grey(90) ], // mock button

View File

@@ -52,7 +52,7 @@ module corner(r) {
if(r < 0)
translate([-r, r])
rotate(45)
square(-r * sqrt(2), -r * sqrt(2), center = true);
square([-r * sqrt(2), -r * sqrt(2)], center = true);
else
translate([0.5, -0.5])
square(1, center = true);

View File

@@ -178,3 +178,53 @@ module smd_sot(type, value) { //! Draw an SMD transistor
text(value, halign = "center", valign = "center");
}
function smd_soic_size(type) = type[1]; //! Body length, width and height
function smd_soic_z(type) = type[2]; //! Height above PCB surface
function smd_soic_lead_z(type) = type[3]; //! Top of lead frame from top
function smd_soic_lead_pitch(type) = type[4]; //! Lead pitch
function smd_soic_lead_span(type) = type[5]; //! Total span of leads
function smd_soic_lead_size(type) = type[6]; //! Lead width, foot depth, lead thickness
module smd_soic(type, value) { //! Draw an SMD SOIC
vitamin(str("smd_soic(", type[0], "): ", type[0], " package ", value));
size = smd_soic_size(type);
z0 = smd_soic_z(type);
z2 = z0 + size.z;
z1 = z2 - smd_soic_lead_z(type);
slant = 5; //! 5 degree body draft angle
pitch = smd_soic_lead_pitch(type);
span = (smd_soic_lead_span(type) / 2);
leads = floor(size.x / pitch) + 1;
ls = smd_soic_lead_size(type);
r = ls.z;
gullwing = rounded_path([[0, 0, ls.z / 2], [0, ls.y - ls.z, ls.z / 2], r, [0, ls.y -ls.z + z1 - ls.z, z1 - ls.z / 2], r, [0, span / 2, z1 - ls.z / 2]], $fn = 32);
color(grey(20))
hull()
for(z = [z0, z1, z2], inset = abs(z - z1) * tan(slant))
translate_z(z)
cube([size.x - 2 * inset, size.y - 2 * inset, eps], center = true);
color(silver) {
for(i = [0 : leads - 1]) {
translate([i * pitch - size.x / 2 + (size.x - (leads - 1) * pitch) / 2, -span])
sweep(gullwing, rectangle_points(ls.x, ls.z));
rotate(180)
translate([0, -span / 2])
translate([i * pitch - size.x / 2 + (size.x - (leads - 1) * pitch) / 2, -span / 2])
sweep(gullwing, rectangle_points(ls.x, ls.z));
}
}
color("white")
translate_z(z0 + size.z)
linear_extrude(eps)
resize([size.x * 0.9, size.y / 2])
text(value, halign = "center", valign = "center");
}

View File

@@ -23,8 +23,9 @@
LED0603 = ["LED0603", [1.6, 0.8, 0.18], [1.0, 0.8, 0.42]];
LED0805 = ["LED0805", [2.0, 1.25, 0.46], [1.4, 1.25, 0.54]];
LED1206 = ["LED1206", [3.2, 1.6, 0.5], [2.0, 1.6, .6]];
smd_leds = [LED0603, LED0805];
smd_leds = [LED0603, LED0805, LED1206];
RES0603 = ["RES0603", [1.6, 0.8, 0.45], 0.3, 1/10];
RES0805 = ["RES0805", [2.0, 1.2, 0.45], 0.4, 1/8];
@@ -43,4 +44,10 @@ SOT223 = ["SOT223", [6.5, 3.5, 1.6], 0.05, 0.89, 2.3, 7.0, [0.7, 0.95, 0.25], 3]
smd_sots = [SOT23, SOT223];
SOIC8 = ["SOIC8", [4.90, 3.90, 1.25], 0.10, 0.66, 1.27, 6.00, [0.31, .50, 0.20]];
SOIC16 = ["SOIC16", [9.90, 3.90, 1.25], 0.10, 0.66, 1.27, 6.00, [0.31, .50, 0.20]];
SOIC18 = ["SOIC18", [11.40, 7.50, 2.00], 0.10, 1.20, 1.27, 10.30, [0.31, .50, 0.20]];
smd_soics = [SOIC8, SOIC16, SOIC18];
use <smd.scad>

View File

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

View File

@@ -21,20 +21,20 @@
// NEMA stepper motor model
//
// corner body boss boss shaft cap thread black end shaft shaft
// side, length, radius, radius, radius, depth, shaft, length, holes, heights, dia, caps, conn, length2, bore
NEMA8 = ["NEMA8", 20, 30, 30/2, 20, 7.5, 1.6, 4, 6, 16, [8, 8], 2, true, true, 0, 0];
NEMA8BH = ["NEMA8BH", 20, 30, 30/2, 20, 7.5, 1.6, 5, 12, 16, [8, 8], 2, true, true, 7, 2.8];
NEMA17 = ["NEMA17", 42.3, 47, 53.6/2, 25, 11, 2, 5, 24, 31, [11.5, 9], 3, false, false, 0, 0];
NEMA17M = ["NEMA17M", 42.3, 40, 53.6/2, 25, 11, 2, 5, 20, 31, [12.5, 11], 3, false, false, 0, 0];
NEMA17M8= ["NEMA17M8", 42.3, 40, 53.6/2, 25, 11, 2, 8, [280, 8, 4], 31, [12.5, 11], 3, false, false, 0, 0];
NEMA17S = ["NEMA17S", 42.3, 34, 53.6/2, 25, 11, 2, 5, 24, 31, [8, 8], 3, false, false, 0, 0];
NEMA17P = ["NEMA17P", 42.3, 26.5, 53.6/2, 25, 11, 2, 5, 26.5, 31, [10, 8], 3, false, false, 0, 0];
NEMA16 = ["NEMA16", 39.5, 19.2, 50.6/2, 50.6/2, 11, 2, 5, 12, 31, [8, 8], 3, false, false, 0, 0];
NEMA14 = ["NEMA14", 35.2, 36, 46.4/2, 21, 11, 2, 5, 21, 26, [8, 8], 3, false, false, 0, 0];
NEMA23 = ["NEMA23", 56.4, 51.2, 75.7/2, 35, 38.1/2, 1.6, 6.35, 24, 47.1, [8, 8], 3, false, false, 0, 0];
// corner body boss boss shaft cap thread black end shaft shaft
// side, length, radius, radius, radius, depth, shaft, length, holes, heights, dia, caps, conn, length2, bore
NEMA8_30 = ["NEMA8_30", 20, 30, 30/2, 20, 7.5, 1.6, 4, 6, 16, [8, 8], 2, true, true, 0, 0];
NEMA8_30BH = ["NEMA8_30BH", 20, 30, 30/2, 20, 7.5, 1.6, 5, 12, 16, [8, 8], 2, true, true, 7, 2.8];
NEMA17_47 = ["NEMA17_47", 42.3, 47, 53.6/2, 25, 11, 2, 5, 24, 31, [11.5, 9], 3, false, false, 0, 0];
NEMA17_40 = ["NEMA17_40", 42.3, 40, 53.6/2, 25, 11, 2, 5, 20, 31, [12.5, 11], 3, false, false, 0, 0];
NEMA17_40L280 = ["NEMA17_40L280", 42.3, 40, 53.6/2, 25, 11, 2, 8, [280, 8, 4], 31, [12.5, 11], 3, false, false, 0, 0];
NEMA17_34 = ["NEMA17_34", 42.3, 34, 53.6/2, 25, 11, 2, 5, 24, 31, [8, 8], 3, false, false, 0, 0];
NEMA17_27 = ["NEMA17_27", 42.3, 26.5, 53.6/2, 25, 11, 2, 5, 26.5, 31, [10, 8], 3, false, false, 0, 0];
NEMA16_19 = ["NEMA16_19", 39.5, 19.2, 50.6/2, 50.6/2, 11, 2, 5, 12, 31, [8, 8], 3, false, false, 0, 0];
NEMA14_36 = ["NEMA14_36", 35.2, 36, 46.4/2, 21, 11, 2, 5, 21, 26, [8, 8], 3, false, false, 0, 0];
NEMA23_51 = ["NEMA23_51", 56.4, 51.2, 75.7/2, 35, 38.1/2, 1.6, 6.35, 24, 47.1, [8, 8], 3, false, false, 0, 0];
stepper_motors = [NEMA8, NEMA8BH, NEMA14, NEMA16, NEMA17P, NEMA17S, NEMA17M, NEMA17, NEMA23];
stepper_motors = [NEMA8_30, NEMA8_30BH, NEMA14_36, NEMA16_19, NEMA17_27, NEMA17_34, NEMA17_40, NEMA17_47, NEMA23_51];
small_steppers = [];
use <stepper_motor.scad>

View File

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

View File

@@ -26,7 +26,7 @@ include <../utils/core/core.scad>
include <../utils/sweep.scad>
soft_washer_colour = grey(20);
hard_washer_colour = grey(80);
hard_washer_colour = grey(85);
star_washer_colour = brass;
function washer_size(type) = type[1]; //! Nominal size

View File

@@ -18,9 +18,11 @@
//
//
//! Just a BOM entry at the moment and cable bundle size functions for holes, plus cable ties.
//! Utilities for adding wires to the BOM and optionally drawing them and cable bundle size functions for holes, plus cable ties.
//
include <../utils/core/core.scad>
use <../utils/sweep.scad>
use <../utils/maths.scad>
include <zipties.scad>
module wire(colour, strands, length, strand = 0.2) //! Add stranded wire to the BOM
@@ -35,15 +37,16 @@ module ribbon_cable(ways, length) //! Add ribbon cable to the
function cable_wires(cable) = cable[0]; //! Number of wires in a bundle
function cable_wire_size(cable) = cable[1]; //! Size of each wire in a bundle
function cable_is_ribbon(cable) = len(cable) > 2 && cable[2]; //! Is a ribbon cable?
function cable_wire_colours(cable) = assert(len(cable[3]) == cable_wires(cable)) cable[3]; //! Individual wire colours
function cable(wires, size, colours, ribbon = false) = [wires, size, ribbon, colours]; //! Cable constructor
function cable_wire_colours(cable) = assert(len(cable[3]) >= cable_wires(cable)) cable[3]; //! Individual wire colours
function cable_tlen(cable) = cable[4]; //! Twisted cable twist length
function cable(wires, size, colours, ribbon = false, tlen = 25) = [wires, size, ribbon, colours, tlen]; //! Cable constructor
// numbers from http://mathworld.wolfram.com/CirclePacking.html
function cable_radius(cable) = [0, 1, 2, 2.15, 2.41, 2.7, 3, 3, 3.3][cable_wires(cable)] * cable_wire_size(cable) / 2; //! Radius of a bundle of wires, see <http://mathworld.wolfram.com/CirclePacking.html>.
function wire_hole_radius(cable) = ceil(4 * cable_radius(cable) + 1) / 4; //! Radius of a hole to accept a bundle of wires, rounded up to standard metric drill size
function cable_bundle(cable) = //! Arrangement of a bundle in a flat cable clip
function cable_bundle(cable) = //! Dimensions of the bounding rectangle of a bundle of wires in a flat cable clip
(cable_is_ribbon(cable) ? [cable_wires(cable), 1] :
[[0,0], [1,1], [2,1], [2, 1 + sin(60)], [2,2], [3, 1 + sin(60)], [3,2]][cable_wires(cable)]) * cable_wire_size(cable);
@@ -53,12 +56,42 @@ function cable_bundle_positions(cable) = let( //! Positions of wires in a bundle
top = wires - bottom
)
[for(i = [0 : 1 : bottom - 1]) [i - (bottom - 1) / 2, 0.5],
for(i = [0 : 1 : top - 1]) [i - (top - 1) / 2, top == bottom ? 1.5 : 0.5 + sin(60)]
for(i = [top - 1 : -1 : 0]) [i - (top - 1) / 2, top == bottom ? 1.5 : 0.5 + sin(60)]
] * cable_wire_size(cable);
function cable_width(cable) = cable_bundle(cable).x; //! Width in flat clip
function cable_height(cable) = cable_bundle(cable).y; //! Height in flat clip
function cable_twisted_radius(cable) = let( //! Approximate radius of a cable when twisted
tlen = cable_tlen(cable), // Twist length
a = cable_wire_size(cable) / 2, // Ellipse minor axis
R = cable_radius(cable) - a, // Radius of wire centres when not twisted
angle = atan2(tlen, 2 * PI * R), // Slope angle of the spiral
b = a / sin(angle), // Ellipse major axis
grad = tan(180 / cable_wires(cable)), // Gradient at contact point between elipses
x = a^2 / sqrt(a^2 + (b / grad)^2), // Contact point of the ellipse tangent
y = b * sqrt(1 - x^2 / a^2)
) R ? x + y / grad + a : a; // Where the tangent meets the X axis plus radius
function twisted_cable(cable, path, irot = 0, frot = 0) = let( //! Return the paths for a twisted cable, `irot` is the initial rotation and frot the final rotation
tlen = cable_tlen(cable), // Twist length
r = cable_wire_size(cable) / 2,
pitch = cable_twisted_radius(cable) - r,
wires = cable_wires(cable),
bottom = wires > 4 ? 3 : 2,
irot = irot + 90 - 180 * (bottom - 1) / wires
)
spiral_paths(path, wires, pitch, round(path_length(path) / tlen) - frot / 360, irot);
module cable(cable, paths) { //! Draw a cable, given a list of paths
wires = cable_wires(cable);
assert(len(paths) == wires);
r = cable_wire_size(cable) / 2;
for(i = [0 : wires - 1])
color(cable_wire_colours(cable)[i])
sweep(paths[i], circle_points(r), convexity = 5);
}
module mouse_hole(cable, h = 100, teardrop = false) { //! A mouse hole to allow a panel to go over a wire bundle.
r = wire_hole_radius(cable);

View File

@@ -33,17 +33,16 @@ function ziptie_tail(type) = type[5]; //! The length without teeth
module ziptie(type, r = 5, t = 0) //! Draw specified ziptie wrapped around radius `r` and optionally through panel thickness `t`
{
latch = ziptie_latch(type);
lx = latch.x / 2;
zt = ziptie_thickness(type);
cr = zt; // sharp corner radius
lx = min(latch.x / 2, r + zt / 2);
right_bulge = (r > lx - zt / 2) || !t;
cr = zt / 2; // sharp corner radius
z = r + t - cr;
x = r - cr;
inside_corners = t ? [ [0, 0, r], [-x, z, cr], [x, z, cr] ] : [];
outside_corners = t ? [ [0, 0, r + zt], [-x, z, cr + zt], [x, z, cr + zt] ] : [];
x1 = lx - zt / 2;
x2 = x1 + x1 * zt / r;
inside_path = concat([ [0, 0, r], [x1, -r, eps] ], inside_corners);
outside_path = concat([ [0, 0, r + zt], [x2, -r - zt, eps] ], outside_corners);
outside_path = concat([ if(right_bulge) [0, 0, r + zt], [x2, -r - zt, eps] ], outside_corners);
tangents = rounded_polygon_tangents(outside_path);
length = ceil(rounded_polygon_length(outside_path, tangents) + ziptie_tail(type) + latch.z + 1);
@@ -56,7 +55,9 @@ module ziptie(type, r = 5, t = 0) //! Draw specified ziptie wrapped around radiu
linear_extrude(width, center = true)
difference() {
rounded_polygon(outside_path, tangents);
rounded_polygon(inside_path);
offset(-zt)
rounded_polygon(outside_path, tangents);
}
translate([lx, -r])