1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-09-08 14:11:17 +02:00

Compare commits

...

13 Commits

Author SHA1 Message Date
Chris
74293b6c22 Added axial diodes, radial transistors, discs and modules.
Verboard and perboard components get solder menisci added automatically.
Radial leads now made by bezier curves rather than straights and arcs.
2023-07-28 10:39:07 +01:00
Chris
9e45e4eb79 Updated changelog. 2023-07-22 23:59:58 +01:00
Chris
523fc9e9a5 Adafruit Feather 405 contributed by Chris Lott. 2023-07-22 23:56:42 +01:00
Chris
09d2ffb126 Typo in comment fixed. 2023-07-22 19:32:42 +01:00
Chris
3c370359c8 Make front page readme.md labels lower case as GitHub seems have stopped working with uppercase. 2023-07-22 19:08:53 +01:00
Chris
acf45d2aae Updated changelog. 2023-07-22 17:38:06 +01:00
Chris
568d63dd14 Merge branch 'jeroenrnl-SBR' 2023-07-22 17:35:34 +01:00
Chris
e3cde64b61 open_bearing_theta() now derived from open_bearing_width(). 2023-07-22 17:34:22 +01:00
Chris
e61ce02414 Moved things around for better test images. 2023-07-22 16:37:35 +01:00
Chris
f8e125654e Rendred the 3D difference. 2023-07-22 16:36:11 +01:00
Chris
62b1511c82 Removed 3D difference for speed. 2023-07-22 16:35:50 +01:00
Jeroen Roos
84d98a1081 Added SBR rails
This change adds
- SBR rails. For now only SBR16
- The bearing block that goes with it (SBR16UU)
- An 'open' linear bearing (LM16UUOP) that is used by the bearing block
- A 28mm circlip that has a wider opening than then normal circlip.
(circlip_28iw)
2023-06-30 12:57:13 +02:00
Chris
8efbb1d441 Updated changelog. 2023-06-29 11:20:45 +01:00
101 changed files with 1440 additions and 392 deletions

View File

