Compare commits
34 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
523fc9e9a5 | ||
|
09d2ffb126 | ||
|
3c370359c8 | ||
|
acf45d2aae | ||
|
568d63dd14 | ||
|
e3cde64b61 | ||
|
e61ce02414 | ||
|
f8e125654e | ||
|
62b1511c82 | ||
|
84d98a1081 | ||
|
8efbb1d441 | ||
|
5899ffe88f | ||
|
b05131145c | ||
|
5da0f97485 | ||
|
c3f3d629b1 | ||
|
c7ba052ccf | ||
|
c2c5f50986 | ||
|
d0ae8ca216 | ||
|
e81dcfdbd8 | ||
|
06a286dc98 | ||
|
f5496c373a | ||
|
1c6d3d8e95 | ||
|
5e24a32a0b | ||
|
fbd8d8c7cd | ||
|
c77b18ebc9 | ||
|
b1592f51d4 | ||
|
deb0c14aa2 | ||
|
cc82cf2a6c | ||
|
61fc194995 | ||
|
f8af61568a | ||
|
05d16841c4 | ||
|
61f1dcc509 | ||
|
5fc70e19ac | ||
|
07e7eb77f7 |
77
CHANGELOG.md
@@ -3,6 +3,73 @@
|
||||
This changelog is generated by `changelog.py` using manually added semantic version tags to classify commits as breaking changes, additions or fixes.
|
||||
|
||||
|
||||
### [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.
|
||||
|
||||
* 2023-05-08 [`c7ba052`](https://github.com/nophead/NopSCADlib/commit/c7ba052ccf24d764aa6460d4559e92596c9e4cf4 "show commit") [C.P.](# "Chris Palmer") Added SMD QFP package.
|
||||
|
||||
* 2023-05-08 [`c2c5f50`](https://github.com/nophead/NopSCADlib/commit/c2c5f509860b909ca8fca5ffcc65dbef2f7177c5 "show commit") [C.P.](# "Chris Palmer") Can now used `smd_res()` to draw chokes.
|
||||
|
||||
* 2023-05-08 [`d0ae8ca`](https://github.com/nophead/NopSCADlib/commit/d0ae8ca216108f53c9b8e60896ea9b59b845b7e0 "show commit") [C.P.](# "Chris Palmer") Added the ability to have more than one grid on a PCB.
|
||||
|
||||
* 2023-05-08 [`e81dcfd`](https://github.com/nophead/NopSCADlib/commit/e81dcfdbd8163ce8e2db450f3a20c296c21327a8 "show commit") [C.P.](# "Chris Palmer") Added right angle option to box headers.
|
||||
|
||||
#### [v21.4.1](https://github.com/nophead/NopSCADlib/releases/tag/v21.4.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v21.4.0...v21.4.1 "diff with v21.4.0")
|
||||
* 2023-05-08 [`06a286d`](https://github.com/nophead/NopSCADlib/commit/06a286dc989e9cc8cf7918049cd16a862b1a9b94 "show commit") [C.P.](# "Chris Palmer") Fixed missing BOM entry for JST connectors.
|
||||
Fixed default colour for JST connectors.
|
||||
Corrected BOM entry to show right angle options on Molex and pin headers.
|
||||
|
||||
* 2023-05-08 [`f5496c3`](https://github.com/nophead/NopSCADlib/commit/f5496c373a1ab8ae47d07cc0a52d76e4299876cc "show commit") [C.P.](# "Chris Palmer") Fixed typo in `smd_diode(DO214AC)` package name.
|
||||
|
||||
### [v21.4.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.4.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.3.1...v21.4.0 "diff with v21.3.1")
|
||||
* 2023-05-01 [`5e24a32`](https://github.com/nophead/NopSCADlib/commit/5e24a32a0b422e8032c3c5d377c1a756ff6f1022 "show commit") [C.P.](# "Chris Palmer") Added ESP32 camera.
|
||||
|
||||
* 2023-05-01 [`fbd8d8c`](https://github.com/nophead/NopSCADlib/commit/fbd8d8c7cdff0bd7de0d42aa74bf0ab6551c205b "show commit") [C.P.](# "Chris Palmer") Added `smd_coax`
|
||||
|
||||
#### [v21.3.1](https://github.com/nophead/NopSCADlib/releases/tag/v21.3.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v21.3.0...v21.3.1 "diff with v21.3.0")
|
||||
* 2023-04-29 [`b1592f5`](https://github.com/nophead/NopSCADlib/commit/b1592f51d4b16a125d9b28edae56f758fcac2f02 "show commit") [C.P.](# "Chris Palmer") Fixed `bom.py,` `views.py` and `tests.py` so that vitamin descriptions can contain more than one colon.
|
||||
|
||||
### [v21.3.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.3.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.2.0...v21.3.0 "diff with v21.2.0")
|
||||
* 2023-04-23 [`61fc194`](https://github.com/nophead/NopSCADlib/commit/61fc19499524a2b750d17a90627a697bf626bbf0 "show commit") [C.P.](# "Chris Palmer") Refactored for readability.
|
||||
|
||||
* 2023-04-23 [`f8af615`](https://github.com/nophead/NopSCADlib/commit/f8af61568a8362cf470bc9eb8de8323c8fc001c7 "show commit") [C.P.](# "Chris Palmer") Updated images and readme.
|
||||
|
||||
* 2023-04-23 [`05d1684`](https://github.com/nophead/NopSCADlib/commit/05d16841c4d48c5c8f453e438af0ff6eb5bffe53 "show commit") [C.P.](# "Chris Palmer") Fixed thread pitch.
|
||||
|
||||
* 2023-04-05 [`07e7eb7`](https://github.com/nophead/NopSCADlib/commit/07e7eb77f73fcaab4291388b49781b0e2de5a64c "show commit") [M.B.](# "Martin Budden") Added support for shoulder screws.
|
||||
|
||||
### [v21.2.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.2.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.1.2...v21.2.0 "diff with v21.1.2")
|
||||
* 2023-04-22 [`5fc70e1`](https://github.com/nophead/NopSCADlib/commit/5fc70e19ac5d320290f4a2151665e83f0829d796 "show commit") [C.P.](# "Chris Palmer") Added SMD Tantalum caps and 0502 and 0402 resistor and capacitors.
|
||||
|
||||
#### [v21.1.2](https://github.com/nophead/NopSCADlib/releases/tag/v21.1.2 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v21.1.1...v21.1.2 "diff with v21.1.1")
|
||||
* 2023-03-29 [`1c5d9a8`](https://github.com/nophead/NopSCADlib/commit/1c5d9a8ef5892caf9b2c4d0d84dc3d20eba699d3 "show commit") [C.P.](# "Chris Palmer") Removed utility functions used by `invert()` from documentation as not generally useful.
|
||||
|
||||
#### [v21.1.1](https://github.com/nophead/NopSCADlib/releases/tag/v21.1.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v21.1.0...v21.1.1 "diff with v21.1.0")
|
||||
* 2023-03-29 [`d3f0bfc`](https://github.com/nophead/NopSCADlib/commit/d3f0bfc17f82b42f2d81f2d72a54c3f0cc375604 "show commit") [C.P.](# "Chris Palmer") Fixed typo in resistor comment.
|
||||
|
||||
### [v21.1.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.1.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.0.1...v21.1.0 "diff with v21.0.1")
|
||||
* 2023-03-11 [`18cd33c`](https://github.com/nophead/NopSCADlib/commit/18cd33c66388d4d4e7be664c0f883cff0854524b "show commit") [C.](# "Chris") Fixed typos, corrected vitamin call, added boilerplate, updated images and readme.
|
||||
|
||||
@@ -40,8 +107,6 @@ This changelog is generated by `changelog.py` using manually added semantic vers
|
||||
|
||||
* 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.
|
||||
|
||||
@@ -118,8 +183,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.
|
||||
|
||||
@@ -519,7 +582,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.
|
||||
|
||||
@@ -1181,7 +1244,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
|
||||
@@ -1459,7 +1522,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.
|
||||
|
BIN
libtest.png
Before Width: | Height: | Size: 974 KiB After Width: | Height: | Size: 956 KiB |
43
libtest.scad
@@ -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;
|
||||
@@ -225,7 +226,7 @@ inserts_y = 0;
|
||||
nuts_y = inserts_y + 20;
|
||||
washers_y = nuts_y + 120;
|
||||
screws_y = washers_y + 120;
|
||||
circlips_y = screws_y + 160;
|
||||
circlips_y = screws_y + 180;
|
||||
springs_y = circlips_y + 20;
|
||||
o_rings_y = springs_y;
|
||||
sealing_strip_y = springs_y + 20;
|
||||
@@ -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,26 +400,26 @@ 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();
|
||||
|
||||
translate([x3 + 60, veroboard_y + 20])
|
||||
translate([x3 + 50, veroboard_y + 20])
|
||||
geared_steppers();
|
||||
|
||||
translate([x3 + 160, ssrs_y])
|
||||
pcb_mounts();
|
||||
|
||||
translate([x3 + 170, veroboard_y + 16])
|
||||
translate([x3 + 145, veroboard_y + 16])
|
||||
cameras();
|
||||
|
||||
translate([x3 + 145, d_connectors_y - 10])
|
||||
camera_housings();
|
||||
|
||||
translate([x3, d_connectors_y])
|
||||
d_connectors();
|
||||
|
||||
translate([x3 + 170, d_connectors_y - 10])
|
||||
camera_housings();
|
||||
|
||||
translate([x3, iecs_y])
|
||||
iecs();
|
||||
|
||||
@@ -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();
|
||||
|
@@ -140,7 +140,7 @@ class BOM:
|
||||
for part in sorted(self.vitamins):
|
||||
i += 1
|
||||
if ': ' in part:
|
||||
part_no, description = part.split(': ')
|
||||
part_no, description = part.split(': ', 1)
|
||||
else:
|
||||
part_no, description = "", part
|
||||
qty = self.vitamins[part].count
|
||||
@@ -183,7 +183,7 @@ class BOM:
|
||||
|
||||
for part in sorted(self.vitamins):
|
||||
if ': ' in part:
|
||||
part_no, description = part.split(': ')
|
||||
part_no, description = part.split(': ', 1)
|
||||
else:
|
||||
part_no, description = "", part
|
||||
if breakdown:
|
||||
|
@@ -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())
|
||||
|
@@ -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
|
||||
@@ -259,11 +259,11 @@ def tests(tests):
|
||||
things = BOM[thing]
|
||||
if things:
|
||||
body += ['### %s\n| Qty | %s |\n| ---:|:--- |%s' % (thing.title(), heading, ':---|' if '|' in heading else '')]
|
||||
for item in sorted(things, key = lambda s: s.split(":")[-1]):
|
||||
for item in sorted(things, key = lambda s: s.split(":",1)[-1]):
|
||||
name = item
|
||||
desc = ''
|
||||
if thing == "vitamins":
|
||||
vit = item.split(':')
|
||||
vit = item.split(':', 1)
|
||||
name = '`' + vit[0] + '`' if vit[0] else ''
|
||||
while '[[' in name and ']]' in name:
|
||||
i = name.find('[[')
|
||||
@@ -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)
|
||||
|
@@ -303,7 +303,7 @@ def views(target, do_assemblies = None):
|
||||
grand_total2 = 0
|
||||
heading = headings[t][0].upper() + headings[t][1:]
|
||||
print(('| ' * len(global_bom) + '| | **%s** |') % heading, file = doc_file)
|
||||
for thing in sorted(things[t], key = lambda s: s.split(":")[-1]):
|
||||
for thing in sorted(things[t], key = lambda s: s.split(":",1)[-1]):
|
||||
for ass in global_bom:
|
||||
count = ass[t][thing]["count"] if thing in ass[t] else 0
|
||||
print('| %s ' % pad(count if count else '.', 2, 1), file = doc_file, end = '')
|
||||
@@ -313,7 +313,7 @@ def views(target, do_assemblies = None):
|
||||
else:
|
||||
totals[name] = count
|
||||
grand_total2 += count
|
||||
print('| %s | %s |' % (pad(things[t][thing], 2, 1), pad(thing.split(":")[-1], 2)), file = doc_file)
|
||||
print('| %s | %s |' % (pad(things[t][thing], 2, 1), pad(thing.split(":",1)[-1], 2)), file = doc_file)
|
||||
|
||||
grand_total = 0
|
||||
for ass in global_bom:
|
||||
@@ -344,8 +344,8 @@ def views(target, do_assemblies = None):
|
||||
print("### Vitamins", file = doc_file)
|
||||
print("|Qty|Description|", file = doc_file)
|
||||
print("|---:|:----------|", file = doc_file)
|
||||
for v in sorted(vitamins, key = lambda s: s.split(":")[-1]):
|
||||
print("|%d|%s|" % (vitamins[v]["count"], v.split(":")[1]), file = doc_file)
|
||||
for v in sorted(vitamins, key = lambda s: s.split(":",1)[-1]):
|
||||
print("|%d|%s|" % (vitamins[v]["count"], v.split(":",1)[1]), file = doc_file)
|
||||
print("\n", file = doc_file)
|
||||
|
||||
printed = ass["printed"]
|
||||
|
@@ -62,30 +62,44 @@ 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"],
|
||||
[ 19, 2, 90, "smd_led", LED1206, "blue"],
|
||||
[ 16, 2, 90, "smd_led", LED0805, "red"],
|
||||
[ 13, 2, 90, "smd_led", LED0603, "orange"],
|
||||
[ 16, 2, 90, "smd_res", RES1206, "1K"],
|
||||
[ 19, 2, 90, "smd_res", RES0805, "1K"],
|
||||
[ 22, 2, 90, "smd_res", RES0603, "1K"],
|
||||
[ 25, 2, 90, "smd_cap", CAP1206, 1.5, "1uF"],
|
||||
[ 28, 2, 90, "smd_cap", CAP0805, 1.0, "100nF"],
|
||||
[ 31, 2, 90, "smd_cap", CAP0603, 0.7, "10nF"],
|
||||
[ 34, 3, 90, "smd_diode",DO241AC, "SS34"],
|
||||
[ 21, 6, -90, "smd_pot", TC33X1, "10K"],
|
||||
[ 16, 6, -90, "smd_sot", SOT23, "2N7000"],
|
||||
[ 28, 8, -90, "smd_sot", SOT223, "LM117"],
|
||||
[ 10, 2, -90, "smd_res", L2012C, "1u"],
|
||||
[ 19, 6, -90, "smd_res", RES1206, "1M"],
|
||||
[ 16, 6, -90, "smd_res", RES0805, "1K"],
|
||||
[ 13, 6, -90, "smd_res", RES0603, "100"],
|
||||
[ 10, 6, -90, "smd_res", RES0502, "10"],
|
||||
[ 7, 6, -90, "smd_res", RES0402, "1"],
|
||||
[ 19, 10, 90, "smd_cap", CAP1206, 1.5, "1uF"],
|
||||
[ 16, 10, 90, "smd_cap", CAP0805, 1.0, "100nF"],
|
||||
[ 13, 10, 90, "smd_cap", CAP0603, 0.7, "10nF"],
|
||||
[ 10, 10, 90, "smd_cap", CAP0502, 0.6, "10nF"],
|
||||
[ 7, 10, 90, "smd_cap", CAP0402, 0.5, "10nF"],
|
||||
[ 19, 16, -90, "smd_tant", TANT_C, "107C"],
|
||||
[ 13, 16, -90, "smd_tant", TANT_B, "106A"],
|
||||
[ 7, 16, -90, "smd_tant", TANT_A, "105e"],
|
||||
[ 32, 3, -90, "smd_diode",DO214AC, "SS34"],
|
||||
[ 26, 2, -90, "smd_pot", TC33X1, "10K"],
|
||||
[ 26, 6, -90, "smd_coax",U_FL_R_SMT_1],
|
||||
|
||||
[ 26, 10, -90, "smd_sot", SOT23, "2N7000"],
|
||||
[ 28, 16, -90, "smd_sot", SOT223, "LM117"],
|
||||
|
||||
[ 30, 30, -90, "smd_qfp", QFP50P1200X1200X160_64N, "ATSAM4S4BA"],
|
||||
|
||||
[ 45, 35, 0, "2p54header", 4, 1],
|
||||
[ 60, 35, 0, "2p54header", 5, 1, false, "blue" ],
|
||||
[ 60, 40, 180, "2p54header", 5, 1, false, undef, true],
|
||||
[ 80, 33, 0, "2p54boxhdr", 4, 2],
|
||||
[ 80, 40, 0, "2p54boxhdr", 4, 2, false, true, true],
|
||||
[ 45, 30, 0, "2p54socket", 4, 1, false, 0, false, "red" ],
|
||||
[ 60, 30, 0, "2p54socket", 6, 1],
|
||||
|
||||
[ 59, 50, 180, "led", LED3mm, "red"],
|
||||
[ 66, 50, 180, "led", LED5mm, "orange"],
|
||||
[ 77, 50, 180, "led", LED8mm, "blue"],
|
||||
[ 90, 50, 180, "led", LED10mm, "yellow"],
|
||||
[ 59, 60, 180, "led", LED3mm, "red"],
|
||||
[ 66, 60, 180, "led", LED5mm, "orange"],
|
||||
[ 77, 60, 180, "led", LED8mm, "blue"],
|
||||
[ 90, 60, 180, "led", LED10mm, "yellow"],
|
||||
[ 10, 35, 180, "rj45"],
|
||||
[ 7, 50, 180, "usb_vAx1"],
|
||||
[ 8, 65, 180, "usb_A"],
|
||||
@@ -130,11 +144,16 @@ test_pcb = ["test_pcb", "Test PCB",
|
||||
[ 95, 15, -90, "flat_flex"],
|
||||
[ 87, 15, -90, "flat_flex", true],
|
||||
|
||||
[ 50, 50, 0, "molex_hdr", 2],
|
||||
[ 50, 60, 0, "jst_xh", 2],
|
||||
[ 50, 70, 180, "term254", 3],
|
||||
[ 63, 70, 180, "term254", 3, undef, grey(20)],
|
||||
[ 75, 70, 180, "gterm508",2, undef, "blue"],
|
||||
[ 47, 55, 0, "molex_hdr", 2],
|
||||
[ 51, 48, 0, "molex_hdr", 2, 1],
|
||||
[ 51, 41, 0, "molex_hdr", 2, -1],
|
||||
[ 45, 65, 0, "jst_xh", 2],
|
||||
[ 54, 65, 0, "jst_ph", 2],
|
||||
[ 61, 65, 0, "jst_zh", 2],
|
||||
|
||||
[ 50, 75, 180, "term254", 3],
|
||||
[ 63, 75, 180, "term254", 3, undef, grey(20)],
|
||||
[ 75, 75, 180, "gterm508",2, undef, "blue"],
|
||||
|
||||
[ 50, 90, 180, "gterm35", 4, [1,2]],
|
||||
[ 63, 90, 180, "gterm35", 4, [1,2], "red"],
|
||||
|
46
tests/SBR_rails.scad
Normal 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();
|
@@ -23,7 +23,7 @@ include <../vitamins/smds.scad>
|
||||
|
||||
module smds() {
|
||||
layout([for(r = smd_resistors) smd_res_size(r).x], 1)
|
||||
smd_resistor(smd_resistors[$i], ["1R0", "10M", "100K"][$i % 3]);
|
||||
smd_resistor(smd_resistors[$i], ["1R0", "10", "100", "10M", "100K", "10u"][$i % 6]);
|
||||
|
||||
translate([0, 3])
|
||||
layout([for(l = smd_leds) smd_led_size(l).x], 1)
|
||||
@@ -35,29 +35,44 @@ module smds() {
|
||||
smd_capacitor(c, smd_cap_size(c).y * 0.8);
|
||||
|
||||
translate([0, 9])
|
||||
layout([for(d = smd_diodes) smd_diode_size(d).x], 1)
|
||||
layout([for(t = smd_tants) smd_tant_leads(t).x], 1)
|
||||
let(t = smd_tants[$i])
|
||||
smd_tant(t, ["105e","106J", "107A"][$i]);
|
||||
|
||||
translate([0, 12.5])
|
||||
layout([for(d = smd_diodes) smd_diode_leads(d).x], 1)
|
||||
let(d = smd_diodes[$i])
|
||||
smd_diode(d, ["SS34"][$i]);
|
||||
|
||||
translate([0, 15])
|
||||
translate([0, 24])
|
||||
layout([for(s = smd_sots) smd_sot_size(s).x], 1)
|
||||
let(s = smd_sots[$i])
|
||||
smd_sot(s, ["2N7000", "FZT851"][$i]);
|
||||
|
||||
translate([0, 21])
|
||||
translate([0, 18])
|
||||
layout([for(p = smd_pots) smd_pot_size(p).x], 1)
|
||||
let(p = smd_pots[$i])
|
||||
smd_pot(p, "10K");
|
||||
|
||||
translate([0, 28])
|
||||
translate([6, 18])
|
||||
layout([for(c = smd_coaxs) smd_coax_base_size(c).x], 1)
|
||||
let(c = smd_coaxs[$i])
|
||||
smd_coax(c);
|
||||
|
||||
translate([0, 31])
|
||||
layout([for(s = smd_soics) smd_soic_size(s).x], 1)
|
||||
let(s = smd_soics[$i])
|
||||
smd_soic(s, s[0]);
|
||||
|
||||
translate([0, 36])
|
||||
layout([for(i = smd_inductors) smd_inductor_size(i).x], 1)
|
||||
translate([0, 39])
|
||||
layout([for(i = smd_inductors) smd_inductor_leads(i).x], 1)
|
||||
let(i = smd_inductors[$i])
|
||||
smd_inductor(i, "4R7");
|
||||
|
||||
translate([20, 6])
|
||||
layout([for(q = smd_qfps) smd_qfp_body_size(q).x], 3)
|
||||
let(q = smd_qfps[$i])
|
||||
smd_qfp(q, ["ATSAM4S4BA"][$i]);
|
||||
}
|
||||
|
||||
if($preview)
|
||||
|
@@ -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();
|
||||
|
@@ -26,8 +26,9 @@ include <../vitamins/cameras.scad>
|
||||
use <../vitamins/pcb.scad>
|
||||
|
||||
module camera_housings()
|
||||
layout([for(c = cameras) pcb_length(camera_pcb(c))], 15, false) let(c = cameras[$i])
|
||||
camera_fastened_assembly(c, 3);
|
||||
layout([for(c = cameras) pcb_length(camera_pcb(c))], 10, false) let(c = cameras[$i])
|
||||
if(pcb_screw(camera_pcb(c)))
|
||||
camera_fastened_assembly(c, 3);
|
||||
|
||||
if($preview)
|
||||
camera_housings();
|
||||
|
@@ -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);
|
||||
|
@@ -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();
|
||||
|
@@ -45,9 +45,15 @@ module pin_headers() {
|
||||
translate([0, 50])
|
||||
box_header(pin_headers[$i], 8, 1);
|
||||
|
||||
translate([40, 40])
|
||||
box_header(pin_headers[$i], 8, 1, right_angle = true);
|
||||
|
||||
translate([0, 60])
|
||||
box_header(pin_headers[$i], 10, 2);
|
||||
|
||||
translate([40, 60])
|
||||
box_header(pin_headers[$i], 10, 2, right_angle = true);
|
||||
|
||||
translate([0, 70])
|
||||
pin_socket(pin_headers[$i], 8, 1);
|
||||
|
||||
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 123 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 119 KiB |
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 195 KiB |
Before Width: | Height: | Size: 278 KiB After Width: | Height: | Size: 254 KiB |
Before Width: | Height: | Size: 146 KiB After Width: | Height: | Size: 168 KiB |
BIN
tests/png/sbr_rails.png
Normal file
After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 176 KiB After Width: | Height: | Size: 162 KiB |
Before Width: | Height: | Size: 169 KiB After Width: | Height: | Size: 169 KiB |
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 104 KiB |
@@ -56,7 +56,7 @@ module screws() {
|
||||
screw(screw, length);
|
||||
}
|
||||
}
|
||||
translate([20, 40, -15])
|
||||
translate([20, 60, -15])
|
||||
polysink_stl();
|
||||
}
|
||||
|
||||
|
@@ -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];
|
||||
|
@@ -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° 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° 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] ]);
|
||||
}
|
||||
|
@@ -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>
|
||||
|
@@ -91,7 +91,7 @@ module camera(type, show_lens = true, fov_distance = 0, fov = undef) {
|
||||
color("orange")
|
||||
hull() {
|
||||
translate_z(flex.y /2)
|
||||
translate(camera_lens_offset(type) + [0, camera_lens(type)[0][0].y / 2])
|
||||
translate(camera_lens_offset(type) + [0, sign(pos.y) * camera_lens(type)[0][0].y / 2, 0])
|
||||
cube([flex.x, eps, flex.y], center = true);
|
||||
|
||||
translate_z(conn.z - flex.y)
|
||||
|
@@ -70,6 +70,92 @@ rpi_camera = ["rpi_camera", "Raspberry Pi focusable camera", rpi_camera_pcb, [0,
|
||||
[0, 18 - 1.5 - 2.5], [8, 5, 1.6]
|
||||
];
|
||||
|
||||
cameras = [rpi_camera_v1, rpi_camera_v2, rpi_camera];
|
||||
esp32_cam_x = 1; // Seems to vary as mine is offset but pictures on the web show it more centered.
|
||||
|
||||
ESP32_module = ["", "", 18, 26, 0.8, 0, 0.7, [1.1, 1.1, 0, gold], grey(18), false, [
|
||||
for(x = [0,1], y = [0:13]) [x * 18, y * 1.27 + 1.4], // Hole positions on the edge
|
||||
for(x = [0:9]) [18 / 2 + (x - 4.5) * 1.27, 0],
|
||||
|
||||
],
|
||||
[
|
||||
[18 / 2, 9.7 - 3.4 / 2 , 0, "block", 15.75, 17.6 - 3.4, 2.2, silver, false, 0.3, 0.3], // can
|
||||
[18 / 2 - 2.65, 9.7 , 0, "block", 10.4, 17.6, 2.2, silver, false, 0.3, 0.3], // can
|
||||
[12.7, -6.5, 45, "smd_res", RES0502],
|
||||
[15.15, -8.3, -90, "smd_coax", U_FL_R_SMT_1],
|
||||
// Antenna
|
||||
let(x = [0.9, 3.2, 5.7, 8.1, 10.6, 12.8, 15, 15.2])
|
||||
each [
|
||||
for(i = [0, 5,6,7]) [x[i], -2.8, 0, "block", 0.6, 4.8, 0.2, gold], // long verticals
|
||||
for(i = [1: 4]) [x[i], -2.05, 0, "block", 0.6, 3.3, 0.2, gold], // short verticals
|
||||
for(i = [0, 2, 4,5])[(x[i] + x[i + 1]) / 2, -0.7, 0, "block", x[i + 1] - x[i], 0.6, 0.2, gold], // top horizontals
|
||||
for(i = [1, 3]) [(x[i] + x[i + 1]) / 2, -3.4, 0, "block", x[i + 1] - x[i], 0.6, 0.2, gold], // lower horizontals
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
ESP32_CAM_pcb = ["", "", 27, 40, 1.7, 2.5, 0, 0, grey(15), false, [],
|
||||
[
|
||||
[27 / 2, 26 / 2, 0, "-pcb", 0, ESP32_module],
|
||||
for(side = [-1, 1]) [side * inch(0.45) + 27 / 2, -(4.2 + inch(.35)), 0, "-2p54header", 1, 8],
|
||||
[ 27 / 2, -8, 90, "uSD", [14.85, 14.65, 1.8]],
|
||||
[ 27 / 2 + 1, 15, 0, "flat_flex", false],
|
||||
[ 27 / 2 + inch(0.45), 10.5, 0, "block", 3, 3, 0.8, grey(90)],
|
||||
[ 27 / 2 + inch(0.45), 10.5, 0, "block", 2.9, 2.9, 0.81, "yellow", true, 2.9 / 2 - eps],
|
||||
[ 27 / 2, 3, 0, "text", 15, 2, "ESP32-CAM", "Liberation Sans:style=Bold"],
|
||||
[0.5, -(4.7 + inch(.35)), 90, "text", inch(0.75), 0.9, "IO4 IO2 IO14 IO15 IO13 IO12 GND 5V", "Liberation Sans:style=Bold"],
|
||||
[26.5, -(4.6 + inch(.35)), -90, "text", inch(0.77), 0.9, "3V3 1O16 IO0 GND VCC U0R U0T GND", "Liberation Sans:style=Bold"],
|
||||
[5.5, -3.3, 90, "-chip", 4, 3, 1.6, silver], // Mock button surround
|
||||
[5.5, -3.3, 90, "-chip", 1.8,0, 2.0, grey(20)], // Mock button
|
||||
[10, -10.8, 0, "-smd_led", LED0603, "red"],
|
||||
[-6.5, -5, 0, "-smd_soic", SOIC8],
|
||||
[12.2, -4.5, 180, "-smd_sot", SOT223, "AMS1117"],
|
||||
[25.3, 14, 0, "smd_sot", SOT23],
|
||||
[3.0, 14, 0, "smd_sot", SOT23],
|
||||
[8, 20, 90, "smd_sot", SOT23],
|
||||
[16, 20, 90, "smd_sot", SOT23],
|
||||
[3.0, 11.5,0, "smd_res", RES0502],
|
||||
[2.9, 10.3,0, "smd_res", RES0502],
|
||||
[5.4, 20, 90, "smd_cap", CAP0603, 0.5],
|
||||
[11.5, 20, 90, "smd_cap", CAP0603, 0.5],
|
||||
[18.7, 20, 90, "smd_cap", CAP0603, 0.5],
|
||||
[19.9, 20, 90, "smd_cap", CAP0402, 0.3],
|
||||
for(i = [0, 1, 2, 4]) [7.6 + i * 1.09, 8.8, 90, "smd_res", RES0502],
|
||||
for(i = [0 : 3]) [-4.8, 20 + i * 1.09, 0, "smd_res", RES0502],
|
||||
for(i = [3, 5, 8]) [7.6 + i * 1.09, 8.8, 90, "smd_cap", CAP0502, 0.5],
|
||||
[-8.1, 23, 90, "smd_res", RES0502],
|
||||
[-9.2, 23, 90, "smd_res", RES0502],
|
||||
[-6.3, 23.3, 180, "text", 0.8, 0.7, "5V", "Liberation Sans:style=Bold"],
|
||||
[-6.5, 22.2, 180, "text", 1.2, 0.7, "3V3", "Liberation Sans:style=Bold"],
|
||||
[8, -3.3, 90, "-smd_cap", CAP0603, 0.5],
|
||||
[2, -2, 0, "-text", 2.3, 1, "RST", "Liberation Sans:style=Bold"],
|
||||
[10,-9.4, 0, "-text", 3.1, 1, "LED1", "Liberation Sans:style=Bold"],
|
||||
[12.4, -10.8, 0, "-smd_res", RES0502],
|
||||
[13.7, -9.4, 0, "-smd_cap", CAP0603, 0.5],
|
||||
[17.2,-9.4, 0, "-smd_cap", CAP0502, 0.4],
|
||||
[22.1, -10.8, 0, "-smd_res", RES0502],
|
||||
[16.9, -4.8, 90, "-smd_res", RES0502],
|
||||
[2.2, 9.0, 90, "-smd_cap", CAP0502, 0.4],
|
||||
[2.2, 11.6, 90, "-smd_cap", CAP0502, 0.4],
|
||||
[2.2, 14.2, 90, "-smd_res", RES0502],
|
||||
[5.9, -9.4, 90, "-smd_tant", TANT_B, "107A"],
|
||||
|
||||
],
|
||||
[],
|
||||
[(27 - inch(0.9)) / 2, 40 - 4.2 - inch(0.7), 2, 8, silver, inch(0.9), inch(0.1)], // 8x2 grid of holes
|
||||
];
|
||||
|
||||
ESP32_CAM = ["ESP32_CAM", "ESP32-CAM Camera module", ESP32_CAM_pcb, [esp32_cam_x, pcb_width(ESP32_CAM_pcb) / 2 - 12, 1.8],
|
||||
[
|
||||
[[8, 8, 2.4], 0],
|
||||
[[0, 0, 4.2], 4],
|
||||
[[0, 0, 6.3], 3.5, [1, 1, 0.5]],
|
||||
],
|
||||
[1, -4], [15, 2.2, 1],
|
||||
[54, 41] // FOV
|
||||
];
|
||||
|
||||
|
||||
|
||||
cameras = [rpi_camera_v1, rpi_camera_v2, rpi_camera, ESP32_CAM];
|
||||
|
||||
use <camera.scad>
|
||||
|
@@ -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);
|
||||
|
@@ -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>
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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>
|
||||
|
@@ -62,14 +62,14 @@ function pcb_size(type) = [pcb_length(type), pcb_width(type), pcb_thickness(type
|
||||
function pcb_component(type, name, index = 0) = //! Return the component specified by name and index
|
||||
[for(component = pcb_components(type)) if(component[3] == name) component][index];
|
||||
|
||||
function pcb_grid_pos(type, x, y, z = 0) = //! Returns a pcb grid position
|
||||
function pcb_grid_pos(type, x, y, z = 0, i = 0) = //! Returns a pcb grid position
|
||||
let(grid = pcb_grid(type))
|
||||
[-pcb_size(type).x / 2 + grid.x + x * (is_undef(grid[5]) ? 2.54 : grid[5]),
|
||||
-pcb_size(type).y / 2 + grid.y + y * (is_undef(grid[6]) ? 2.54 : grid[6]),
|
||||
[-pcb_size(type).x / 2 + grid[i] + x * (is_undef(grid[i + 5]) ? 2.54 : grid[i + 5]),
|
||||
-pcb_size(type).y / 2 + grid[i + 1] + y * (is_undef(grid[i + 6]) ? 2.54 : grid[i + 6]),
|
||||
pcb_size(type).z + z];
|
||||
|
||||
module pcb_grid(type, x, y, z = 0) //! Positions children at specified grid position
|
||||
translate(pcb_grid_pos(type, x, y, z))
|
||||
module pcb_grid(type, x, y, z = 0, i = 0) //! Positions children at specified grid position
|
||||
translate(pcb_grid_pos(type, x, y, z, i))
|
||||
children();
|
||||
|
||||
// allows negative ordinates to represent offsets from the far edge
|
||||
@@ -929,12 +929,11 @@ module molex_254_housing(ways) { //! Draw a Molex KK housing
|
||||
for(side = [-1, 1])
|
||||
translate([-depth / 2 - tab.x / 2, side * (pitch / 2 - tab.y / 4) * ways, tab.z / 2])
|
||||
cube(tab, center = true);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
module molex_254(ways, right_angle = 0, skip = undef) { //! Draw molex KK header, set `right_angle` to 1 for normal right angle version or -1 for inverted right angle version.
|
||||
vitamin(str("molex_254(", ways, "): Molex KK header ", ways, " way"));
|
||||
vitamin(str("molex_254(", ways, arg(right_angle, 0, "right_angle"), arg(skip, undef, "skip"), "): Molex KK header ", ways, " way", right_angle ? " right angle" : ""));
|
||||
pitch = 2.54;
|
||||
width = ways * pitch - 0.1;
|
||||
depth = 6.35;
|
||||
@@ -945,7 +944,7 @@ module molex_254(ways, right_angle = 0, skip = undef) { //! Draw molex KK header
|
||||
above = 9;
|
||||
pin_w = 0.64;
|
||||
r = 1;
|
||||
a = right_angle ? width / 2 - r - pin_w / 2 : above;
|
||||
a = right_angle ? depth / 2 - r - pin_w / 2 : above;
|
||||
ra_offset = 2.2;
|
||||
|
||||
color("white")
|
||||
@@ -974,7 +973,7 @@ module molex_254(ways, right_angle = 0, skip = undef) { //! Draw molex KK header
|
||||
|
||||
l = above + ra_offset - r - pin_w / 2;
|
||||
if(right_angle) {
|
||||
translate([-l / 2 - r - pin_w / 2, 0, width / 2])
|
||||
translate([-l / 2 - r - pin_w / 2, 0, depth / 2])
|
||||
cube([l, pin_w, pin_w], center = true);
|
||||
|
||||
translate([-r - pin_w / 2, 0, a])
|
||||
@@ -1093,7 +1092,7 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
|
||||
pin_header(2p54header, comp[4], comp[5], param(6, false), param(8, false), cutouts, colour = param(7, undef));
|
||||
if(show(comp, "2p54joiner")) pin_header(2p54joiner, comp[4], comp[5], param(6, false), param(8, false), cutouts, colour = param(7, undef));
|
||||
if(show(comp, "2p54boxhdr")) let($show_plugs = show_plugs && param(7, true))
|
||||
box_header(2p54header, comp[4], comp[5], param(6, false), cutouts);
|
||||
box_header(2p54header, comp[4], comp[5], param(6, false), cutouts, param(8, false));
|
||||
if(show(comp, "2p54socket")) pin_socket(2p54header, comp[4], comp[5], param(6, false), param(7, 0), param(8, false), cutouts, param(9, undef));
|
||||
if(show(comp, "chip")) chip(comp[4], comp[5], comp[6], param(7, grey(30)), cutouts);
|
||||
if(show(comp, "rj45")) rj45(cutouts);
|
||||
@@ -1140,17 +1139,21 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
|
||||
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));
|
||||
if(show(comp, "jst_xh")) jst_xh_header(jst_xh_header, comp[4], param(5, false), param(6, "white"), param(7, undef));
|
||||
if(show(comp, "jst_ph")) jst_xh_header(jst_ph_header, comp[4], param(5, false), param(6, "white"), param(7, undef));
|
||||
if(show(comp, "jst_xh")) jst_xh_header(jst_xh_header, comp[4], param(5, false), param(6, false), param(7, undef));
|
||||
if(show(comp, "jst_ph")) jst_xh_header(jst_ph_header, comp[4], param(5, false), param(6, false), param(7, undef));
|
||||
if(show(comp, "jst_zh")) jst_xh_header(jst_zh_header, comp[4], param(5, false), param(6, false), param(7, undef));
|
||||
if(show(comp, "potentiometer")) let(pot = param(4, BTT_encoder)) translate_z(pot_size(pot).z) vflip() potentiometer(pot, shaft_length = param(5, undef));
|
||||
if(show(comp, "buzzer")) buzzer(param(4, 9), param(5, 12), param(6, grey(20)));
|
||||
if(show(comp, "smd_res")) smd_resistor(comp[4], comp[5]);
|
||||
if(show(comp, "smd_cap")) smd_capacitor(comp[4], comp[5], param(6, undef));
|
||||
if(show(comp, "smd_tant")) smd_tant(comp[4], param(5, undef));
|
||||
if(show(comp, "smd_sot")) smd_sot(comp[4], comp[5]);
|
||||
if(show(comp, "smd_soic")) smd_soic(comp[4], comp[5]);
|
||||
if(show(comp, "smd_diode")) smd_diode(comp[4], comp[5]);
|
||||
if(show(comp, "smd_inductor")) smd_inductor(comp[4], comp[5]);
|
||||
if(show(comp, "smd_pot")) smd_pot(comp[4], comp[5]);
|
||||
if(show(comp, "smd_coax")) smd_coax(comp[4]);
|
||||
if(show(comp, "smd_qfp")) smd_qfp(comp[4], comp[5]);
|
||||
if(show(comp, "vero_pin")) vero_pin(param(4, false));
|
||||
if(show(comp, "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");
|
||||
@@ -1210,14 +1213,16 @@ module pcb_cutouts(type, angle = undef) //! Make cut outs to clear components o
|
||||
|
||||
module pcb_grid_positions(type) {
|
||||
grid = pcb_grid(type);
|
||||
x0 = grid.x;
|
||||
y0 = grid.y;
|
||||
for(i = [0 : 7 : len(grid) - 1]) {
|
||||
x0 = grid[i];
|
||||
y0 = grid[i + 1];
|
||||
|
||||
cols = is_undef(grid[2]) ? round((pcb_length(type) - 2 * x0) / inch(0.1)) : grid[2] - 1;
|
||||
rows = is_undef(grid[3]) ? round((pcb_width(type) - 2 * y0) / inch(0.1)) : grid[3] - 1;
|
||||
for(x = [0 : cols], y = [0 : rows])
|
||||
pcb_grid(type, x, y)
|
||||
children();
|
||||
cols = is_undef(grid[i + 2]) ? round((pcb_length(type) - 2 * x0) / inch(0.1)) : grid[i + 2] - 1;
|
||||
rows = is_undef(grid[i + 3]) ? round((pcb_width(type) - 2 * y0) / inch(0.1)) : grid[i + 3] - 1;
|
||||
for(x = [0 : cols], y = [0 : rows])
|
||||
pcb_grid(type, x, y, i = i)
|
||||
children();
|
||||
}
|
||||
}
|
||||
|
||||
module pcb(type) { //! Draw specified PCB
|
||||
|
@@ -662,7 +662,7 @@ ArduinoUno3 = ["ArduinoUno3", "Arduino Uno R3", 68.58, 53.34, 1.6, 0, 3.3, 0, "#
|
||||
[18.7, 25.8, 0, "rd_xtal", HC49_4H],
|
||||
[7.5, 17.2, 90, "smd_sot", SOT223],
|
||||
[7.9, 26.5, 90, "smd_sot", SOT23],
|
||||
[21.3, 2.7, 0, "smd_diode", DO241AC],
|
||||
[21.3, 2.7, 0, "smd_diode", DO214AC],
|
||||
[27.8, 34.6, 0, "smd_led", LED0805, "red"],
|
||||
[27.8, 37, 0, "smd_led", LED0805, "red"],
|
||||
[27.8, 42.3, 0, "smd_led", LED0805, "red"],
|
||||
@@ -796,7 +796,7 @@ MP1584EN = ["MP1584EN", "MP1584EN 3A buck converter", 22, 17, 1.25, 0, 1, [2, 2]
|
||||
[6.2, 2.1, 0, "smd_cap", CAP0603, 0.5],
|
||||
[9.2, 3.5, 0, "smd_res", RES0603, "104"],
|
||||
[9.2, 2.1, 0, "smd_res", RES0603, "104"],
|
||||
[6.3, 14.4, 0, "smd_diode",DO241AC, "SS34"],
|
||||
[6.3, 14.4, 0, "smd_diode",DO214AC, "SS34"],
|
||||
[12.1, 4.9, 0, "smd_cap", CAP0603, 0.5],
|
||||
[15.8, 4.9, 0, "smd_cap", CAP0603, 0.5],
|
||||
[14.5, 10, 90, "smd_inductor", IND2525, "4R7"],
|
||||
@@ -858,7 +858,8 @@ ESP_01 = [
|
||||
[ -6.6, -5.8, 0, "block", 0.7, 7.5, 0.1, gold ],
|
||||
[ -4.8, -2.3, 0, "block", 8.8, 0.7, 0.1, gold ],
|
||||
],
|
||||
[] // accessories
|
||||
[], // accessories
|
||||
[2.8 - 1.27, 3.54, 2, 4, silver, 2.54, 2.54] // grid
|
||||
];
|
||||
|
||||
XIAO = [
|
||||
@@ -977,12 +978,108 @@ L9110S = ["L9110S", "L9110S 2-Channel motor driver module", 29.2, 23, 1.6, 0, 3,
|
||||
],
|
||||
[]];
|
||||
|
||||
PanelDue_v3 = ["PanelDue_v3", "Panel Due v3.0a LCD Display interface", 53, 73, 1.2, 0, 3.2, 0, "#2140BE", false, [[5,5], [5, -5], [43.7, 37.2]],
|
||||
[
|
||||
[ 45.0, 26.5, 45, "buzzer", 6, 12],
|
||||
[ 32.8, 36.5, 90, "2p54socket", 20, 2],
|
||||
[ 31.3, 5.9, 180, "molex_hdr", 4, 1],
|
||||
[ 38.0, 53.2, -90, "2p54boxhdr", 5, 2, false, true, true],
|
||||
[ 40.8, 67.4, 0, "button_6mm"],
|
||||
[ 45.1, 16.5, 0, "button_6mm"],
|
||||
[ 51.2, 68.0, 0, "usb_uA"],
|
||||
[ 13.6, 35.2, 0, "smd_qfp", QFP50P1200X1200X160_64N, "ATSAM4S4BA"],
|
||||
[ 14.6, 7.9, 180, "smd_sot", SOT223],
|
||||
[ 23.2, 14, 0, "smd_sot", SOT23],
|
||||
[ 31.7, 65, 180, "smd_diode", DO214AC],
|
||||
[ 24.9, 3.8, 180, "smd_diode", DO214AC],
|
||||
[ 1.9, 33, -90, "smd_cap", CAP0603, 0.5],
|
||||
[ 1.9, 28.9, 90, "smd_cap", CAP0603, 0.5],
|
||||
[ 14.6, 13.2, 0, "smd_cap", CAP0805, 0.85],
|
||||
[ 20.3, 57.5, 90, "smd_res", RES0603],
|
||||
[ 18.1, 57.5, 90, "smd_res", RES0603],
|
||||
[ 27.6, 57, 0, "smd_res", RES0603],
|
||||
[ 27.3, 7.2, 0, "smd_res", RES0603],
|
||||
[ 27.3, 9.7, 0, "smd_res", RES0603],
|
||||
[ 18.5, 11.5, 90, "smd_cap", CAP0805, 0.85],
|
||||
[ 32.5, 71.2, 180, "smd_cap", CAP0603, 0.5],
|
||||
[ 14.1, 25.1, 90, "smd_cap", CAP0603, 0.5],
|
||||
[ 4.2, 36.9, 0, "smd_cap", CAP0603, 0.5],
|
||||
[ 7.7, 28.4, 90, "smd_cap", CAP0603, 0.5],
|
||||
[ 22.0, 34.6, 0, "smd_cap", CAP0603, 0.5],
|
||||
[ 11.4, 44.5, 90, "smd_cap", CAP0603, 0.5],
|
||||
[ 22.1, 31.2, 0, "smd_cap", CAP0603, 0.5],
|
||||
[ 12.0, 25.5, 90, "smd_cap", CAP0603, 0.5],
|
||||
[ 16.2, 24.2, 90, "smd_cap", CAP0603, 0.85],
|
||||
[ 9.3, 44.5, 90, "smd_cap", CAP0603, 0.85],
|
||||
[ 5.3, 34.9, 0, "smd_cap", CAP0603, 0.5],
|
||||
[ 37.5, 61.9, 90, "smd_res", RES0603, "0"],
|
||||
[ 4.8, 26.5, 0, "smd_cap", CAP0603, 0.85],
|
||||
[ 3.3, 24.5, 0, "smd_res", RES0603, "1"],
|
||||
[ 4.8, 30.8, 90, "chip", 5, 3.2, 1.1],
|
||||
[ 6.9, 24.5, 0, "smd_res", L2012C],
|
||||
[ 21.8, 7.4, 0, "smd_res", L2012C],
|
||||
[ 40.8, 71.9, 0, "text", 6, 1.42, "Erase"],
|
||||
[ 51.4, 16.5, 90, "text", 6, 1.42, "Reset"],
|
||||
[ 51.4, 52.2, 90, "text", 7.4, 1.42, "CONN_SD"],
|
||||
[ 2.7, 9.7, 0, "text", 4, 1.27, "GND"],
|
||||
[ 8.0, 9.7, 0, "text", 4, 1.27, "3.3V"],
|
||||
[ 38.1, 21.2, 0, "text", 4, 1.42, "3.3V"],
|
||||
[ 40.7, 12.2, 0, "text", 2, 1.42, "5V"],
|
||||
[ 49.8, 9.8, 0, "text", 3, 1.27, "Din"],
|
||||
[ 50.3, 7.3, 0, "text", 4, 1.27, "Dout"],
|
||||
[ 49.8, 4.7, 0, "text", 3, 1.27, "Gnd"],
|
||||
[ 49.8, 2.2, 0, "text", 3, 1.27, "+5V"],
|
||||
],
|
||||
[],
|
||||
[6, 60.8 - inch(0.3), 1, 4, silver, 2.54, 2.54, // X4
|
||||
38, 16.1 - inch(0.1), 1, 3, silver, 2.54, 2.54, // JP1
|
||||
3.1, 12, 2, 1, silver, 4.6, 2.54, // test points
|
||||
31.3, 5.9 - inch(0.15), 1, 4, silver, 2.54, 2.64, // X1
|
||||
38 - inch(0.05), 53.2 - inch(0.2), 2, 5, silver, 2.54, 2.54, // X5
|
||||
32.8- inch(0.05),36.5 - inch(0.95),2, 20, silver, 2.54, 2.54, // X3
|
||||
],
|
||||
];
|
||||
|
||||
//================================================
|
||||
// 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, 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];
|
||||
|
||||
|
@@ -74,8 +74,11 @@ module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cu
|
||||
|
||||
translate_z(smt ? 3.5 - h : 0) {
|
||||
for(x = [0 : cols - 1], y = [0 : rows - 1]) {
|
||||
py = pitch * (y - (rows - 1) / 2);
|
||||
pin = [pitch * (x - (cols - 1) / 2), py, py + width / 2]; // Position of pin joint
|
||||
|
||||
// Vertical part of the pin
|
||||
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2)])
|
||||
translate([pin.x, pin.y])
|
||||
if(right_angle)
|
||||
pin(type, hdr_pin_below(type) + (y + 0.5) * pitch);
|
||||
else
|
||||
@@ -84,11 +87,12 @@ module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cu
|
||||
if(right_angle) {
|
||||
w = hdr_pin_width(type);
|
||||
// Horizontal part of the pin
|
||||
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_length(type) - hdr_pin_below(type) + ra_offset + pitch / 2 + (y - 0.5) * pitch);
|
||||
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);
|
||||
|
||||
// corner
|
||||
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2) - w / 2, pitch * (y - (rows - 1) / 2) + width / 2 - w / 2])
|
||||
translate([pin.x, pin.y - w / 2, pin.z - w / 2])
|
||||
rotate([0, -90, 0])
|
||||
color(hdr_pin_colour(type))
|
||||
rotate_extrude(angle = 90, $fn = 32)
|
||||
@@ -119,7 +123,7 @@ module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cu
|
||||
}
|
||||
}
|
||||
|
||||
module box_header(type, cols = 1, rows = 1, smt = false, cutout = false) { //! Draw box header
|
||||
module box_header(type, cols = 1, rows = 1, smt = false, cutout = false, right_angle = false) { //! Draw box header
|
||||
pitch = hdr_pitch(type);
|
||||
size = hdr_box_size(type);
|
||||
w = cols * pitch + 7.62;
|
||||
@@ -127,36 +131,63 @@ module box_header(type, cols = 1, rows = 1, smt = false, cutout = false) { //! D
|
||||
h = size.z;
|
||||
t = hdr_box_wall(type);
|
||||
base = h - 6.4;
|
||||
ra_offset = 2.4;
|
||||
|
||||
if(cutout)
|
||||
dogbone_rectangle([cols * pitch + 2 * panel_clearance, rows * pitch + 2 * panel_clearance, 100], center = false);
|
||||
else {
|
||||
vitamin(str("box_header(", type[0], ", ", cols, ", ", rows, arg(smt, false, "smt"), "): Box header ", cols, " x ", rows));
|
||||
vitamin(str("box_header(", type[0], ", ", cols, ", ", rows, arg(smt, false, "smt"), arg(right_angle, false, "right_angle"), "): Box header ", cols, " x ", rows, right_angle ? " right angle " : ""));
|
||||
|
||||
translate_z(smt ? 3.5 - h : 0) {
|
||||
for(x = [0 : cols - 1], y = [0 : rows - 1])
|
||||
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2), 0])
|
||||
pin(type, hdr_pin_length(type) - pitch + base);
|
||||
for(x = [0 : cols - 1], y = [0 : rows - 1]) {
|
||||
py = -pitch * (y - (rows - 1) / 2);
|
||||
pin = [pitch * (x - (cols - 1) / 2), py, l / 2 - py]; // Position of pin joint
|
||||
|
||||
color(hdr_base_colour(type)) {
|
||||
linear_extrude(base)
|
||||
square([w, l], center = true);
|
||||
translate([pin.x, pin.y])
|
||||
if(right_angle)
|
||||
pin(type, hdr_pin_below(type) + pin.z);
|
||||
else
|
||||
pin(type, hdr_pin_length(type) - pitch + base);
|
||||
|
||||
linear_extrude(h)
|
||||
difference() {
|
||||
square([w, l], center = true);
|
||||
if(right_angle) {
|
||||
pw = hdr_pin_width(type);
|
||||
// Horizontal part of the pin
|
||||
translate([pin.x, pin.y + hdr_pin_below(type), pin.z])
|
||||
rotate([-90, 0, 0])
|
||||
pin(type, hdr_pin_length(type) - hdr_pin_below(type) + ra_offset + y * pitch);
|
||||
|
||||
square([w - t, l - t], center = true);
|
||||
|
||||
translate([0, -l / 2])
|
||||
square([4.5, 4.5], center = true);
|
||||
}
|
||||
// corner
|
||||
translate([pin.x, pin.y + pw / 2, pin.z - pw / 2])
|
||||
rotate([0, -90, 180])
|
||||
color(hdr_pin_colour(type))
|
||||
rotate_extrude(angle = 90, $fn = 32)
|
||||
translate([0, -pw / 2])
|
||||
square(pw);
|
||||
}
|
||||
}
|
||||
if(show_plugs)
|
||||
color(housing_colour)
|
||||
translate_z(base)
|
||||
linear_extrude(housing_height)
|
||||
square([cols * pitch, rows * pitch], center = true);
|
||||
|
||||
translate([0, right_angle ? ra_offset + (rows - 1) * pitch / 2 : 0, right_angle ? l / 2 : 0])
|
||||
rotate([right_angle ? -90 : 0, 0, 0]) {
|
||||
color(hdr_base_colour(type)) {
|
||||
linear_extrude(base)
|
||||
square([w, l], center = true);
|
||||
|
||||
linear_extrude(h)
|
||||
difference() {
|
||||
square([w, l], center = true);
|
||||
|
||||
square([w - t, l - t], center = true);
|
||||
|
||||
translate([0, -l / 2])
|
||||
square([4.5, 4.5], center = true);
|
||||
}
|
||||
}
|
||||
if(show_plugs)
|
||||
color(housing_colour)
|
||||
translate_z(base)
|
||||
linear_extrude(housing_height)
|
||||
square([cols * pitch, rows * pitch], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -242,9 +273,11 @@ module pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt
|
||||
}
|
||||
}
|
||||
|
||||
module jst_xh_header(type, pin_count, right_angle = false, colour = false, pin_colour = false, smt = false) { //! Draw JST XH connector
|
||||
colour = colour ? colour : hdr_base_colour(type);
|
||||
pin_colour = pin_colour ? pin_colour : hdr_pin_colour(type);
|
||||
module jst_xh_header(type, pin_count, right_angle = false, colour = false, pin_colour = false, smt = false) { //! Draw JST XH, PH or ZH connector
|
||||
series = chr([ord(type[0][4]) - 32, ord(type[0][5]) - 32]);
|
||||
vitamin(str("jst_xh_header(", type[0], ", ", pin_count, arg(right_angle, false, "right_angle"), arg(colour, false, "colour"), arg(smt, false, "smt"), "): JST ", series, " connector ",
|
||||
pin_count, " way", right_angle ? " right_angle" :""));
|
||||
|
||||
pitch = hdr_pitch(type);
|
||||
size = hdr_box_size(type) + [(pin_count - 1) * pitch, 0, 0];
|
||||
pinOffsetX = hdr_box_size(type).x / 2; // Offset from last pin to box edge
|
||||
@@ -255,6 +288,7 @@ module jst_xh_header(type, pin_count, right_angle = false, colour = false, pin_c
|
||||
ra_z = ra_h - size.y / 2;
|
||||
ra_extra = ra_h - size.y; // thicker base for right angle version
|
||||
pinWidth = hdr_pin_width(type);
|
||||
pin_colour = pin_colour ? pin_colour : hdr_pin_colour(type);
|
||||
|
||||
module jst_xh_socket(type, pin_count, ra = false) {
|
||||
module wall() {
|
||||
@@ -308,7 +342,7 @@ module jst_xh_header(type, pin_count, right_angle = false, colour = false, pin_c
|
||||
}
|
||||
} // end module
|
||||
|
||||
color(colour)
|
||||
color(colour ? colour : hdr_base_colour(type))
|
||||
if(right_angle)
|
||||
translate([0, -ra_box_offset, ra_z])
|
||||
rotate([-90, 0, 180])
|
||||
|
@@ -27,9 +27,9 @@
|
||||
2p54header = ["2p54header", 2.54, 11.6, 3.2, 0.66, gold, grey(20), 8.5, [0, 0, 8.7], 2.4, 0, 0, 0 ];
|
||||
2p54joiner = ["2p54joiner", 2.54, 6.86, 2.5, 0.66, gold, grey(20), 8.5, [0, 0, 8.7], 2.4, 0, 0, 0 ]; // Cropped pins for joining PCBs
|
||||
|
||||
jst_xh_header = ["jst_xh_header",2.5, 10, 3.4, 0.64, gold, grey(90), 0, [4.9, 5.75, 7], 0.8, 0.525, 0.6, 6.1];
|
||||
jst_ph_header = ["jst_ph_header",2.0, 9, 3.4, 0.64, silver, grey(90), 0, [3.9, 4.5, 6], 0.6, 0.55, 0.25, 4.8];
|
||||
jst_zh_header = ["jst_zh_header",1.5, 7.4, 3.4, 0.5 , silver, grey(90), 0, [3.0, 3.5,4.5], 0.5, 0.45, 0.25, 3.7];
|
||||
jst_xh_header = ["jst_xh_header",2.5, 10, 3.4, 0.64, gold, "white", 0, [4.9, 5.75, 7], 0.8, 0.525, 0.6, 6.1];
|
||||
jst_ph_header = ["jst_ph_header",2.0, 9, 3.4, 0.64, silver, "white", 0, [3.9, 4.5, 6], 0.6, 0.55, 0.25, 4.8];
|
||||
jst_zh_header = ["jst_zh_header",1.5, 7.4, 3.4, 0.5 , silver, "white", 0, [3.0, 3.5,4.5], 0.5, 0.45, 0.25, 3.7];
|
||||
|
||||
pin_headers = [ 2p54header ];
|
||||
|
||||
|
@@ -32,7 +32,7 @@ function pot_face(type) = type[2]; //! Faceplate rib width, plate depth and
|
||||
function pot_wafer(type) = type[3]; //! Width, diameter and thickness of the track wafer plus true if curved
|
||||
function pot_gangs(type) = type[4]; //! Number of gangs for mult-gang pot
|
||||
function pot_thread_d(type) = type[5]; //! Nomininal thread diameter
|
||||
function pot_thread_p(type) = type[6]; //! Thread pritch
|
||||
function pot_thread_p(type) = type[6]; //! Thread pitch
|
||||
function pot_thread_h(type) = type[7]; //! Height of threaded part
|
||||
function pot_boss_d(type) = type[8]; //! Boss diameter
|
||||
function pot_boss_h(type) = type[9]; //! Boss height
|
||||
|
123
vitamins/sbr_rail.scad
Normal 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
@@ -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>
|
@@ -41,6 +41,7 @@ function screw_washer(type) = type[9]; //! Default washer
|
||||
function screw_nut(type) = type[10]; //! Default nut
|
||||
function screw_pilot_hole(type) = type[11]; //! Pilot hole radius for wood screws, tap radius for machine screws
|
||||
function screw_clearance_radius(type) = type[12]; //! Clearance hole radius
|
||||
function screw_thread_diameter(type) = type[13]; //! Thread diameter, if different from nominal diameter
|
||||
function screw_nut_radius(type) = screw_nut(type) ? nut_radius(screw_nut(type)) : 0; //! Radius of matching nut
|
||||
function screw_boss_diameter(type) = max(washer_diameter(screw_washer(type)) + 1, 2 * (screw_nut_radius(type) + 3 * extrusion_width)); //! Boss big enough for nut trap and washer
|
||||
function screw_head_depth(type, d = 0) = //! How far a counter sink head will go into a straight hole diameter d
|
||||
@@ -87,47 +88,50 @@ module screw(type, length, hob_point = 0, nylon = false) { //! Draw specified sc
|
||||
vitamin(str("screw(", type[0], "_screw, ", length, arg(hob_point, 0, "hob_point"), arg(nylon, false, "nylon"), "): ", description));
|
||||
|
||||
head_type = screw_head_type(type);
|
||||
rad = screw_radius(type) - eps;
|
||||
shaft_rad = screw_radius(type) - eps;
|
||||
head_rad = screw_head_radius(type);
|
||||
head_height = screw_head_height(type);
|
||||
socket_af = screw_socket_af(type);
|
||||
socket_depth= screw_socket_depth(type);
|
||||
socket_rad = socket_af / cos(30) / 2;
|
||||
max_thread = screw_max_thread(type);
|
||||
has_shoulder = !is_undef(screw_thread_diameter(type));
|
||||
thread_rad = has_shoulder ? screw_thread_diameter(type) / 2 : screw_radius(type);
|
||||
thread = max_thread ? length >= max_thread + 5 ? max_thread
|
||||
: length
|
||||
: length;
|
||||
d = 2 * screw_radius(type);
|
||||
pitch = metric_coarse_pitch(d);
|
||||
thread_offset = has_shoulder ? thread : 0;
|
||||
thread_d = 2 * thread_rad;
|
||||
pitch = metric_coarse_pitch(thread_d);
|
||||
colour = nylon || head_type == hs_grub ? grey(40) : grey(80);
|
||||
|
||||
module shaft(socket = 0, headless = false) {
|
||||
point = screw_nut(type) ? 0 : 3 * rad;
|
||||
shank = length - thread - socket;
|
||||
point = screw_nut(type) ? 0 : 3 * shaft_rad;
|
||||
shank = length - socket - (has_shoulder ? 0 : thread);
|
||||
|
||||
if(show_threads && !point && pitch)
|
||||
translate_z(-length)
|
||||
male_metric_thread(d, pitch, thread - (shank > 0 || headless ? 0 : socket), false, top = headless ? -1 : 0, solid = !headless, colour = colour);
|
||||
translate_z(-length - thread_offset)
|
||||
male_metric_thread(thread_d, pitch, thread - (shank > 0 || headless ? 0 : socket), false, top = headless ? -1 : 0, solid = !headless, colour = colour);
|
||||
else
|
||||
color(colour * 0.9)
|
||||
rotate_extrude() {
|
||||
translate([0, -length + point])
|
||||
square([rad, length - socket - point]);
|
||||
translate([0, -length + point - thread_offset])
|
||||
square([thread_rad - eps, length - socket - point]);
|
||||
|
||||
if(point)
|
||||
polygon([
|
||||
[0.4, -length], [0, point - length], [rad, point - length]
|
||||
[0.4, -length], [0, point - length], [shaft_rad, point - length]
|
||||
]);
|
||||
}
|
||||
|
||||
if(shank > 0)
|
||||
color(colour)
|
||||
translate_z(-shank - socket)
|
||||
cylinder(r = rad + eps, h = shank);
|
||||
cylinder(r = shaft_rad + eps, h = shank);
|
||||
}
|
||||
|
||||
module cs_head(socket_rad, socket_depth) {
|
||||
head_t = rad / 5;
|
||||
head_t = shaft_rad / 5;
|
||||
head_height = head_rad + head_t;
|
||||
|
||||
color(colour) {
|
||||
@@ -173,7 +177,7 @@ module screw(type, length, hob_point = 0, nylon = false) { //! Draw specified sc
|
||||
}
|
||||
if(head_type == hs_grub) {
|
||||
color(colour) {
|
||||
r = show_threads ? rad - pitch / 2 : rad;
|
||||
r = show_threads ? shaft_rad - pitch / 2 : shaft_rad;
|
||||
translate_z(-socket_depth)
|
||||
linear_extrude(socket_depth)
|
||||
difference() {
|
||||
|
@@ -103,6 +103,9 @@ M8_hex_screw = ["M8_hex", "M8 hex", hs_hex, 8, 15, 5.65, 0, 0
|
||||
|
||||
M3_low_cap_screw = ["M3_low_cap", "M3 low cap", hs_cap, 3, 5.5, 2, 1.5, 2.0, 18, M3_washer, M3_nut, M3_tap_radius, M3_clearance_radius];
|
||||
|
||||
M3_shoulder_screw= ["M3_shoulder", "M3 shoulder",hs_cap, 4, 7.0, 2.4, 1.5, 3.0, 6, M4_washer, M3_nut, M3_tap_radius, 2, 3];
|
||||
M4_shoulder_screw= ["M4_shoulder", "M4 shoulder",hs_cap, 5, 9.0, 2.4, 1.5, 3.0, 8, M5_washer, M4_nut, M4_tap_radius, 2.5, 4];
|
||||
|
||||
M3_grub_screw = ["M3_grub", "M3 grub", hs_grub, 3, 0, 0, 2.5, 1.5, 0, M3_washer, M3_nut, M3_tap_radius, M3_clearance_radius];
|
||||
M4_grub_screw = ["M4_grub", "M4 grub", hs_grub, 4, 0, 0, 2.4, 2.0, 0, M4_washer, M4_nut, M4_tap_radius, M4_clearance_radius];
|
||||
M5_grub_screw = ["M5_grub", "M5 grub", hs_grub, 5, 0, 0, 2.4, 2.5, 0, M5_washer, M5_nut, M5_tap_radius, M5_clearance_radius];
|
||||
@@ -117,6 +120,7 @@ No8_screw = ["No8", "No8 pan wood", hs_pan, 4.2, 8.2, 3.05, 0, 0
|
||||
screw_lists = [
|
||||
[ M2_cap_screw, M2p5_cap_screw, M3_cap_screw, M4_cap_screw, M5_cap_screw, M6_cap_screw, M8_cap_screw],
|
||||
[ 0, 0, M3_low_cap_screw],
|
||||
[ 0, 0, M3_shoulder_screw, M4_shoulder_screw],
|
||||
[ M2_cs_cap_screw, 0, M3_cs_cap_screw, M4_cs_cap_screw, M5_cs_cap_screw, M6_cs_cap_screw, M8_cs_cap_screw],
|
||||
[ M2_dome_screw, M2p5_dome_screw,M3_dome_screw, M4_dome_screw, M5_dome_screw],
|
||||
[ 0, 0, M3_hex_screw, M4_hex_screw, M5_hex_screw, M6_hex_screw, M8_hex_screw],
|
||||
|
@@ -19,6 +19,21 @@
|
||||
|
||||
//
|
||||
//! Surface mount components for PCBs.
|
||||
//!
|
||||
//! Note that the value string for tantalum capacitors is the the capacitance in pico farads expressed as two digits plus an exponent plus a single letter voltage code.
|
||||
//! E.g. 475A is 4.7uF 10V on the parts list.
|
||||
//!
|
||||
//! | Code | Voltage |
|
||||
//! | ---- | ------- |
|
||||
//! | e | 2.5 |
|
||||
//! | G | 4 |
|
||||
//! | J | 6.3 |
|
||||
//! | A | 10 |
|
||||
//! | C | 16 |
|
||||
//! | D | 20 |
|
||||
//! | E | 25 |
|
||||
//! | V | 35 |
|
||||
//! | H | 50 |
|
||||
//
|
||||
include <../utils/core/core.scad>
|
||||
|
||||
@@ -84,11 +99,16 @@ module smd_led(type, colour, cutout) { //! Draw an SMD LED with specified `colou
|
||||
|
||||
function smd_res_size(type) = type[1]; //! Body length, width and height
|
||||
function smd_res_end_cap(type) = type[2]; //! End cap width
|
||||
function smd_res_power(type) = type[3]; //! Power rating in Watts
|
||||
function smd_res_power(type) = type[3]; //! Power rating in Watts, 0 for choke
|
||||
|
||||
module smd_resistor(type, value) { //! Draw an SMD resistor with specified value
|
||||
size = smd_res_size(type);
|
||||
vitamin(str("smd_resistor(", type[0], ", ", value, "): SMD resistor ", smd_size(size), " ", value, " ", smd_res_power(type), "W"));
|
||||
power = smd_res_power(type);
|
||||
call = str("smd_resistor(", type[0], ", ", value, "): SMD ");
|
||||
if(power)
|
||||
vitamin(str(call, "resistor ", smd_size(size), " ", value, " ", power, "W"));
|
||||
else
|
||||
vitamin(str(call, "choke ", smd_size(size), " ", value));
|
||||
|
||||
t = 0.04;
|
||||
cap = smd_res_end_cap(type);
|
||||
@@ -234,6 +254,7 @@ function smd_diode_size(type) = type[1]; //! Body length, width and height
|
||||
function smd_diode_z(type) = type[2]; //! Height above PCB surface
|
||||
function smd_diode_lead_z(type) = type[3]; //! Top of lead frame from top
|
||||
function smd_diode_leads(type) = type[4]; //! Lead extent in x, width, thickness and gap
|
||||
function smd_diode_colour(type) = type[5]; //! Body colour
|
||||
|
||||
module smd_diode(type, value) { //! Draw an SMD diode
|
||||
vitamin(str("smd_diode(", type[0], "): ", type[0], " package ", value));
|
||||
@@ -248,7 +269,7 @@ module smd_diode(type, value) { //! Draw an SMD diode
|
||||
gap = leads[3];
|
||||
gap2 = gap - leads.z * 2;
|
||||
|
||||
color(grey(20))
|
||||
color(smd_diode_colour(type))
|
||||
difference() {
|
||||
hull()
|
||||
for(z = [z0, z1, z2], inset = abs(z - z1) * tan(slant))
|
||||
@@ -287,6 +308,75 @@ module smd_diode(type, value) { //! Draw an SMD diode
|
||||
|
||||
}
|
||||
|
||||
function smd_tant_size(type) = type[1]; //! Body length, width and height
|
||||
function smd_tant_z(type) = type[2]; //! Height above PCB surface
|
||||
function smd_tant_lead_z(type) = type[3]; //! Top of lead frame from top
|
||||
function smd_tant_leads(type) = type[4]; //! Lead extent in x, width, thickness and gap
|
||||
function smd_tant_colours(type)= type[5]; //! Colours of body and stripe
|
||||
|
||||
module smd_tant(type, value) { //! Draw an SMD tantalum capacitor
|
||||
function dig(c) = let(x = ord(c) - ord("0")) assert(x >= 0 && x <= 9, "expected value in the form 475A for 4.7uF 10V") x;
|
||||
uF = is_undef(value) ? "" : str(" ,", (dig(value[0]) * 10 + dig(value[1])) * 10 ^ dig(value[2]) / 10^6, "uF");
|
||||
codes = "eGJACDEVH";
|
||||
voltages = [2.5, 4, 6.3, 10, 16, 20, 25, 35, 50];
|
||||
volts = is_undef(value) ? "" : let(c = value[3])
|
||||
assert(in(codes, c), str("expected the 4th character of value to be a voltage code: ", codes, ", got ", c))
|
||||
str(", ", voltages[search(c, codes)[0]], "V");
|
||||
vitamin(str("smd_tant(", type[0], "): SMD Tantalum capacitor package ", type[0][len(type[0]) -1], uF, volts));
|
||||
|
||||
size = smd_tant_size(type);
|
||||
slant = 5; //! 5 degree body draft angle
|
||||
z0 = smd_tant_z(type);
|
||||
z2 = z0 + size.z;
|
||||
z1 = z2 - smd_tant_lead_z(type);
|
||||
stripe = size.x / 5;
|
||||
leads = smd_tant_leads(type);
|
||||
gap = leads[3];
|
||||
gap2 = gap - leads.z * 2;
|
||||
colours = smd_tant_colours(type);
|
||||
inset = (z2 - z1) * tan(slant);
|
||||
|
||||
color(colours[0])
|
||||
difference() {
|
||||
hull()
|
||||
for(z = [z0, z1, z2], inset = abs(z - z1) * tan(slant))
|
||||
translate_z(z)
|
||||
cube([size.x - 2 * inset, size.y - 2 * inset, eps], center = true);
|
||||
|
||||
for(side = [-1, 1])
|
||||
translate([side * (size.x / 2 - (size.x - gap2) / 4), 0, eps])
|
||||
cube([(size.x - gap2) / 2, size.y, 3 * leads.z], center = true);
|
||||
}
|
||||
|
||||
color("white") {
|
||||
w = 0.9 * (size.x - stripe - inset);
|
||||
translate([-size.x / 2 + inset + stripe + w / 2, 0, z2])
|
||||
linear_extrude(eps)
|
||||
resize([w, size.y / 2])
|
||||
text(value, halign = "center", valign = "center");
|
||||
}
|
||||
|
||||
color(colours[1]) {
|
||||
translate([-size.x / 2 + stripe * 0.2, -size.y / 2 + inset, z2])
|
||||
cube([(stripe - inset) * 0.8, size.y - 2 * inset, eps]);
|
||||
}
|
||||
|
||||
color(silver)
|
||||
translate_z(z1 / 2)
|
||||
rotate([90, 0, 0])
|
||||
linear_extrude(leads.y, center = true, convexity = 3) let($fn = 32)
|
||||
difference() {
|
||||
rounded_square([leads.x, z1], 2 * leads.z);
|
||||
|
||||
rounded_square([leads.x - 2 * leads.z, z1 - 2 * leads.z], leads.z);
|
||||
|
||||
translate([0, - z1 / 2])
|
||||
square([gap, leads.z * 2 + eps], center = true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function smd_inductor_size(type) = type[1]; //! Body length, width and height
|
||||
function smd_inductor_z(type) = type[2]; //! Height above PCB surface
|
||||
function smd_inductor_lead_z(type) = type[3]; //! Top of lead frame from top
|
||||
@@ -431,3 +521,125 @@ module smd_pot(type, value) { //! Draw an SMD pot
|
||||
square([track_w, track_l], center = true);
|
||||
}
|
||||
}
|
||||
|
||||
function smd_coax_base_size(type) = type[1]; //! Size of the insulating base
|
||||
function smd_coax_base_r(type) = type[2]; //! Corner radius of the base
|
||||
function smd_coax_tube(type) = type[3]; //! OD, ID, height
|
||||
function smd_coax_groove(type) = type[4]; //! Groove id, width and z
|
||||
function smd_coax_pin_d(type) = type[5]; //! Central pin diameter
|
||||
function smd_coax_lug_size(type) = type[6]; //! lug size
|
||||
function smd_contact_size(type) = type[7]; //! contact size
|
||||
|
||||
module smd_coax(type) { //! Draw an SMD coaxial connector
|
||||
vitamin(str("smd_coax(", type[0], "): SMD coax connector type: ", type[0]));
|
||||
|
||||
size = smd_coax_base_size(type);
|
||||
t = smd_coax_tube(type);
|
||||
g = smd_coax_groove(type);
|
||||
chamfer = (t.x - g.x) / 2;
|
||||
pin_r = smd_coax_pin_d(type) / 2;
|
||||
lug = smd_coax_lug_size(type);
|
||||
contact = smd_contact_size(type);
|
||||
$fn = 64;
|
||||
|
||||
color(grey(90))
|
||||
translate_z(eps)
|
||||
rounded_rectangle(size, smd_coax_base_r(type));
|
||||
|
||||
color(gold) {
|
||||
rotate_extrude() {
|
||||
polygon([
|
||||
[t.y / 2, 0.1],
|
||||
[t.y / 2, t.z],
|
||||
[g.x / 2, t.z],
|
||||
[t.x / 2, t.z - chamfer],
|
||||
[t.x / 2, g.z + g.y / 2 + chamfer],
|
||||
[g.x / 2, g.z + g.y / 2],
|
||||
[g.x / 2, g.z - g.y / 2],
|
||||
[t.x / 2, g.z - g.y / 2 - chamfer],
|
||||
[t.x / 2, 0.1],
|
||||
]);
|
||||
}
|
||||
hull() {
|
||||
translate_z(t.z - pin_r)
|
||||
sphere(pin_r);
|
||||
|
||||
translate_z(0.1)
|
||||
cylinder(r = pin_r, h = eps);
|
||||
}
|
||||
|
||||
for(side = [-1, 1])
|
||||
translate([side * size.x / 2, 0, lug.z / 2])
|
||||
cube(lug, center = true);
|
||||
|
||||
rotate(180)
|
||||
translate([-contact.x / 2, 0])
|
||||
cube([contact.x, contact.y / 2, contact.z]);
|
||||
|
||||
cylinder(r = pin_r * 9 / 5, h = 0.1);
|
||||
|
||||
tube_wall = (t.x - t.y) / 2;
|
||||
translate([-contact.x / 2, 0, (size.z - tube_wall) / 2])
|
||||
cube([contact.x, contact.y / 2, tube_wall]);
|
||||
}
|
||||
}
|
||||
|
||||
function smd_qfp_body_size(type) = type[1]; //! Size of the body
|
||||
function smd_qfp_slant(type) = type[2]; //! Angle of the slope
|
||||
function smd_qfp_pins(type) = type[3]; //! Number of pins
|
||||
function smd_qfp_pitch(type) = type[4]; //! Pin pitch
|
||||
function smd_qfp_pin_size(type) = type[5]; //! Pins dimensions
|
||||
function smd_qfp_gullwing(type) = type[6]; //! Gullwing S, L, R1, R2
|
||||
|
||||
module smd_qfp(type, value) { //! Draw and SMD QFP package
|
||||
vitamin(str("smd_qfp(", type[0], "): SMD chip: ", value, ", package : ", type[0]));
|
||||
|
||||
size = smd_qfp_body_size(type);
|
||||
offset = size.z / 2 * tan(smd_qfp_slant(type));
|
||||
d = 3 * offset;
|
||||
pitch = smd_qfp_pitch(type);
|
||||
pin = smd_qfp_pin_size(type);
|
||||
pins = smd_qfp_pins(type);
|
||||
g = smd_qfp_gullwing(type);
|
||||
s = g[0]; // length of top flat
|
||||
l = g[1]; // length of bottom flat
|
||||
r1 = g[2]; // top radius
|
||||
r2 = g[3] + pin.z / 2; // bottom radius
|
||||
pz = -size.z / 2 + pin.z / 2;
|
||||
gullwing = rounded_path([[-1, 0, 0], [s, 0, 0], r1, [pin.x - l + r2, 0, pz], r2, [pin.x, 0, pz]], $fn = 32);
|
||||
|
||||
color(grey(20))
|
||||
hull() {
|
||||
translate_z(size.z / 2)
|
||||
linear_extrude(eps)
|
||||
offset(delta = d, chamfer = true)
|
||||
offset(-d)
|
||||
square([size.x, size.y], center = true);
|
||||
|
||||
translate_z(size.z - eps)
|
||||
linear_extrude(eps)
|
||||
offset(-offset)
|
||||
square([size.x, size.y], center = true);
|
||||
|
||||
linear_extrude(eps)
|
||||
offset(-offset)
|
||||
square([size.x, size.y], center = true);
|
||||
}
|
||||
|
||||
color(silver)
|
||||
for(a = [0 : 90: 270])
|
||||
rotate(a)
|
||||
for(i = [0 : pins / 4 - 1])
|
||||
translate([size.x / 2, (i - (pins / 4 - 1) / 2) * pitch, size.z / 2])
|
||||
sweep(gullwing, rectangle_points(pin.y, pin.z));
|
||||
|
||||
color("white")
|
||||
translate_z(size.z)
|
||||
linear_extrude(eps) {
|
||||
resize([size.x * 0.9, size.y / 8])
|
||||
text(value, halign = "center", valign = "center");
|
||||
|
||||
translate([(-(pins / 4 - 1) * pitch) / 2, (-(pins / 4 - 1) * pitch) / 2])
|
||||
circle(r = pin.y, $fn = 32);
|
||||
}
|
||||
}
|
||||
|
@@ -27,33 +27,44 @@ LED1206 = ["LED1206", [3.2, 1.6, 0.5], [2.0, 1.6, .6]];
|
||||
|
||||
smd_leds = [LED0603, LED0805, LED1206];
|
||||
|
||||
RES0402 = ["RES0402", [1.0, 0.5, 0.35], 0.2, 1/16];
|
||||
RES0502 = ["RES0502", [1.3, 0.6, 0.38], 0.2, 1/20];
|
||||
RES0603 = ["RES0603", [1.6, 0.8, 0.45], 0.3, 1/10];
|
||||
RES0805 = ["RES0805", [2.0, 1.2, 0.45], 0.4, 1/8];
|
||||
RES1206 = ["RES1206", [3.1, 1.6, 0.6], 0.5, 1/4];
|
||||
L2012C = ["L2012C", [2.0, 1.25,0.9], 0.5, 0];
|
||||
|
||||
smd_resistors = [RES0603, RES0805, RES1206];
|
||||
smd_resistors = [RES0402, RES0502, RES0603, RES0805, RES1206, L2012C];
|
||||
|
||||
CAP0402 = ["CAP0402", [1.0, 0.5], 0.2];
|
||||
CAP0502 = ["CAP0502", [1.3, 0.6], 0.2];
|
||||
CAP0603 = ["CAP0603", [1.6, 0.8], 0.3];
|
||||
CAP0805 = ["CAP0805", [2.0, 1.2], 0.4];
|
||||
CAP1206 = ["CAP1206", [3.1, 1.6], 0.5];
|
||||
|
||||
smd_capacitors = [CAP0603, CAP0805, CAP1206];
|
||||
smd_capacitors = [CAP0402, CAP0502, CAP0603, CAP0805, CAP1206];
|
||||
|
||||
SOT23 = ["SOT23", [3, 1.4, 1.0], 0.05, 0.66, 1.9, 2.6, [0.4, 0.45, 0.15], 0.4];
|
||||
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]];
|
||||
SOIC14 = ["SOIC14", [8.70, 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]];
|
||||
SOIC8 = ["SOIC8", [4.90, 3.90, 1.25], 0.10, 0.66, 1.27, 6.00, [0.31, .50, 0.20]];
|
||||
SOIC14 = ["SOIC14", [8.70, 3.90, 1.25], 0.10, 0.66, 1.27, 6.00, [0.31, .50, 0.20]];
|
||||
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, SOIC14, SOIC16, SOIC18];
|
||||
|
||||
DO241AC = ["DO241AC", [4.0, 2.5, 2.0], 0.1, 1, [4.8, 1.2, 0.15, 2]];
|
||||
DO214AC = ["DO214AC", [4.0, 2.5, 2.0], 0.1, 1, [4.8, 1.2, 0.15, 2], grey(20)];
|
||||
|
||||
smd_diodes = [DO241AC];
|
||||
smd_diodes = [DO214AC];
|
||||
|
||||
TANT_A = ["TANT_A", [3.0, 1.6, 1.6], 0.1, 0.8, [3.2, 1.2, 0.08, 1.1], ["#E9D769", "#E9B44A"]];
|
||||
TANT_B = ["TANT_B", [3.3, 2.8, 1.9], 0.1, 0.95, [3.5, 2.2, 0.08, 1.4], ["#E9D769", "#E9B44A"]];
|
||||
TANT_C = ["TANT_C", [5.8, 3.2, 2.6], 0.1, 1.3, [6.0, 2.2, 0.08, 2.9], ["#E9D769", "#E9B44A"]];
|
||||
|
||||
smd_tants = [TANT_A, TANT_B, TANT_C];
|
||||
|
||||
IND2525 = ["IND2525", [6.75, 6.75, 2], 0.1, 1.75, [7.24, 3.2, 0.15, 4.4], grey(50)];
|
||||
|
||||
@@ -63,4 +74,13 @@ TC33X1 = ["TC33X1", [3.0, 3.8, 0.5], [0.95, 0.9, 0.88, 1.5, 0.2, 0.75],[3.0, 0.1
|
||||
|
||||
smd_pots = [TC33X1];
|
||||
|
||||
|
||||
U_FL_R_SMT_1 = ["U_FL_R_SMT_1", [2.6, 2.6, 0.35], 0.2, [2, 1.7, 1.25], [1.86, 0.09, 0.6], 0.5, [0.4, 1.8, 0.2], [0.6, 3.1, 0.2]];
|
||||
|
||||
smd_coaxs = [U_FL_R_SMT_1];
|
||||
|
||||
QFP50P1200X1200X160_64N = ["QFP50P1200X1200X160_64N", [10, 10, 1.6], 12, 64, 0.5, [1, 0.2, 0.1], [0.2, 0.6, 0.1, 0.1]];
|
||||
|
||||
smd_qfps = [ QFP50P1200X1200X160_64N ];
|
||||
|
||||
use <smd.scad>
|
||||
|