@@ -3,6 +3,37 @@
This changelog is generated by `changelog.py` using manually added semantic version tags to classify commits as breaking changes, additions or fixes.
### [v21.7.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.7.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.6.1...v21.7.0 "diff with v21.6.1")
* 2023-07-22 [`523fc9e`](https://github.com/nophead/NopSCADlib/commit/523fc9e9a5c8a566bde2bfe8555d5f6dddd8f05b "show commit") [C.](# "Chris") Adafruit Feather 405 contributed by Chris Lott.
#### [v21.6.1](https://github.com/nophead/NopSCADlib/releases/tag/v21.6.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v21.6.0...v21.6.1 "diff with v21.6.0")
* 2023-07-22 [`09d2ffb`](https://github.com/nophead/NopSCADlib/commit/09d2ffb126cf9d9ad2d68171583e11708227b704 "show commit") [C.](# "Chris") Typo in comment fixed.
* 2023-07-22 [`3c37035`](https://github.com/nophead/NopSCADlib/commit/3c370359c838a48d85e25709bcbced61249c237d "show commit") [C.](# "Chris") Make front page `readme.md` labels lower case as GitHub seems have stopped working with uppercase.
### [v21.6.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.6.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.5.1...v21.6.0 "diff with v21.5.1")
* 2023-07-22 [`e3cde64`](https://github.com/nophead/NopSCADlib/commit/e3cde64b61b6abfc4a2883e8aa32b66346fde1c4 "show commit") [C.](# "Chris") `open_bearing_theta()` now derived from `open_bearing_width()`.
* 2023-07-22 [`e61ce02`](https://github.com/nophead/NopSCADlib/commit/e61ce0241443fb2c1f0585953bd3f7383b217086 "show commit") [C.](# "Chris") Moved things around for better test images.
* 2023-07-22 [`f8e1256`](https://github.com/nophead/NopSCADlib/commit/f8e125654ed60842d6ca7f33a91377d9cb5f1dc9 "show commit") [C.](# "Chris") Rendred the 3D difference.
* 2023-07-22 [`62b1511`](https://github.com/nophead/NopSCADlib/commit/62b1511c82eacb5124302aed36a52fe0d8104385 "show commit") [C.](# "Chris") Removed 3D difference for speed.
* 2023-06-27 [`84d98a1`](https://github.com/nophead/NopSCADlib/commit/84d98a1081d38c56d5b02645a99223b7616fcd70 "show commit") [J.R.](# "Jeroen Roos") Added SBR rails
* This change adds
- SBR rails. For now only SBR16
- The bearing block that goes with it (SBR16UU)
- An 'open' linear bearing (LM16UUOP) that is used by the bearing block
- A 28mm circlip that has a wider opening than then normal circlip.
`(circlip_28iw)`
#### [v21.5.1](https://github.com/nophead/NopSCADlib/releases/tag/v21.5.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v21.5.0...v21.5.1 "diff with v21.5.0")
* 2023-06-29 [`5899ffe`](https://github.com/nophead/NopSCADlib/commit/5899ffe88f7952108ce928a5a6188b4aad5044c5 "show commit") [C.](# "Chris") More typos in comments.
* 2023-06-28 [`b051311`](https://github.com/nophead/NopSCADlib/commit/b05131145caf500cd9198b1e9b9fafc69506b50f "show commit") [C.](# "Chris") Comment typo.
### [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.
@@ -84,8 +115,6 @@ Corrected BOM entry to show right angle options on Molex and pin headers.
* 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.
@@ -127,7 +156,7 @@ Corrected BOM entry to show right angle options on Molex and pin headers.
* 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.
* 2023-01-24 [`543cdb4`](https://github.com/nophead/NopSCADlib/commit/543cdb4e01d38308a06d4368ebabadb85c696567 "show commit") [C.P.](# "Chris Palmer") Increased 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.
@@ -162,8 +191,6 @@ Client code now calls `dxf()` so that the generated files can be used to speed u
* Change comment about nut sizes from radius to diameter.
* 2022-09-29 [`d95e1e6`](https://github.com/nophead/NopSCADlib/commit/d95e1e64edba4ef51852a1e72d00497154c80c88 "show commit") [C.](# "Chris") Udated changelog.
### [v20.14.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.14.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.13.0...v20.14.0 "diff with v20.13.0")
* 2022-09-29 [`f1737d2`](https://github.com/nophead/NopSCADlib/commit/f1737d257b54957772ab6faea102f8ddb829119b "show commit") [C.](# "Chris") Updated images and readme.
@@ -563,7 +590,7 @@ Lead length removed from TO220 and TO247 vitamin string.
Mainly text spacing changes.
* 2021-09-27 [`9b5ec6a`](https://github.com/nophead/NopSCADlib/commit/9b5ec6af1aba313df6812a5313470ebb7e8fbdd7 "show commit") [C.P.](# "Chris Palmer") Fixed new `rounded_polygon` to work with last OpenSCAD release.
Trainling commas in `let()`.
Trailing commas in `let()`.
* 2021-09-27 [`50958b0`](https://github.com/nophead/NopSCADlib/commit/50958b064d5a6d5ca3fd6525a8c3d3a2c5b20199 "show commit") [C.P.](# "Chris Palmer") Added `$show_plugs` to show crude reprentations of housings on `pin_headers` and Molex KK headers.
@@ -1225,7 +1252,7 @@ Updated pics and readme.
* 2020-12-28 [`f6f4fcc`](https://github.com/nophead/NopSCADlib/commit/f6f4fcc7e84e40669446708e2352ea68c49b7961 "show commit") [M.B.](# "Martin Budden") Added `M5_cs_cap` screw
#### [v10.21.1](https://github.com/nophead/NopSCADlib/releases/tag/v10.21.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v10.21.0...v10.21.1 "diff with v10.21.0")
* 2020-12-28 [`ba586b3`](https://github.com/nophead/NopSCADlib/commit/ba586b368582db163af143ebb60afed270f77b1c "show commit") [C.P.](# "Chris Palmer") Example images update to match new contersink screws and teardrops.
* 2020-12-28 [`ba586b3`](https://github.com/nophead/NopSCADlib/commit/ba586b368582db163af143ebb60afed270f77b1c "show commit") [C.P.](# "Chris Palmer") Example images update to match new countersink screws and teardrops.
### [v10.21.0](https://github.com/nophead/NopSCADlib/releases/tag/v10.21.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v10.20.1...v10.21.0 "diff with v10.20.1")
* 2020-12-28 [`8d22940`](https://github.com/nophead/NopSCADlib/commit/8d22940506df525ac52ef6f8a00ea03661f3b682 "show commit") [C.P.](# "Chris Palmer") Project blurb can now be split with into sections with markdown horizontal rules
@@ -1503,7 +1530,7 @@ Reverted the jst header pin position change.
* 2020-09-20 [`933fea6`](https://github.com/nophead/NopSCADlib/commit/933fea687c54d7d8ec48fe92aae12ffca0666789 "show commit") [C.P.](# "Chris Palmer") Removed debug code
* 2020-09-19 [`a7803b1`](https://github.com/nophead/NopSCADlib/commit/a7803b1efbf92c5e27f3171d7e2a92634fa2d84f "show commit") [C.P.](# "Chris Palmer") Improved numerical accuarcy of catenary calculations.
* 2020-09-19 [`a7803b1`](https://github.com/nophead/NopSCADlib/commit/a7803b1efbf92c5e27f3171d7e2a92634fa2d84f "show commit") [C.P.](# "Chris Palmer") Improved numerical accuracy of catenary calculations.
### [v9.7.0](https://github.com/nophead/NopSCADlib/releases/tag/v9.7.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v9.6.1...v9.7.0 "diff with v9.6.1")
* 2020-09-19 [`1255e71`](https://github.com/nophead/NopSCADlib/commit/1255e712719ce66fd3b231e5c212ea69b0bb9f1c "show commit") [C.P.](# "Chris Palmer") Added catenary curves.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 KiB

After

Width:  |  Height:  |  Size: 265 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 KiB

After

Width:  |  Height:  |  Size: 326 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 KiB

After

Width:  |  Height:  |  Size: 337 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 KiB

After

Width:  |  Height:  |  Size: 202 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: 249 KiB

After

Width:  |  Height:  |  Size: 249 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 KiB

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 KiB

After

Width:  |  Height:  |  Size: 236 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 KiB

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 KiB

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

@@ -1,6 +1,6 @@
'Micro SD card', 1
'Fan 17mm x 8mm', 1
'Heatfit insert M2', 4
'Heatfit insert M2 x 4mm', 4
'Nut M2.5 x 2.2mm nyloc', 4
'Enviro+', 1
'Raspberry Pi Zero', 1
@@ -13,7 +13,7 @@
'SMD capacitor 1206 10uF', 1
'SMD resistor 0805 3K3 0.125W', 1
'SOT223 package FZT851', 1
'Veroboard 6 holes x 6strips', 1
'Veroboard 6 holes x 6 strips', 1
'Washer M2 x 5mm x 0.3mm', 4
'Washer M2.5 x 5.9mm x 0.5mm', 4
'Washer M3 x 7mm x 0.5mm', 3
1 'Micro SD card' 1
2 'Fan 17mm x 8mm' 1
3 'Heatfit insert M2' 'Heatfit insert M2 x 4mm' 4
4 'Nut M2.5 x 2.2mm nyloc' 4
5 'Enviro+' 1
6 'Raspberry Pi Zero' 1
13 'SMD capacitor 1206 10uF' 1
14 'SMD resistor 0805 3K3 0.125W' 1
15 'SOT223 package FZT851' 1
16 'Veroboard 6 holes x 6strips' 'Veroboard 6 holes x 6 strips' 1
17 'Washer M2 x 5mm x 0.3mm' 4
18 'Washer M2.5 x 5.9mm x 0.5mm' 4
19 'Washer M3 x 7mm x 0.5mm' 3

View File

@@ -55,7 +55,7 @@
"count": 1,
"assemblies": {},
"vitamins": {
"veroboard(fan_vb): Veroboard 6 holes x 6strips": {
"veroboard(fan_vb): Veroboard 6 holes x 6 strips": {
"count": 1
},
"wire_link(0.8, 10.16, tail = 2.5): Wire link 0.8mm x 0.4\"": {
@@ -102,7 +102,7 @@
"count": 1,
"assemblies": {},
"vitamins": {
"insert(F1BM2): Heatfit insert M2": {
"insert(F1BM2): Heatfit insert M2 x 4mm": {
"count": 4
},
"washer(M3_washer): Washer M3 x 7mm x 0.5mm": {

View File

@@ -15,7 +15,7 @@ Vitamins:
i e k e o e r n
1| | | | | | | | 1 Micro SD card
| | 1| | | | | | 1 Fan 17mm x 8mm
| | | 4| | | | | 4 Heatfit insert M2
| | | 4| | | | | 4 Heatfit insert M2 x 4mm
| | | | | 4| | | 4 Nut M2.5 x 2.2mm nyloc
| | | | 1| | | | 1 Enviro+
1| | | | | | | | 1 Raspberry Pi Zero
@@ -28,7 +28,7 @@ Vitamins:
| | | | | | 1| | 1 SMD capacitor 1206 10uF
| | | | | | 1| | 1 SMD resistor 0805 3K3 0.125W
| | | | | | 1| | 1 SOT223 package FZT851
| | | | | | 1| | 1 Veroboard 6 holes x 6strips
| | | | | | 1| | 1 Veroboard 6 holes x 6 strips
| | | | | | | 4| 4 Washer M2 x 5mm x 0.3mm
| | | | | 4| | | 4 Washer M2.5 x 5.9mm x 0.5mm
| | | 3| | | | | 3 Washer M3 x 7mm x 0.5mm

View File

@@ -1,6 +1,6 @@
case_assembly:
Vitamins:
4 Heatfit insert M2
4 Heatfit insert M2 x 4mm
3 Screw M3 pan x 6mm
3 Washer M3 x 7mm x 0.5mm

View File

@@ -3,6 +3,6 @@ Vitamins:
1 SMD capacitor 1206 10uF
1 SMD resistor 0805 3K3 0.125W
1 SOT223 package FZT851
1 Veroboard 6 holes x 6strips
1 Veroboard 6 holes x 6 strips
3 Wire link 0.8mm x 6.5mm
1 Wire link 0.8mm x 0.4"

View File

@@ -29,7 +29,7 @@ Environmental monitor using Enviro+ sensor board and a Raspberry Pi Zero.
| | | | | | | | | | **Vitamins** |
|   .  |   .  |   .  |   1  |   .  |   .  |   .  |   .  |   1  |    Enviro+ |
|   1  |   .  |   .  |   .  |   .  |   .  |   .  |   .  |   1  |    Fan 17mm x 8mm |
|   .  |   .  |   .  |   .  |   4  |   .  |   .  |   .  |   4  |    Heatfit insert M2 |
|   .  |   .  |   .  |   .  |   4  |   .  |   .  |   .  |   4  |    Heatfit insert M2 x 4mm |
|   .  |   1  |   .  |   .  |   .  |   .  |   .  |   .  |   1  |    Micro SD card |
|   .  |   .  |   .  |   .  |   .  |   4  |   .  |   .  |   4  |    Nut M2.5 x 2.2mm nyloc |
|   1  |   .  |   .  |   .  |   .  |   .  |   .  |   .  |   1  |    PMS5003 particle detector |
@@ -42,7 +42,7 @@ Environmental monitor using Enviro+ sensor board and a Raspberry Pi Zero.
|   .  |   .  |   .  |   .  |   .  |   .  |   2  |   .  |   2  |    Screw M2.5 pan x 6.4mm |
|   .  |   .  |   .  |   .  |   .  |   4  |   .  |   .  |   4  |    Screw M2.5 pan x 8mm |
|   .  |   .  |   .  |   .  |   3  |   .  |   .  |   .  |   3  |    Screw M3 pan x 6mm |
|   .  |   .  |   1  |   .  |   .  |   .  |   .  |   .  |   1  |    Veroboard 6 holes x 6strips |
|   .  |   .  |   1  |   .  |   .  |   .  |   .  |   .  |   1  |    Veroboard 6 holes x 6 strips |
|   .  |   .  |   .  |   .  |   .  |   .  |   .  |   4  |   4  |    Washer M2 x 5mm x 0.3mm |
|   .  |   .  |   .  |   .  |   .  |   4  |   .  |   .  |   4  |    Washer M2.5 x 5.9mm x 0.5mm |
|   .  |   .  |   .  |   .  |   3  |   .  |   .  |   .  |   3  |    Washer M3 x 7mm x 0.5mm |
@@ -121,7 +121,7 @@ Environmental monitor using Enviro+ sensor board and a Raspberry Pi Zero.
|1| SMD capacitor 1206 10uF|
|1| SMD resistor 0805 3K3 0.125W|
|1| SOT223 package FZT851|
|1| Veroboard 6 holes x 6strips|
|1| Veroboard 6 holes x 6 strips|
|1| Wire link 0.8mm x 0.4"|
|3| Wire link 0.8mm x 6.5mm|
@@ -183,7 +183,7 @@ It converts the PWM signal on GPI4 to a stead DC voltage so that the fan doesn't
### Vitamins
|Qty|Description|
|---:|:----------|
|4| Heatfit insert M2|
|4| Heatfit insert M2 x 4mm|
|3| Screw M3 pan x 6mm|
|3| Washer M3 x 7mm x 0.5mm|

View File

@@ -7,7 +7,6 @@
//
// Top level model
//
include <NopSCADlib/core.scad>
use <NopSCADlib/vitamins/veroboard.scad>
include <NopSCADlib/vitamins/smds.scad>
@@ -19,10 +18,9 @@ fan_vb = vero("fan_vb", "fan_controller", 6, 6, breaks = [[2, 1], [2 + eps, 5]],
[0, 1, 0, "link", 0, 4, undef, 2.5],
[0, 0, 0, "link", 0, 4, undef, 2.5],
[2, 5, 0, "-smd_res", RES0805, "3K3"],
[4, 4.7, 90, "-smd_cap", CAP1206, 1.2, "10uF"],
[4, 4.5, 90, "-smd_cap", CAP1206, 1.2, "10uF"],
[2, 2.5, 180, "-smd_sot", SOT223, "FZT851"],
],
joints = [[5, 1], [5, 5], [0, [0, 1, 5]]]
]
);
//! The fan controller is a single transistor wired as a Miller integrator that effectively multiplies the capacitor value by the gain of the transistor.
@@ -40,6 +38,6 @@ fan_vb = vero("fan_vb", "fan_controller", 6, 6, breaks = [[2, 1], [2 + eps, 5]],
//!
//! ![SMT](docs/smt.jpg)
//!
module fan_controller_assembly() rotate(90) vflip(!exploded()) veroboard_assembly(fan_vb, -vero_thickness(fan_vb) - 1.4, 0);
module fan_controller_assembly() rotate(90) vflip() veroboard_fastened_assembly(fan_vb, -vero_thickness(fan_vb) - 1.4, 0);
fan_controller_assembly();

View File

@@ -25,6 +25,7 @@ include <NopSCADlib/vitamins/fans.scad>
use <NopSCADlib/vitamins/insert.scad>
use <NopSCADlib/vitamins/veroboard.scad>
use <NopSCADlib/utils/round.scad>
use <NopSCADlib/utils/pcb.scad>
use <NopSCADlib/printed/foot.scad>
use <NopSCADlib/printed/printed_box.scad>
use <fan_controller.scad>
@@ -402,7 +403,7 @@ assembly("enviro") {
if(!exploded())
for(x = [8, 7, 3])
pcb_grid(pcb, x, 0, 0.05)
solder_meniscus(pcb, 0.39, 1);
solder_meniscus(0.39, 1);
}
//! * Screw the Enviro+ PCB to the front of the case using M2.5 x 8mm pan screws with washer and nuts on the inside.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 KiB

After

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 KiB

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -1,6 +1,6 @@
base_assembly:
Vitamins:
2 Heatfit insert M3
2 Heatfit insert M3 x 5.8mm
Printed:
1 socket_box.stl

View File

@@ -3,7 +3,7 @@
'Wire brown 30/0.25mm strands, length 150mm - not shown', 2
'Wire green & yellow 30/0.25mm strands, length 150mm - not shown', 2
'IEC inlet for ATX', 1
'Heatfit insert M3', 2
'Heatfit insert M3 x 5.8mm', 2
'4mm shielded jack socket blue', 2
'4mm shielded jack socket brown', 1
'4mm shielded jack socket green', 2
1 'Ferrule for 1.5mm^2 wire - not shown', 3
3 'Wire brown 30/0.25mm strands, length 150mm - not shown', 2
4 'Wire green & yellow 30/0.25mm strands, length 150mm - not shown', 2
5 'IEC inlet for ATX', 1
6 'Heatfit insert M3', 2 'Heatfit insert M3 x 5.8mm', 2
7 '4mm shielded jack socket blue', 2
8 '4mm shielded jack socket brown', 1
9 '4mm shielded jack socket green', 2

View File

@@ -7,7 +7,7 @@
"count": 1,
"assemblies": {},
"vitamins": {
"insert(F1BM3): Heatfit insert M3": {
"insert(F1BM3): Heatfit insert M3 x 5.8mm": {
"count": 2
}
},

View File

@@ -12,7 +12,7 @@ Vitamins:
| | | 2| 2 Wire brown 30/0.25mm strands, length 150mm - not shown
| | 1| 1| 2 Wire green & yellow 30/0.25mm strands, length 150mm - not shown
| | | 1| 1 IEC inlet for ATX
2| | | | 2 Heatfit insert M3
2| | | | 2 Heatfit insert M3 x 5.8mm
| | 2| | 2 4mm shielded jack socket blue
| | 1| | 1 4mm shielded jack socket brown
| | 2| | 2 4mm shielded jack socket green

View File

@@ -38,7 +38,7 @@ Earth leakage can be measured Canadian CSA style by disconnected the neutral lin
| &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;1&nbsp; | &nbsp;&nbsp;1&nbsp; | &nbsp;&nbsp; 4mm shielded jack socket brown |
| &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;2&nbsp; | &nbsp;&nbsp;2&nbsp; | &nbsp;&nbsp; 4mm shielded jack socket green |
| &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;3&nbsp; | &nbsp;&nbsp;3&nbsp; | &nbsp;&nbsp; Ferrule for 1.5mm^2 wire - not shown |
| &nbsp;&nbsp;2&nbsp; | &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;2&nbsp; | &nbsp;&nbsp; Heatfit insert M3 |
| &nbsp;&nbsp;2&nbsp; | &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;2&nbsp; | &nbsp;&nbsp; Heatfit insert M3 x 5.8mm |
| &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;3&nbsp; | &nbsp;&nbsp;5&nbsp; | &nbsp;&nbsp;8&nbsp; | &nbsp;&nbsp; Heatshrink sleeving ID 3.2mm x 15mm - not shown |
| &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;1&nbsp; | &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;1&nbsp; | &nbsp;&nbsp; IEC inlet for ATX |
| &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;1&nbsp; | &nbsp;&nbsp;1&nbsp; | &nbsp;&nbsp; Mains socket 13A |
@@ -65,7 +65,7 @@ Earth leakage can be measured Canadian CSA style by disconnected the neutral lin
### Vitamins
|Qty|Description|
|---:|:----------|
|2| Heatfit insert M3|
|2| Heatfit insert M3 x 5.8mm|
### 3D Printed parts

View File

@@ -99,6 +99,7 @@ use <utils/rounded_triangle.scad>
use <utils/layout.scad>
use <utils/round.scad>
use <utils/offset.scad>
use <utils/pcb_utils.scad>
use <utils/sector.scad>
use <utils/thread.scad>
use <vitamins/photo_interrupter.scad>
use <vitamins/photo_interrupter.scad>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 977 KiB

After

Width:  |  Height:  |  Size: 956 KiB

View File

@@ -96,6 +96,7 @@ use <tests/rails.scad>
use <tests/ring_terminals.scad>
use <tests/rockers.scad>
use <tests/rod.scad>
use <tests/SBR_rails.scad>
use <tests/screws.scad>
use <tests/sealing_strip.scad>
use <tests/servo_motors.scad>
@@ -144,7 +145,7 @@ x1 = x0 + 110;
x2 = x1 + 90;
x3 = x2 + 130;
x4 = x3 + 200;
x5 = 850;
x5 = 900;
x6 = x5 + 150;
cable_grommets_y = 0;
@@ -233,8 +234,8 @@ tubings_y = sealing_strip_y + 20;
pillars_y = tubings_y + 20;
ball_bearings_y = pillars_y + 40;
pulleys_y = ball_bearings_y + 40;
leadnuts_y = pulleys_y + 60;
linear_bearings_y = leadnuts_y + 50;
leadnuts_y = pulleys_y + 35;
linear_bearings_y = leadnuts_y + 65;
steppers_y = linear_bearings_y + 110;
sheets_y = steppers_y + 55;
pcbs_y = sheets_y + 60;
@@ -289,7 +290,9 @@ translate([x0 + 120, leadnuts_y])
leadnuthousings();
translate([x0, linear_bearings_y]) {
linear_bearings();
translate([0, -30])
linear_bearings();
rods();
}
@@ -397,7 +400,7 @@ blowers_y = ssrs_y + 60;
hot_ends_y = blowers_y + 100;
batteries_y = hot_ends_y + 55;
panel_meters_y = batteries_y + 70;
extrusions_y = panel_meters_y + 80;
extrusions_y = panel_meters_y + 100;
translate([x3, veroboard_y])
veroboard_test();
@@ -465,11 +468,11 @@ rails_y = belts_y + 200;
extrusion_brackets_y = rails_y + 250;
sk_brackets_y = extrusion_brackets_y + 80;
kp_pillow_blocks_y = sk_brackets_y + 60;
scs_bearing_blocks_y = kp_pillow_blocks_y + 60;
bearing_blocks_y = kp_pillow_blocks_y + 60;
box_sections_y = batteries_y;
BLDC_y = scs_bearing_blocks_y + 120;
pot_y = BLDC_y + 40;
cable_strip_y = pot_y + 50;
BLDC_y = bearing_blocks_y + 180;
pot_y = bearing_blocks_y;
cable_strip_y = sheets_y + 30;
translate([0, transformers_y])
servo_motors();
@@ -484,9 +487,13 @@ translate([x4 + 200, belts_y + 58]) {
translate([x4 + 175, belts_y, -20])
drag_chains();
translate([x4, rails_y + 130])
translate([x4, rails_y + 130]) {
rails();
translate([305, 0])
sbr_rails();
}
translate([x4, cable_strip_y])
cable_strips();
@@ -502,8 +509,8 @@ translate([x4, extrusion_brackets_y])
translate([x1, swiss_clips_y + 50])
shaft_couplings();
translate([x4, scs_bearing_blocks_y])
scs_bearing_blocks();
translate([x4, bearing_blocks_y])
bearing_blocks();
translate([x4, BLDC_y])
bldc_motors();

484
readme.md

File diff suppressed because it is too large Load Diff

View File

@@ -80,9 +80,16 @@ def codify(word, url):
return '`' + word + '`'
return word
typos = [ # Typos that are ambiguous to codespell
('cnc_bit+_r', 'cnc_bit_r'),
('Udated', 'Updated'),
('decription', 'description'),
('Trainling', 'Trailing'),
]
def fixup_comment(comment, url):
comment = comment.replace('cnc_bit+_r', 'cnc_bit_r')
for typo in typos:
comment = comment.replace(typo[0], typo[1])
""" markup code words and fix new paragraphs """
result = ''
word = ''
@@ -162,6 +169,6 @@ if __name__ == '__main__':
# 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 ch.*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

@@ -201,7 +201,7 @@ def tests(tests):
body = bodies[type]
index[type] += [cap_name]
body += ['<a name="%s"></a>' % cap_name]
body += ['<a name="%s"></a>' % cap_name.lower()]
body += ["## " + cap_name]
doc = None
@@ -301,7 +301,7 @@ def tests(tests):
for type in types:
if i < len(index[type]):
name = sorted(index[type])[i]
print('<td> <a href = "#' + name + '">' + name + '</a> </td>', file = doc_file, end = '')
print('<td> <a href = "#' + name.lower() + '">' + name + '</a> </td>', file = doc_file, end = '')
else:
print('<td></td>', file = doc_file, end = '')
print('</tr>', file = doc_file)

View File

@@ -119,23 +119,30 @@ test_pcb = ["test_pcb", "Test PCB",
[ 25, 200, 0, "buzzer", 4.5, 8.5],
[ 25, 218, 0, "buzzer"],
[ 45, 5, 0, "link", inch(0.4), 0.75, undef, undef, [1.5, "red"]], // Sleeved link
[ 45, 9, 0, "link", inch(0.4)], // Flat link
[ 45, 12, 0, "ax_res", res1_8, 1000],
[ 45, 17, 0, "ax_res", res1_4, 10000],
[ 45, 1, 0, "link", inch(0.4), 0.75, undef, undef, [1.5, "red"]], // Sleeved link
[ 45, 3, 0, "link", inch(0.4)], // Flat link
[ 45, 6, 0, "ax_diode", DO_41, "1N4007"],
[ 45, 10, 0, "ax_diode", DO_35, "1N4148"],
[ 45, 14, 0, "ax_res", res1_8, 1000],
[ 45, 18, 0, "ax_res", res1_4, 10000],
[ 45, 22, 0, "ax_res", res1_2, 100000],
[ 35, 22, 0, "vero_pin"],
[ 35, 17, 0, "vero_pin", true],
[ 35, 9, 0, "link", 0, 5], // Vertical wire
[ 35, 8, 180, "rd_transistor", TO92, "78L05", undef, undef, "Regulator"],
[ 35, 13, 180, "rd_transistor", E_LINE, "ZTX853"],
[ 35, 3, 0, "link", 0, 5], // Vertical wire
[ 60, 9, 0, "link", inch(0.2), inch(0.4)], // Raised link
[ 60, 12, 0, "ax_res", res1_8, 1000000, 1, inch(0.1)],
[ 60, 17, 0, "ax_res", res1_4, 100, 2, inch(0.1)],
[ 60, 3, 0, "link", inch(0.2), inch(0.4)], // Raised link
[ 60, 6, 0, "ax_diode", DO_41, "1N4007", inch(0.1)],
[ 60, 10, 0, "ax_diode", DO_35, "1N4148", inch(0.1)],
[ 60, 14, 0, "ax_res", res1_8, 1000000, 1, inch(0.1)],
[ 60, 18, 0, "ax_res", res1_4, 100, 2, inch(0.1)],
[ 60, 22, 0, "ax_res", res1_2, 10, 10, inch(0.2)],
[ 33, 110, -90, "rd_xtal", HC49, "4MHz" ],
[ 28, 110, -90, "rd_xtal", HC49_4H, "10MHz" ],
[ 28, 103, -90, "rd_xtal", C_002RX, "60KHz", 2 ],
[ 28, 102, -90, "rd_xtal", C_002RX, "60KHz", 3, inch(0.1) ],
[ 30, 130,-90, "rd_xtal", ACT1100, "40MHz", 0.5 ],
[ 30, 150,-90, "rd_xtal", ACT1700, "80MHz", 0.5 ],
@@ -180,7 +187,10 @@ test_pcb = ["test_pcb", "Test PCB",
[ 78, 166, -90, "smd_soic", SOIC14, "74HC00"],
[ 71, 166, -90, "smd_soic", SOIC16, "ICL323"],
[ 64, 166, -90, "smd_soic", SOIC8, "M34063"],
[ 80, 150, 0, "chip", 10, 5, 1, grey(20)],
[ 70, 150, 0, "chip", 10, 5, 1, grey(20)],
[90, 140, -90, "relay", HF33F, "012-HSL-3F"],
[ 52, 206, 0, "2p54socket", 8, 1 ],
[ 52, 194, 0, "2p54socket", 8, 1, false, 0, false, "red" ],
@@ -196,5 +206,5 @@ test_pcb = ["test_pcb", "Test PCB",
if($preview)
let($show_threads = true)
let($show_threads = true, $solder = pcb_solder(test_pcb))
pcb(test_pcb);

46
tests/SBR_rails.scad Normal file
View File

@@ -0,0 +1,46 @@
//
// 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/sbr_rails.scad>
use <../utils/layout.scad>
use <../vitamins/bearing_block.scad>
length = 200;
sheet = 3;
module sbr_rails()
layout([for(r = sbr_rails) sbr_rail_base_width(r)], 10)
rotate([90, 180,0]) {
rail = sbr_rails[$i];
sbr_rail(rail, length);
carriage = sbr_rail_carriage(rail);
screw = sbr_rail_screw(rail);
sbr_bearing_block_assembly(carriage, sheet);
sbr_screw_positions(rail, length)
explode(20)
rotate([90,0,0])
screw(sbr_rail_screw(rail), 18);
}
if($preview)
sbr_rails();

View File

@@ -23,6 +23,7 @@ include <../vitamins/pcbs.scad>
module axials() {
pcb = PERF60x40;
pcb(pcb);
$solder = pcb_solder(pcb);
pcb_grid(pcb, 0, 2)
rotate(90)
@@ -36,14 +37,26 @@ module axials() {
wire_link(0.8, 0, 5);
for(i = [0 : len(ax_resistors) - 1]) {
pcb_grid(pcb, 2 * i + 2, 1 + [0, 0.5, 1.5][i])
x = 2 * i + 3 + len(ax_diodes);
pcb_grid(pcb, x, 1 + [0, 0.5, 1.5][i])
rotate(90)
ax_res(ax_resistors[i], [1000, 47000, 8200][i], 5);
pcb_grid(pcb, 2 * i + 2, 6.5)
pcb_grid(pcb, x, 6.5)
rotate(-90)
ax_res(ax_resistors[i], [2200, 39000, 8250][i], 1, inch(0.1));
}
d_values = ["1N4148", "1N4007"];
for(i = [0 : len(ax_diodes) - 1]) {
pcb_grid(pcb, i + 2, 1 + [0, 0.5, 1.5][i])
rotate(90)
ax_diode(ax_diodes[i], d_values[i]);
pcb_grid(pcb, i + 2, 6.5)
rotate(-90)
ax_diode(ax_diodes[i], d_values[i], inch(0.1));
}
}
if($preview)

View File

@@ -24,12 +24,26 @@ use <../utils/layout.scad>
module scs_bearing_blocks()
layout([for(s = scs_bearing_blocks) scs_size(s).x], 10) {
part_thickness = 5;
scs_bearing_block_assembly(scs_bearing_blocks[$i], part_thickness);
translate([0, 60])
scs_bearing_block_assembly(scs_bearing_blocks[$i], part_thickness);
if($i > 0) // skip $i==0, since no SCS6LUU long variant to match SCS6UU
translate([0, 60])
translate([0, 120])
scs_bearing_block_assembly(scs_bearing_blocks_long[$i - 1], part_thickness);
}
if($preview)
module sbr_bearing_blocks()
layout([for(s = sbr_bearing_blocks) sbr_size(s).x], 10) {
part_thickness = 5;
sbr_bearing_block_assembly(sbr_bearing_blocks[$i], part_thickness);
}
module bearing_blocks() {
scs_bearing_blocks();
translate([190, 0])
sbr_bearing_blocks();
}
if($preview)
bearing_blocks();

View File

@@ -22,7 +22,7 @@ use <../utils/layout.scad>
include <../vitamins/circlips.scad>
module circlips(all = false)
layout([for(c = circlips) circlip_d3(c)], 10, false) let(c = circlips[$i]) {
layout([for(c = circlips) circlip_d3(c)], 5, false) let(c = circlips[$i]) {
gap = circlip_d3(c) + 2;
internal_circlip(c, 1);

View File

@@ -21,13 +21,18 @@ use <../utils/layout.scad>
include <../vitamins/linear_bearings.scad>
module linear_bearings()
module linear_bearings() {
layout([for(b = linear_bearings) 2 * bearing_radius(b)]) {
linear_bearing(linear_bearings[$i]);
translate([0, 30])
linear_bearing(linear_bearings[$i]);
translate([0, 60])
linear_bearing(long_linear_bearings[$i]);
}
layout([for(b = open_linear_bearings) 2 * bearing_radius(b)])
translate([105, 0])
linear_bearing(open_linear_bearings[$i]);
}
if($preview)
linear_bearings();

48
tests/pcb_utils.scad Normal file
View File

@@ -0,0 +1,48 @@
//
// 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>
use <../utils/pcb_utils.scad>
module pcb_utils() {
let($solder = [1, 0, 1.6])
solder();
r = 2;
h = 10;
color(grey(20))
cylinder(r = r, h = h);
color("silver")
vflip()
cylinder(d = 0.6, h = 3, $fn = 16);
color("white")
translate_z(h / 2)
cylindrical_wrap(r = r)
resize([0, h * .8], auto = true)
rotate(90)
text("Hello", halign = "center", valign = "center");
}
if($preview)
rotate(-45)
pcb_utils();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 KiB

After

Width:  |  Height:  |  Size: 278 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 81 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: 51 KiB

After

Width:  |  Height:  |  Size: 58 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: 79 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 KiB

After

Width:  |  Height:  |  Size: 199 KiB

BIN
tests/png/pcb_utils.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 KiB

After

Width:  |  Height:  |  Size: 254 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 KiB

After

Width:  |  Height:  |  Size: 231 KiB

BIN
tests/png/sbr_rails.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 KiB

After

Width:  |  Height:  |  Size: 170 KiB

View File

@@ -20,12 +20,36 @@ include <../core.scad>
include <../vitamins/pcbs.scad>
module radials() {
pcb = PERF60x40;
pcb = PERF70x50;
pcb(pcb);
$solder = pcb_solder(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])
pcb_grid(pcb, [0.5, 1, 1.5, 9, 1][i], [4, 6, 10.5, 10.5, 16][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]);
pcb_grid(pcb, 8.5, 15.5)
rd_module(rd_modules[0], "012-HSL3F");
pcb_grid(pcb, 20 -0.4, 9)
rotate(-90)
rd_module(rd_modules[1], "12V 250ma");
for(i = [0 : len(rd_discs) - 1])
pcb_grid(pcb, 1 + 2.5 * i, 1) {
disc = rd_discs[i];
pitch = rd_disc_pitch(disc);
dx = round(pitch.x / inch(0.1)) * inch(0.1);
dy = round(pitch.y / inch(0.1)) * inch(0.1);
rotate(90 - atan2(dy, dx))
rd_disc(disc, pitch = norm([dy, dx]), z = 0.5, value = ["10nF", "470V",][i]);
}
for(i = [0 : len(rd_transistors) - 1])
pcb_grid(pcb, 5 + 3 * i, 5)
rotate(90)
rd_transistor(rd_transistors[i], ["ZTX853", "BC337"][i], lead_positions = inch(0.1) * [[-1, 0], [0, -sign(i)], [1, 0]]);
}
if($preview)

View File

@@ -24,14 +24,11 @@ use <../vitamins/veroboard.scad>
z_cable_ways = 20;
z_vb = ["z_vb", "z_bed_terminal", 5, z_cable_ways / 2 + 12, inch(0.1), false, M3_dome_screw,
[[2,2],[2,-3]], [], [5, 7, 9],
[[2,2],[2,-3]], [], [4, 5, 7, 9],
[
[3, z_cable_ways / 4 + 5.5, 0, "term254", z_cable_ways / 2, [1, 3]],
[0.5, z_cable_ways / 4 + 5.5, 90, "transition", z_cable_ways / 2, [1, 3]],
],
[
[[0,1,3], 6], [[0,1,3], 8], [[0,1,3],[10 : 6 + z_cable_ways / 2 - 1]],
]
];
module veroboard_test() translate([vero_length(z_vb) / 2, vero_width(z_vb) / 2]) {

View File

@@ -104,7 +104,7 @@ function reverse(v) = let(n = len(v) - 1) n < 0 ? [] : [for(i = [0 : n]) v[n - i
function angle_between(v1, v2) = acos(v1 * v2 / (norm(v1) * norm(v2))); //! Return the angle between two vectors
// http://eecs.qmul.ac.uk/~gslabaugh/publications/euler.pdf
function euler(R) = let(ay = asin(-R[2][0]), cy = cos(ay)) //! Convert a rotation matrix to a Euler rotation vector.
function euler(R) = let(ay = asin(-R[2][0]), cy = cos(ay)) //! Convert a rotation matrix to an Euler rotation vector.
cy ? [ atan2(R[2][1] / cy, R[2][2] / cy), ay, atan2(R[1][0] / cy, R[0][0] / cy) ]
: R[2][0] < 0 ? [atan2( R[0][1], R[0][2]), 90, 0]
: [atan2(-R[0][1], -R[0][2]), -90, 0];

58
utils/pcb_utils.scad Normal file
View File

@@ -0,0 +1,58 @@
//
// 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/>.
//
//
//! Utilities for making PCBs and components
//
include <../utils/core/core.scad>
module solder_meniscus(ir = 0.3, r) { //! Draw a solder meniscus
h = 0.7;
color("silver") rotate_extrude()
difference() {
square([r, h]);
translate([r + eps, h + eps])
ellipse(r - ir + eps, h, $fn = 64);
}
}
module solder(ir = 0.3) { //! Maybe add solder meniscus if $solder is set
if(!is_undef($solder))
vflip()
translate_z($solder.z)
solder_meniscus(ir = ir, r = $solder.x);
}
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);
}
}

View File

@@ -24,6 +24,7 @@
//! Presence of a decimal point is determined by the number of pins. Its position is determined by a heuristic.
//
include <../utils/core/core.scad>
use <../utils/pcb_utils.scad>
function 7_segment_size(type) = type[1]; //! Size of the body
@@ -98,11 +99,13 @@ module 7_segment_digit(type, colour = grey(95), pin_length = 6.4) { //! Draw the
}
color(silver)
translate_z(-pin_length)
linear_extrude(pin_length)
for(x = [0 : 1 : pins.x - 1], y = [0 : 1 : pins.y - 1])
translate([(x - (pins.x - 1) / 2) * pin_pitch.x, (y - (pins.y - 1) / 2) * pin_pitch.y])
circle(d = pin_pitch[2], $fn = 16);
for(x = [0 : 1 : pins.x - 1], y = [0 : 1 : pins.y - 1])
translate([(x - (pins.x - 1) / 2) * pin_pitch.x, (y - (pins.y - 1) / 2) * pin_pitch.y]) {
vflip()
cylinder(d = pin_pitch[2], h = pin_length, $fn = 16);
solder();
}
}
module 7_segment_digits(type, n, colour = grey(70), pin_length = 6.4, cutout = false) { //! Draw n digits side by side

View File

@@ -21,7 +21,8 @@
//! Axial components for PCBs.
//
include <../utils/core/core.scad>
include <../utils/round.scad>
use <../utils/round.scad>
use <../utils/pcb_utils.scad>
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"), arg(sleeve, false, "sleeve"),
@@ -40,15 +41,20 @@ module wire_link(d, l, h = 1, tail = 3, sleeve = false) { //! Draw a wire jumper
rotate_extrude(angle = 90)
translate([r, 0])
circle(d = d);
translate([side * l /2, 0])
solder(ir = d / 2);
}
translate_z(h)
rotate([0, 90, 0])
cylinder(d = d, h = l - 2 * r, center = true);
}
else
translate_z(-tail)
cylinder(d = d, h = tail + h);
else {
translate_z(-tail)
cylinder(d = d, h = tail + h);
solder(ir = d / 2);
}
if(sleeve)
color(sleeve[1])
@@ -151,3 +157,59 @@ module ax_res(type, value, tol = 5, pitch = 0) { //! Through hole axial resistor
}
}
}
function ax_diode_size(type) = type[1]; //! Body length, diameter and corner radius
function ax_diode_wire(type) = type[2]; //! Wire diameter
function ax_diode_colour(type) = type[3]; //! Body colour and stripe colour
module ax_diode(type, value, pitch = 0) { //! Through hole axial diode. If `pitch` is zero the minimum is used. If below the minimum the resistor is placed vertical.
vitamin(str("ax_diode(", type[0], ", \"", value, "\"): Diode ", value));
wire_d = ax_diode_wire(type);
size = ax_diode_size(type);
colours = ax_diode_colour(type);
body_r = size.y / 2;
length = size.x;
r = size.z;
$fn = 32;
orientate_axial(length, body_r, pitch, wire_d) {
color("darkred") {
gap = length / 20;
l = (length - gap) / 2 - r - 2 * eps;
for(end = [-1, 1])
translate_z(end * (l + gap) / 2)
cylinder(r = body_r * 0.8, h = l, center = true);
cylinder(r = wire_d / 2 + eps, h = gap + eps, center = true);
}
color(colours[0])
rotate_extrude()
hull() {
translate([0, -length / 2])
square([body_r - r, length]);
if(r) {
translate([body_r - r, -length / 2 + r])
circle(r);
translate([body_r - r, length / 2 - r])
circle(r);
}
}
color(colours[1]) {
translate_z(-length / 2 + r + eps)
cylinder(r = body_r + eps, h = length / 5);
tlength = 2 * PI * body_r * 0.8;
cylindrical_wrap(body_r)
resize([tlength, 0], auto = true)
text(value, halign = "center", valign = "center");
}
}
}

View File

@@ -27,4 +27,9 @@ res1_2 = ["res1_2", 0.5, 10, 3.25, 3.7, 1.8, 0.70, "#FAE3AC"];
ax_resistors = [res1_8, res1_4, res1_2];
DO_35 = ["DO_35", [3.4, 1.75, 0.3], 0.55, [[1,1,1, 0.5], grey(10)]];
DO_41 = ["DO_41", [5.21, 2.72, 0], 0.87, [grey(20), grey(90)]];
ax_diodes = [DO_35, DO_41];
use <axial.scad>

View File

@@ -41,6 +41,17 @@ function scs_circlip(type) = type[15]; //! Circlip used
function scs_spacer(type) = type[16]; //! Spacer used in long bearings
function sbr_size(type) = [type[4],type[6],type[5]]; //! Size of SBR bracket bounding block
function sbr_hole_offset(type) = type[2]; //! Offset of bearing hole from base of *rail*
function sbr_side_height(type) = type[3]; //! Height of side above *rail*
function sbr_screw(type) = type[10]; //! Screw type
function sbr_screw_separation_x(type) = type[7]; //! Screw separation in X direction
function sbr_screw_separation_z(type) = type[8]; //! Screw separation in Z direction
function sbr_bearing(type) = type[12]; //! Linear bearing used
function sbr_circlip(type) = type[13]; //! Circlip used
function sbr_spacer(type) = type[14]; //! Spacer used in long bearings
sks_bearing_block_colour = grey(90);
module scs_bearing_block(type) { //! Draw the specified SCS bearing block
@@ -63,11 +74,6 @@ module scs_bearing_block(type) { //! Draw the specified SCS bearing block
bearing = scs_bearing(type);
clip = scs_circlip(type);
module right_trapezoid(base, top, height, h = 0, center = true) {//! A right angled trapezoid with the 90&deg; corner at the origin. 3D when `h` is nonzero, otherwise 2D
extrude_if(h, center = center)
polygon(points = [ [0,0], [base, 0], [top, height], [0, height] ]);
}
boltHoleRadius = screw_clearance_radius(S1);
footHeight = min(0.75, (G - bearing_dia(bearing) - 1.5) / 2); // estimate, not specified on drawings
@@ -169,3 +175,142 @@ module scs_bearing_block_assembly(type, part_thickness, screw_type, nut_type) {
washer(washer_type);
}
}
/* SBR bearing blocks */
module sbr_bearing_block(type) { //! Draw the specified SBR bearing block
vitamin(str("sbr_bearing_block(", type[0], "): ", type[0], " bearing block"));
T = type[1];
h = sbr_hole_offset(type);
H = sbr_side_height(type);
W = sbr_size(type)[0];
G = sbr_size(type)[1];
M = sbr_size(type)[2];
J = sbr_screw_separation_x(type);
K = sbr_screw_separation_z(type);
S1 = sbr_screw(type);
I = type[11]; // screw length
S2 = type[15];
S2L = type[16];
bearing = sbr_bearing(type);
clip = sbr_circlip(type);
chamfer = 1.5;
A = type[9]; // size of chamfered overhang - vertical
Ah = A + chamfer * 2; // size of chamfered overhand - horizontal - not given in drawings
width = W - (2 * chamfer);
height = G - chamfer;
boltHoleRadius = screw_radius(S1);
setScrewRadius = screw_radius(S2);
color(sks_bearing_block_colour) {
render() difference() {
linear_extrude(M, center = true, convexity=2) {
cutoutheight = 15; // chosen to fit SBR16, may not work with others
bearingRadius = bearing_dia(bearing) / 2;
bearingTheta = open_bearing_theta(bearing);
bearingOpening = open_bearing_width(bearing);
bearingOpeningBig = bearingOpening + (tan(bearingTheta/2) * cutoutheight);
// center section with bearing hole
difference() {
translate([-width/2, -(H-h - chamfer)])
square([width, height]);
circle(r = bearingRadius);
for(m = [0, 1])
mirror([m, 0, 0])
translate([0, h - (cutoutheight/2) - H + G + 0.1])
right_trapezoid(bearingOpening/2, bearingOpeningBig/2, cutoutheight/2);
}
// add the sides
for(m = [0, 1])
mirror([m, 0, 0]) {
translate([-(W/2) + chamfer, -((H-h))]) {
difference() {
union() {
right_trapezoid(Ah - chamfer,Ah,chamfer);
rotate([0,0,90])
right_trapezoid(A + chamfer,A,chamfer);
}
translate([-(chamfer +0.1), -0.1,0])
right_trapezoid(chamfer/2 + 0.2, 0, chamfer/2+ 0.2);
}
}
}
}
// bolt holes
for(x = [-J / 2, J / 2])
translate([x, h - H + I/2 - 0.1, 0])
rotate([90, 0, 0])
for (y = [-K / 2, K / 2])
translate([0, y])
cylinder(r = boltHoleRadius, h=I + 0.1, center=true);
// set screw holes
translate([-width/2 + S2L/2 - 0.1,0,0])
rotate([0,90,0])
cylinder(r = setScrewRadius, h=S2L, center=true);
translate([0,-(H-h) + chamfer + S2L/2 -0.1,0])
rotate([0,90,90])
cylinder(r = setScrewRadius, h=S2L, center=true);
}
}
not_on_bom() no_explode() {
spacer = sbr_spacer(type);
for(end = spacer ? [-1, 1] : 0)
translate_z(end * (bearing_length(bearing) + spacer) / 2)
rotate([0,0,-90])
linear_bearing(bearing);
for(end = [-1, 1])
translate_z(end * ((spacer ? 2 * bearing_length(bearing) + spacer : bearing_length(bearing)) + circlip_thickness(clip)) / 2)
rotate(180)
internal_circlip(clip);
translate([-width/2 - 0.1,0,0])
rotate([0,90,180])
screw(S2, S2L);
translate([0,-(H-h) + chamfer - 0.1,0])
rotate([0,90,270])
screw(S2, S2L);
}
}
module sbr_bearing_block_hole_positions(type) { //! Place children at hole positions
y = sbr_hole_offset(type) - sbr_side_height(type);
screw_separation_x = sbr_screw_separation_x(type);
screw_separation_z = sbr_screw_separation_z(type);
for(x = [-screw_separation_x, screw_separation_x], z = [-screw_separation_z, screw_separation_z])
translate([x / 2, y, z / 2])
rotate([-90, 0, 0])
children();
}
module sbr_bearing_block_assembly(type, part_thickness, screw_type) { //! Assembly with screws in place
I = type[11]; // screw length
sbr_bearing_block(type);
screw_type = is_undef(screw_type) ? sbr_screw(type) : screw_type;
G = sbr_size(type)[1];
screw_length = screw_shorter_than(I + part_thickness);
translate([0,-part_thickness,0])
sbr_bearing_block_hole_positions(type)
rotate([0,180,0])
screw(screw_type, screw_length);
}
/* Generic bearing block functions */
module right_trapezoid(base, top, height, h = 0, center = true) {//! A right angled trapezoid with the 90&deg; corner at the origin. 3D when `h` is nonzero, otherwise 2D
extrude_if(h, center = center)
polygon(points = [ [0,0], [base, 0], [top, height], [0, height] ]);
}

View File

@@ -36,8 +36,12 @@ SCS10LUU = ["SCS10LUU", 8, 13, 20, 40, 68, 26, 21, 28, 45, 6, M5_cap_sc
SCS12LUU = ["SCS12LUU", 8, 15, 21, 42, 70, 28, 24, 30.5, 50, 5.75, M5_cap_screw, 4.3, 12, LM12UU, circlip_21i, 4];
SCS16LUU = ["SCS16LUU", 9, 19, 25, 50, 85, 38.5, 32.5, 36, 60, 7, M5_cap_screw, 4.3, 12, LM16UU, circlip_28i, 4];
// T h H W M G J K A S1 I LB S2 S2L
SBR16UU = ["SBR16UU", 16, 25, 45, 45, 45, 33, 32, 30, 9, M5_cap_screw, 12, LM16UUOP, circlip_28iw, 0, M5_grub_screw, 5];
scs_bearing_blocks = [SCS6UU, SCS8UU, SCS10UU, SCS12UU, SCS16UU];
scs_bearing_blocks_long = [SCS8LUU, SCS10LUU, SCS12LUU, SCS16LUU];
sbr_bearing_blocks = [SBR16UU];
use <bearing_block.scad>

View File

@@ -32,14 +32,14 @@ function circlip_thickness(type) = type[4]; //! Thickness
function circlip_a(type) = type[5]; //! Size of the lugs
function circlip_b(type) = type[6]; //! Widest part of the taper
function circlip_d5(type) = type[7]; //! Plier hole diameter
function circlip_closed_angle(type) = is_undef(type[8]) ? 25 : type[8]; //! Closed angle
circlip_colour = grey(20);
closed_angle = 25;
module internal_circlip(type, open = 0) { //! Draw specified internal circlip, open = 0, for nominal size installed, 1 for relaxed uninstalled, -1 for squeezed to install
d1 = circlip_d1(type);
vitamin(str("circlip(", type[0], "): Circlip internal ", d1, "mm"));
wide = is_undef(type[8]) ? "" : " (wide opening)";
vitamin(str("circlip(", type[0], "): Circlip internal ", d1, "mm",wide));
d3 = circlip_d3(type);
d2 = circlip_d2(type);
a = circlip_a(type);
@@ -50,7 +50,7 @@ module internal_circlip(type, open = 0) { //! Draw specified internal circlip, o
or = od / 2;
c = (d3 - d1);
angle = (od - d1) / d1 * 360 + closed_angle;
angle = (od - d1) / d1 * 360 + circlip_closed_angle(type);
tab_angle = 360 * a / PI / od;
p = [0, -or + b / 2, 1] * rot3_z(angle / 2 + tab_angle);
pitch = (or - a / 2);

View File

@@ -22,7 +22,8 @@ circlip_15i = ["circlip_15i", 15, 15.7, 16.2, 1.0, 3.7, 2.0, 1.7];
circlip_19i = ["circlip_19i", 19, 20.0, 20.5, 1.0, 4.1, 2.2, 2.0];
circlip_21i = ["circlip_21i", 21, 22.0, 22.5, 1.0, 4.2, 2.4, 2.0];
circlip_28i = ["circlip_28i", 28, 29.4, 30.1, 1.2, 4.8, 2.9, 2.0];
circlip_28iw = ["circlip_28iw", 28, 29.4, 30.1, 1.2, 4.8, 2.9, 2.0, 100]; // with wide opening
circlips = [circlip_12i, circlip_15i, circlip_19i, circlip_21i, circlip_28i];
circlips = [circlip_12i, circlip_15i, circlip_19i, circlip_21i, circlip_28i, circlip_28iw];
use <circlip.scad>

View File

@@ -22,6 +22,7 @@
//
include <../utils/core/core.scad>
use <../utils/thread.scad>
use <../utils/pcb_utils.scad>
d_pillar_colour = grey(90);
d_plug_shell_colour = grey(80);
@@ -194,6 +195,10 @@ module d_plug(type, socket = false, pcb = false, idc = false) { //! Draw specifi
cube([3, 3, 3], center = true);
}
}
if(pcb)
translate_z(-d_pcb_offset(type))
pin_positions()
solder(0.75 / 2);
}
module d_socket(connector, pcb = false, idc = false) //! Draw specified D socket, which can be IDC, PCB or plain solder bucket

View File

@@ -21,6 +21,7 @@
//! Dual inline IC packages and sockets
//
include <../utils/core/core.scad>
use <../utils/pcb_utils.scad>
pdip_pin = [0.25, 2.54, 0.5, 3.0, 1.524, 1];
@@ -178,4 +179,6 @@ module pdip(pins, part, socketed, w = inch(0.3), pitch = inch(0.1)) { //! Draw s
dip(n, part, [length, width, height], w, pitch, pdip_pin);
else
dip(n, part, [length, width, height], w, pitch, pdip_pin);
dil_pin_positions(n, w, pitch)
solder();
}

View File

@@ -22,6 +22,7 @@
//
include <../utils/core/core.scad>
use <../utils/tube.scad>
use <../utils/pcb_utils.scad>
function gt_pitch(type) = type[1]; //! Pitch between terminals
function gt_depth(type) = type[2]; //! Total front to back depth
@@ -172,6 +173,7 @@ module green_terminal(type, ways, skip = [], colour = "lime") { //! Draw green t
translate_z(-pin_l / 2)
cube([0.44, 0.75, pin_l], center = true); // pin
solder();
}
}
for(i = [0: ways - 1])

View File

@@ -22,6 +22,7 @@
//
include <../utils/core/core.scad>
use <../utils/rounded_cylinder.scad>
use <../utils/pcb_utils.scad>
function led_diameter(type) = type[1]; //! Body diameter
function led_rim_dia(type) = type[2]; //! Rim diameter
@@ -50,7 +51,11 @@ module led(type, colour = "red", lead = 5) { //! Draw specified LED with desired
}
color("silver")
for(side = [-1, 1], len = lead - (lead < 3 ? 0 : side))
translate([side * led_pitch(type) / 2, 0, -len / 2])
translate([side * led_pitch(type) / 2, 0]) {
vflip()
cube([led_lead_t(type), led_lead_t(type), len], center = true);
translate_z(len / 2)
cube([led_lead_t(type), led_lead_t(type), len], center = true);
solder();
}
}

View File

@@ -23,6 +23,7 @@
include <../utils/core/core.scad>
use <../utils/tube.scad>
use <../utils/sector.scad>
bearing_colour = grey(70);
groove_colour = grey(60);
@@ -36,6 +37,10 @@ function bearing_groove_length(type) = type[4]; //! Groove length
function bearing_groove_dia(type) = type[5]; //! Groove diameter
function bearing_groove_spacing(type) = type[6]; //! Spacing between grooves, outer to outer, ie includes the grooves themselves
function open_bearing_width(type) = type[7]; //! For open bearings, the width of the opening at the rod
function open_bearing_theta(type) = 2 * asin(open_bearing_width(type) / bearing_rod_dia(type)); //! For open bearings, the angle of the opening
function bearing_radius(type) = bearing_dia(type) / 2; //! Outside radius
module linear_bearing(type) { //! Draw specified linear bearing
@@ -50,21 +55,34 @@ module linear_bearing(type) { //! Draw specified linear bearing
gs = bearing_groove_spacing(type);
offset = (length-gs)/2;
module cut_tube(or, ir, h, center = true)
linear_extrude(h, center = center, convexity = 5)
difference() {
ring(or = or, ir = ir);
// Open bearing
if (!is_undef(type[7])) {
theta = open_bearing_theta(type);
sector(or + 1, 180 - theta / 2, 180 + theta / 2);
}
}
if(gs==0) {
color(bearing_colour) tube(or = or, ir = casing_ir, h = length);
} else {
translate_z(-length/2) {
color(bearing_colour) tube(or = or, ir = casing_ir, h = offset, center = false);
color(groove_colour) translate_z(offset) tube(or = gr, ir = casing_ir, h = gl,center = false);
color(bearing_colour) translate_z(offset+gl) tube(or = or, ir = casing_ir, h = gs-2*gl, center = false);
color(groove_colour) translate_z(offset+gs-gl) tube(or = gr, ir = casing_ir, h = gl, center = false);
color(bearing_colour) translate_z(offset+gs) tube(or = or, ir = casing_ir, h = offset, center = false);
color(bearing_colour) cut_tube(or = or, ir = casing_ir, h = offset, center = false);
color(groove_colour) translate_z(offset) cut_tube(or = gr, ir = casing_ir, h = gl,center = false);
color(bearing_colour) translate_z(offset+gl) cut_tube(or = or, ir = casing_ir, h = gs-2*gl, center = false);
color(groove_colour) translate_z(offset+gs-gl) cut_tube(or = gr, ir = casing_ir, h = gl, center = false);
color(bearing_colour) translate_z(offset+gs) cut_tube(or = or, ir = casing_ir, h = offset, center = false);
}
}
rod_r = bearing_rod_dia(type) / 2;
color(seal_colour)
tube(or = casing_ir, ir = rod_r + eps, h = length - 0.5);
cut_tube(or = casing_ir, ir = rod_r + eps, h = length - 0.5);
color(seal_colour * 0.8)
tube(or = rod_r * 1.12, ir = rod_r, h = length);
cut_tube(or = rod_r * 1.12, ir = rod_r, h = length);
}

View File

@@ -20,25 +20,27 @@
//
// Linear bearings
//
// L od id gl gd gs
LM16UU = ["LM16UU", 37, 28, 16, 1.6, 27.0, 26.5];
LM16LUU = ["LM16LUU", 70, 28, 16, 1.6, 27.0, 53.0];
LM12UU = ["LM12UU", 30, 21, 12, 1.3, 20.0, 23.0];
LM12LUU = ["LM12LUU", 57, 21, 12, 1.3, 20.0, 46.0];
LM10UU = ["LM10UU", 29, 19, 10, 1.3, 18.0, 22.0];
LM10LUU = ["LM10LUU", 55, 19, 10, 1.3, 18.0, 44.0];
LM8UU = ["LM8UU", 24, 15, 8, 1.1, 14.3, 17.5];
LM8LUU = ["LM8LUU", 45, 15, 8, 1.1, 14.3, 35.0];
LM6UU = ["LM6UU", 19, 12, 6, 1.1, 11.5, 13.5];
LM6LUU = ["LM6LUU", 35, 12, 6, 1.1, 11.5, 27.0];
LM5UU = ["LM5UU", 15, 10, 5, 1.1, 9.5, 10.2];
LM5LUU = ["LM5LUU", 28, 10, 5, 1.1, 9.5, 20.4];
LM4UU = ["LM4UU", 12, 8, 4, 0, 0, 0];
LM4LUU = ["LM4LUU", 23, 8, 4, 0, 0, 0];
LM3UU = ["LM3UU", 10, 7, 3, 0, 0, 0];
LM3LUU = ["LM3LUU", 19, 7, 3, 0, 0, 0];
// L od id gl gd gs h1
LM16UU = ["LM16UU", 37, 28, 16, 1.6, 27.0, 26.5];
LM16LUU = ["LM16LUU", 70, 28, 16, 1.6, 27.0, 53.0];
LM16UUOP = ["LM16UUOP", 37, 28, 16, 1.6, 27.0, 26.5, 11];
LM12UU = ["LM12UU", 30, 21, 12, 1.3, 20.0, 23.0];
LM12LUU = ["LM12LUU", 57, 21, 12, 1.3, 20.0, 46.0];
LM10UU = ["LM10UU", 29, 19, 10, 1.3, 18.0, 22.0];
LM10LUU = ["LM10LUU", 55, 19, 10, 1.3, 18.0, 44.0];
LM8UU = ["LM8UU", 24, 15, 8, 1.1, 14.3, 17.5];
LM8LUU = ["LM8LUU", 45, 15, 8, 1.1, 14.3, 35.0];
LM6UU = ["LM6UU", 19, 12, 6, 1.1, 11.5, 13.5];
LM6LUU = ["LM6LUU", 35, 12, 6, 1.1, 11.5, 27.0];
LM5UU = ["LM5UU", 15, 10, 5, 1.1, 9.5, 10.2];
LM5LUU = ["LM5LUU", 28, 10, 5, 1.1, 9.5, 20.4];
LM4UU = ["LM4UU", 12, 8, 4, 0, 0, 0];
LM4LUU = ["LM4LUU", 23, 8, 4, 0, 0, 0];
LM3UU = ["LM3UU", 10, 7, 3, 0, 0, 0];
LM3LUU = ["LM3LUU", 19, 7, 3, 0, 0, 0];
linear_bearings = [LM3UU, LM4UU, LM5UU, LM6UU, LM8UU, LM10UU, LM12UU, LM16UU];
long_linear_bearings = [LM3LUU, LM4LUU, LM5LUU, LM6LUU, LM8LUU, LM10LUU, LM12LUU, LM16LUU];
open_linear_bearings = [LM16UUOP];
use <linear_bearing.scad>

View File

@@ -33,6 +33,8 @@ use <../utils/rounded_cylinder.scad>
use <../utils/dogbones.scad>
use <../utils/thread.scad>
use <../utils/tube.scad>
use <../utils/pcb_utils.scad>
use <d_connector.scad>
use <led.scad>
use <dip.scad>
@@ -215,12 +217,14 @@ module molex_usb_Ax2(cutout) { //! Draw Molex dual USB A connector suitable for
color(silver)
rotate(-90) {
for(x = [-1.5 : 1 : 1.5], y = [0.5 : 1 : 1.5])
translate([inch(x / 10), -l / 2 + inch(y / 10)])
translate([inch(x / 10), -l / 2 + inch(y / 10)]) {
hull() {
cube([0.6, 0.3, 2 * pin_l - 2], center = true);
cube([0.4, 0.3, 2 * pin_l], center = true);
}
solder();
}
for(side = [-1, 1], end = [0, 1])
translate([side * w / 2, -l / 2 + tag_w / 2 + end * tag_p])
@@ -272,12 +276,14 @@ module molex_usb_Ax1(cutout) { //! Draw Molex USB A connector suitable for perf
color(silver)
rotate(-90) {
for(x = [-1.5 : 1 : 1.5])
translate([inch(x / 10), - l / 2 + inch(0.05)])
translate([inch(x / 10), - l / 2 + inch(0.05)]) {
hull() {
cube([0.6, 0.3, 2 * pin_l - 2], center = true);
cube([0.4, 0.3, 2 * pin_l], center = true);
}
solder();
}
for(side = [-1, 1])
translate([side * w / 2, -l / 2 + 4.2])
@@ -893,6 +899,8 @@ module terminal_35(ways, colour = "blue") { //! Draw 3.5mm terminal block
translate_z(box_z - pin_l)
cylinder(d = pin_d, h = pin_l + box_z, $fn = 16); // pin
solder(pin_d / 2);
translate_z(box_z + box_h / 2) // terminal
rotate([0, -90, 0]) {
linear_extrude(depth - 2, center = true)
@@ -940,7 +948,7 @@ module molex_254(ways, right_angle = 0, skip = undef) { //! Draw molex KK header
height = 8.15;
base = 3.18;
back = 1;
below = 2.3;
below = 3.3;
above = 9;
pin_w = 0.64;
r = 1;
@@ -971,6 +979,8 @@ module molex_254(ways, right_angle = 0, skip = undef) { //! Draw molex KK header
translate_z((a + below) / 2 - below)
cube([pin_w, pin_w, a + below], center = true);
solder();
l = above + ra_offset - r - pin_w / 2;
if(right_angle) {
translate([-l / 2 - r - pin_w / 2, 0, depth / 2])
@@ -1008,6 +1018,7 @@ module vero_pin(cropped = false) { //! Draw a vero pin
translate([d / 2, 0, -spline_h])
rounded_rectangle([spline_d - d, spline_w, spline_h], spline_w / 4, center = false);
}
solder(d / 2);
}
module standoff(h, d, h2, d2) { //! Draw a standoff
@@ -1135,7 +1146,12 @@ 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, "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_diode")) ax_diode(type = comp[4], value = comp[5], pitch = param(6, 0));
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, "rd_disc")) rd_disc(type = comp[4], value = param(5, undef), z = param(6, 0), pitch = param(7, inch(0.2))); // type, value, z, forced pitch
if(show(comp, "rd_module")) rd_module(type = comp[4], value = comp[5]);
if(show(comp, "rd_transistor")) rd_transistor(type = comp[4], value = comp[5], lead_positions = param(6, undef), z = param(7, 5), kind = param(8,"Transistor"));
// type, value, lead positions, z, kind
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, "molex_hdr")) molex_254(comp[4], param(5, 0), param(6, undef));
@@ -1196,16 +1212,17 @@ module pcb_components(type, cutouts = false, angle = undef) { //! Draw list of P
}
module pcb_grid_components(type, components, cutouts = false, angle = undef) //! Draw list of components on the PCB grid for perf board
for(comp = components) {
p = pcb_grid_pos(type, comp.x, comp.y);
if(comp[3][0] == "-")
translate([p.x, p.y])
vflip()
let($solder = pcb_solder(type))
for(comp = components) {
p = pcb_grid_pos(type, comp.x, comp.y);
if(comp[3][0] == "-")
translate([p.x, p.y])
vflip()
pcb_component(comp, cutouts, angle);
else
translate([p.x, p.y, pcb_thickness(type)])
pcb_component(comp, cutouts, angle);
else
translate([p.x, p.y, pcb_thickness(type)])
pcb_component(comp, cutouts, angle);
}
}
module pcb_cutouts(type, angle = undef) //! Make cut outs to clear components on a PCB
@@ -1225,6 +1242,10 @@ module pcb_grid_positions(type) {
}
}
plating = 0.1;
function pcb_solder(type) = [1, 0, pcb_thickness(type) + plating];
module pcb(type) { //! Draw specified PCB
grid = pcb_grid(type);
t = pcb_thickness(type);
@@ -1260,7 +1281,6 @@ module pcb(type) { //! Draw specified PCB
land = pcb_land_d(type);
land_r = Len(land) > 2 ? land[2] : 0;
hole = pcb_hole_d(type);
plating = 0.1;
color(Len(land) > 3 ? land[3] : silver)
translate_z(t / 2)
linear_extrude(t + 2 * plating, center = true)
@@ -1310,7 +1330,8 @@ module pcb(type) { //! Draw specified PCB
}
}
pcb_components(type);
let($solder = is_undef($solder) ? undef : pcb_solder(type)) // Handle PCB sub assembly on perfoard
pcb_components(type);
}
module pcb_spacer(screw, height, wall = 1.8, taper = 0) { //! Generate STL for PCB spacer
@@ -1374,4 +1395,4 @@ module pcb_assembly(type, height, thickness) { //! Draw PCB assembly with spaces
nut_and_washer(screw_nut(screw), true);
}
}
}
}

View File

@@ -1040,11 +1040,46 @@ PanelDue_v3 = ["PanelDue_v3", "Panel Due v3.0a LCD Display interface", 53, 73, 1
],
];
//================================================
// Adafruit Feather
// by Chris Lott, chris@thestumbler.io
// Sacheon South Korea, 17 Jul 2023
//================================================
// NOTES:
// * mounting holes should be accurate
// * corner radius was just eyeballed
// * pin headers should be accurate
// * battery and qwiik connectore just eyeballed
Feather405 = let(size = [inch(2.0), inch(0.9)])
["Feather405", "Adafruit Feather 405",
size.x, size.y, 1.6, inch(0.10),
inch(0.1), inch(0.175), "green", false,
[[ inch(0.1), inch(0.1) ], // Holes
[ -inch(0.1), inch(0.1) ],
[ -inch(0.1), -inch(0.1) ],
[ inch(0.1), -inch(0.1) ],
],
[
[size.x / 2, inch(0.05), 0, "-2p54header", 16, 1],
[inch(1.2), -inch(0.05), 0, "-2p54header", 12, 1],
[inch(1.3), size.y / 2, -90, "smd_qfp", QFP50P1200X1200X160_64N, "STM32F405"],
[ 3, size.y / 2, 180, "usb_C"],
[ 10, -6.5, 180, "jst_ph", 2, true, grey(25) ],
[ -5, 0.40 * size.y, 90, "jst_zh", 4, true, grey(30) ],
], // components
[], // accessories
[inch(0.65), inch(0.05), 12, 2, gold, inch(0.1), inch(0.8),
inch(0.25), inch(0.05), 4, 1, gold, inch(0.1), 0 ], // grids of holes for the pins
[], // polygon
M2p5_dome_screw,
];
tiny_pcbs = [XIAO, MP1584EN, TP4056, ESP_01, LIPO_fuel_gauge];
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 = [RAMPSEndstop, MT3608, KY_040, L9110S, ZC_A0591, ArduinoNano, Feather405, 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];

View File

@@ -19,6 +19,7 @@
//! Pin headers and sockets, etc.
include <../utils/core/core.scad>
use <../utils/dogbones.scad>
use <../utils/pcb_utils.scad>
panel_clearance = 0.5;
housing_height = 14.12; // measured height of a Dupont connector.
@@ -37,17 +38,19 @@ function hdr_y_offset(type) = type[10]; //! Y offset of pins from center of
function hdr_ra_box_offset(type)= type[11]; //! Offset between back of the box and the pins
function hdr_ra_height(type) = type[12]; //! Height of right angle connector
module pin(type, length = undef) { //! Draw a header pin
module pin(type, length = undef, colour = undef) { //! Draw a header pin
w = hdr_pin_width(type);
l = length == undef ? hdr_pin_length(type) : length;
chamfer = w / 2;
color(hdr_pin_colour(type))
color(is_undef(colour) ? hdr_pin_colour(type) : colour)
translate_z(l / 2 - hdr_pin_below(type))
hull() {
cube([w, w, l - 2 * chamfer], center = true);
cube([w - chamfer, w - chamfer, l], center = true);
}
color(silver)
solder();
}
module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cutout = false, colour) { //! Draw pin header
@@ -89,7 +92,8 @@ module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cu
// Horizontal part of the pin
translate([pin.x, pin.y - hdr_pin_below(type), pin.z])
rotate([-90, 0, 180])
pin(type, hdr_pin_length(type) - hdr_pin_below(type) + ra_offset + y * pitch);
let($solder = undef)
pin(type, hdr_pin_length(type) - hdr_pin_below(type) + ra_offset + y * pitch);
// corner
translate([pin.x, pin.y - w / 2, pin.z - w / 2])
@@ -154,7 +158,8 @@ module box_header(type, cols = 1, rows = 1, smt = false, cutout = false, right_a
// 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);
let($solder = undef)
pin(type, hdr_pin_length(type) - hdr_pin_below(type) + ra_offset + y * pitch);
// corner
translate([pin.x, pin.y + pw / 2, pin.z - pw / 2])
@@ -251,8 +256,7 @@ module pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt
square(hdr_pin_width(type), center = true);
}
color(hdr_pin_colour(type))
for(x = [0 : cols - 1], y = [0 : rows -1]) {
for(x = [0 : cols - 1], y = [0 : rows -1]) {
if(!smt)
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2), 0])
pin(type, hdr_pin_below(type) + (y + 0.5) * pitch);
@@ -260,14 +264,16 @@ module pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt
if(right_angle) {
rotate([-90, 0, 180])
translate([pitch * (x - (cols - 1) / 2), -pitch * (y - (rows - 1) / 2) - width / 2, hdr_pin_below(type) - (y - (rows - 1) / 2) * pitch])
pin(type, hdr_pin_below(type) + (y - 0.5) * pitch);
let($solder = undef)
pin(type, hdr_pin_below(type) + (y - 0.5) * pitch);
w = hdr_pin_width(type);
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2) - w / 2, pitch * (y - (rows - 1) / 2) + width / 2 - w / 2])
rotate([0, -90, 0])
rotate_extrude(angle = 90, $fn = 32)
translate([0, -w / 2])
square(w);
color(hdr_pin_colour(type))
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2) - w / 2, pitch * (y - (rows - 1) / 2) + width / 2 - w / 2])
rotate([0, -90, 0])
rotate_extrude(angle = 90, $fn = 32)
translate([0, -w / 2])
square(w);
}
}
}
@@ -351,25 +357,26 @@ module jst_xh_header(type, pin_count, right_angle = false, colour = false, pin_c
translate([0, y_offset])
jst_xh_socket(type, pin_count);
color(pin_colour)
for(x = [0 : pin_count - 1]) {
below = !smt ? 0 : hdr_pin_below(type);
verticalPinLength = right_angle ? hdr_pin_below(type) + ra_z + y_offset : hdr_pin_length(type);
horizontalPinLength = hdr_pin_length(type) - hdr_pin_below(type) + ra_box_offset;
translate([pitch * (x - (pin_count - 1) / 2), 0]) {
translate_z(below)
pin(type, verticalPinLength - below);
pin(type, verticalPinLength - below, colour = pin_colour);
if(right_angle) {
translate([0, -pinWidth / 2, ra_z - pinWidth / 2 + y_offset])
rotate([0, -90, 0])
rotate_extrude(angle = 90, $fn = 32)
translate([0, -pinWidth / 2])
square(pinWidth);
color(pin_colour)
translate([0, -pinWidth / 2, ra_z - pinWidth / 2 + y_offset])
rotate([0, -90, 0])
rotate_extrude(angle = 90, $fn = 32)
translate([0, -pinWidth / 2])
square(pinWidth);
translate([0, -hdr_pin_below(type), ra_z + y_offset])
rotate([90, 0, 0])
pin(type, horizontalPinLength);
let($solder = undef)
pin(type, horizontalPinLength, colour = pin_colour);
}
}
}

View File

@@ -21,31 +21,17 @@
//! Radial components for PCBs.
//
include <../utils/core/core.scad>
include <../utils/sweep.scad>
include <../utils/rounded_polygon.scad>
include <../utils/rounded_cylinder.scad>
use <../utils/sweep.scad>
use <../utils/rounded_polygon.scad>
use <../utils/rounded_cylinder.scad>
use <../utils/pcb_utils.scad>
use <../utils/bezier.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])
@@ -57,25 +43,47 @@ module lead_positions(p, z) {
children();
}
module radial_lead(start, end, z, tail, lead) {
profile = is_list(lead) ? rectangle_points(lead.x , lead.y) : let($fn = 16) circle_points(lead / 2);
color(silver)
if(start == end)
translate([start.x, start.y, -tail])
linear_extrude(tail + z)
polygon([for(p = profile) [p.x, p.y]]);
else {
dz = 2 * [0, 0, is_list(lead) ? norm(lead) : lead];
top = [start.x, start.y, z];
bot = [end.x, end.y, 0];
path = [top, top - dz, bot + dz, bot];
rpath = concat(bezier_path(path, 20), [bot - [0, 0, tail]]);
sweep(rpath, profile);
}
translate(end)
solder((is_list(lead) ? min(lead) : lead) / 2);
}
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);
let($fn = 16) {
lead_positions(p, 0)
solder(d / 2);
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);
dz = d;
dx = p / 2 - ap / 2;
path = [[0, z, 0], [0, z - dz, 0], [dx, dz, 0], [dx, 0, 0]];
rpath = concat(bezier_path(path, 20), [[dx, -tail, 0]]);
lead_positions(ap, 0)
rotate([90, 0, 90 * -$x + 90])
sweep([for(p = rpath) [p.x, p.y, 0]], circle_points(d / 2));
sweep(rpath, circle_points(d / 2));
}
else
lead_positions(p, -tail)
rotate(90)
cylinder(d = d, h = tail + z);
}
}
@@ -135,3 +143,182 @@ module rd_xtal(type, value, z = 0, pitch = undef, tail = 3) { //! Draw a crystal
cylinder(d = (s.x + cp) / 2, h = 2 * eps, center = true);
}
}
function rd_module_kind(type) = type[1]; //! Relay, PSU, etc.
function rd_module_size(type) = type[2]; //! Size
function rd_module_radius(type) = type[3]; //! Corner radius
function rd_module_colour(type) = type[4]; //! Colour
function rd_module_pin_size(type) = type[5]; //! Pin size
function rd_module_pin_posns(type) = type[6]; //! list of pin positions
module rd_module(type, value) { //! Draw a PCB mounted potted module, e.g. PSU or relay
vitamin(str("rd_module(", type[0], ", \"", value, "\"): ", rd_module_kind(type), " ", type[0], " / ", value));
r = rd_module_radius(type);
size = rd_module_size(type);
pin = rd_module_pin_size(type);
color(rd_module_colour(type))
hull() {
rounded_rectangle([size.x, size.y, eps], r);
c = [size.x / 2 - r, size.y / 2 - r, size.z - r];
translate(c)
sphere(r);
translate([-c.x, c.y, c.z])
sphere(r);
translate([c.x, -c.y, c.z])
sphere(r);
translate([-c.x, -c.y, c.z])
sphere(r);
}
color(silver)
for(pos = rd_module_pin_posns(type))
translate(pos) {
translate_z(-pin.z / 2)
cube(pin, center = true);
solder();
}
color("white")
translate([0, -size.y / 2])
rotate([90, 0, 0])
linear_extrude(eps) {
translate([0, size.z * 0.9])
resize([size.x * 0.5, size.z / 9])
text(type[0], halign = "center", valign = "top");
translate([-size.x * 0.45, size.z * 0.75])
resize([size.x * 0.4, size.z / 12])
text(value, halign = "left", valign = "top");
}
}
function rd_disc_kind(type) = type[1]; //! Capacitor, etc
function rd_disc_size(type) = type[2]; //! Diameter, thickness and height
function rd_disc_pitch(type) = type[3]; //! Lead pitch X & Y
function rd_disc_lead_d(type) = type[4]; //! Lead diameter and sleeve diameter
function rd_disc_colours(type) = type[5]; //! Colours of body and text
module rd_disc(type, value, pitch = undef, z = 0, tail = 3) { //! Draw a radial disc component
vitamin(str("rd_disc(", type[0], ", \"", value, "\"): ", rd_disc_kind(type), ", ", type[0], " ", value));
size = rd_disc_size(type);
colours = rd_disc_colours(type);
opitch = rd_disc_pitch(type);
pitch = is_undef(pitch) ? opitch : pitch;
lead_d = rd_disc_lead_d(type);
lead_positions = [for(side = [-1,1]) [-side * opitch.x / 2, side * opitch.y / 2]];
r = size / 2;
v = [[0, r.y], [r.x, r.y], [r.x, r.y * pow((r.y / r.x), 4)], [r.x, 0]];
bez = bezier_path(v, 20);
path = concat(bez, [for(p = reverse(bez)) [p.x, - p.y]]);
rotate(is_list(opitch) ? atan2(opitch.y, opitch.x): 0) {
color(colours[0]) {
translate_z(size.z - size.x / 2 + z)
rotate([90, 0, 0])
color(colours[0])
rotate_extrude()
polygon(path);
r = lead_d[1] / 2;
rl = lead_d[0] / 2;
h = size.z - size.x / 2;
for(p = lead_positions, $fn = 16)
translate([p.x, p.y, z + r]) {
dy = (size.y / 2 - r - 0.1) * sign(-p.x);
path = [[0, 0, 0],
[0, 0, h / 2],
[-p.x / 2, dy - p.y, h / 2],
[-p.x, dy - p.y, h]];
sweep(concat([[0, 0, - r / 2]],bezier_path(path, 20)), circle_points(r));
vflip()
rounded_cylinder(r = r, h = r, r2 = r - rl, ir = rl);
}
}
diagonal_pitch = norm(opitch);
pitch = is_undef(pitch)? diagonal_pitch : pitch;
rotate(is_list(opitch) ? -atan2(opitch.y, opitch.x): 0)
radial_leads(diagonal_pitch, pitch, z, lead_d[0], tail);
}
}
function rd_transistor_size(type) = type[1]; //! Width / diameter, depth / flat and height
function rd_transistor_colours(type) = type[2]; //! Body colour and text colour
function rd_transistor_lead(type) = type[3]; //! Lead diameter or width and depth
function rd_transistor_lead_posns(type) = type[4]; //! List of lead xy coordinates
module rd_transistor(type, value, kind = "Transistor", lead_positions = undef, z = 5, tail = 3) { //! Draw a radial lead transistor
vitamin(str("rd_transistor(", type[0], ", \"", value, "\"): ", kind, " ", type[0], " ", value));
size = rd_transistor_size(type);
colours = rd_transistor_colours(type);
translate_z(z) {
if(type[0] == "TO92") {
color(colours[0])
linear_extrude(size.z)
difference() {
circle(d = size.z);
translate([0, size.x / 2])
square([size.x + 1, 2 * (size.x - size.y)], center = true);
}
color(colours[1])
translate([0, -size.x / 2 + size.y, size.z / 2])
rotate([0, 90, 90])
linear_extrude(eps)
resize([size.z * 0.8, 0], auto = true)
text(value, valign = "center", halign = "center");
}
if(type[0] == "E_LINE") {
color(colours[0])
linear_extrude(size.z)
hull() {
for(side = [-1, 1])
translate([side * (size.x - size.y) / 2, 0])
circle(d = size.y);
translate([-size.x / 2, 0])
square([size.x, size.y / 2]);
}
color(colours[1])
translate([0, size.y / 2, size.z / 2])
rotate([-90, 180, 0])
linear_extrude(eps)
resize([size.x * 0.85, 0], auto = true)
text(value, valign = "center", halign = "center");
}
}
lead_positions = is_undef(lead_positions) ? [for(i = [-1:1]) [inch(0.1 * i), 0]] : lead_positions;
lead_starts = rd_transistor_lead_posns(type);
lead = rd_transistor_lead(type);
assert(len(lead_positions) == len(lead_starts), "must give a position for each lead");
for(i = [0 : len(lead_starts) - 1]) {
start = lead_starts[i];
end = lead_positions[i];
radial_lead(start, end, z, tail, lead);
}
}

View File

@@ -30,4 +30,22 @@ ACT1100 = ["ACT1100", [20.4, 10.8, 5.3, 1], [1, 0.6], [ inch(0.6), inch(0.3)
rd_xtals = [C_002RX, HC49_4H, ACT1700, ACT1100, HC49];
// Modules
HF33F = ["HF33F", "Relay", [20.5, 10.6, 15.7], 0.5, grey(20), [0.3, 0.8, 3.6], [ inch([-0.35, 0.15]), inch([-0.35, -0.15]), inch([0.35, -0.15]), inch([0.05, -0.15])]];
VCE03 = ["VCE03", "PSU", [40.6, 19.1, 19.1], 0.5, grey(20), [0.64, 0.64, 4.8], [ inch([-0.7, 0.04]), inch([-0.5, 0.04]), inch([0.6, 0.04]), inch([0.7, 0.04])]];
rd_modules = [HF33F, VCE03];
// Disks
ERZV07D471 = ["ERZV07D471", "Varistor", [6.5, 5.0, 8.0], [4.75, 3.1], [0.6, 1.4], [grey(20), grey(80)]];
6p4mm_disc = ["6p4mm_disc","Ceramic capacitor", [6.5, 2.1, 7.8], [5.0, 0.9], [0.6, 0.8], ["#C5702D", grey(20)]];
rd_discs = [6p4mm_disc, ERZV07D471];
// Transistors
TO92 = ["TO92", [5.0, 3.9, 4.5], [grey(20), grey(80)], [0.48, 0.48], [[-1,0], [0,0], [1,0]] ];
E_LINE = ["E_LINE", [4.6, 2.3, 3.8], [grey(30), grey(80)], [0.45, 0.45], [[-1,0], [0,0], [1,0]] ];
rd_transistors = [ E_LINE, TO92];
use <radial.scad>

123
vitamins/sbr_rail.scad Normal file
View File

@@ -0,0 +1,123 @@
//
// 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/>.
//
//
//! SBR rails
//!
//! The rails are drawn from the center of the rod.
//! `sbr_rail_center_height(type)` can be used to determine where the bottom of the rail is.
//
include <../utils/core/core.scad>
use <bearing_block.scad>
use <linear_bearing.scad>
use <rod.scad>
use <screw.scad>
function sbr_rail_diameter(type) = type[1]; //! Diameter of the rod
function sbr_rail_center_height(type) = type[2]; //! Height of the center above the bottom of the rail
function sbr_rail_base_width(type) = type[3]; //! Width of the rail base
function sbr_rail_carriage(type) = type[5]; //! Carriage to use with this rail
function sbr_rail_screw(type) = type[7]; //! Screw to fasten this rail
module sbr_rail(type , l) { //! Draw an SBR rail
base_colour = grey(70);
screw_colour = grey(10);
d = sbr_rail_diameter(type);
h = sbr_rail_center_height(type);
B = sbr_rail_base_width(type);
T = type[4];
C = type[8];
S2 = sbr_rail_screw(type);
S3 = type[9]; // Screw that fastens the rod to the base
S3L = type[10]; // length of that screw
h1 = open_bearing_width(sbr_bearing(sbr_rail_carriage(type)));
vitamin(str("sbr_rail(", d, ", ", l, "): SBR", d, " rail, length ", l, "mm"));
not_on_bom()
no_explode()
rod(d, l, center=true);
base = (h1/2 + C/2) /2; // guess, not clear from drawings
color(base_colour)
difference() {
linear_extrude(l - 5, center=true, convexity=2)
translate([0,h-(T/2),0])
polygon([
[-h1/2, -T/2],
[-h1/2 - T/2, T/2],
[-B/2, T/2],
[-B/2, -T/2],
[-base, -T/2],
[-d/4, -h+(d/2)],
[d/4, -h+(d/2)],
[base, -T/2],
[B/2, -T/2],
[B/2, T/2],
[h1/2 + T/2, T/2],
[h1/2, -T/2],
]);
sbr_screw_locations(type, l)
translate([0,h-T+0.01,0])
rotate([90,0,0])
cylinder(r=screw_clearance_radius(S3), h=S3L, center=true);
sbr_screw_positions(type, l)
translate([0,T/2,0])
rotate([90,0,0])
cylinder(r=screw_clearance_radius(S2), h=T+0.1, center=true);
}
not_on_bom()
no_explode()
color(screw_colour)
sbr_screw_locations(type, l)
translate([0,h-T,0])
rotate([270,0,0])
screw(S3, S3L);
}
module sbr_screw_locations(type, l) { //! Linear locations of screws
P = type[6];
count = floor(l / P);
first = (l - count * P)/2;
N = first == 0 ? P/2 : first; // we don't want screws right on the edge
for (x = [N:P:l])
translate([0,0,l/2 - x])
children();
}
module sbr_screw_positions(type, l) { //! Screw positions
h = type[2];
T = type[4];
C = type[8];
S2 = sbr_rail_screw(type);
for (x = [-C/2, C/2])
translate([x,h-T, 0])
sbr_screw_locations(type, l)
children();
}

31
vitamins/sbr_rails.scad Normal file
View File

@@ -0,0 +1,31 @@
//
// 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/bearing_blocks.scad>
//
// SBR Rails
//
// d h B T carriage P S2 C S3 S3L
SBR16S = ["SBR16S", 16, 25, 40, 5, SBR16UU, 150, M5_cap_screw, 30, M5_cap_screw, 18 ];
sbr_rails = [SBR16S];
use <sbr_rail.scad>

Some files were not shown because too many files have changed in this diff Show More