Compare commits
26 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
5e24a32a0b | ||
|
fbd8d8c7cd | ||
|
c77b18ebc9 | ||
|
b1592f51d4 | ||
|
deb0c14aa2 | ||
|
cc82cf2a6c | ||
|
61fc194995 | ||
|
f8af61568a | ||
|
05d16841c4 | ||
|
61f1dcc509 | ||
|
5fc70e19ac | ||
|
07e7eb77f7 | ||
|
1c5d9a8ef5 | ||
|
d3f0bfc17f | ||
|
81f3b084ab | ||
|
62bd2b5597 | ||
|
18cd33c663 | ||
|
e899306a13 | ||
|
ebfb330ac6 | ||
|
07da7d8dc7 | ||
|
38b52d13ee | ||
|
5a3bbf967d | ||
|
ddb2f16b99 | ||
|
9d4d5aba17 | ||
|
c5fab08a45 | ||
|
fecc93746a |
60
CHANGELOG.md
@@ -3,6 +3,66 @@
|
||||
This changelog is generated by `changelog.py` using manually added semantic version tags to classify commits as breaking changes, additions or fixes.
|
||||
|
||||
|
||||
#### [v21.3.1](https://github.com/nophead/NopSCADlib/releases/tag/v21.3.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v21.3.0...v21.3.1 "diff with v21.3.0")
|
||||
* 2023-04-29 [`b1592f5`](https://github.com/nophead/NopSCADlib/commit/b1592f51d4b16a125d9b28edae56f758fcac2f02 "show commit") [C.P.](# "Chris Palmer") Fixed `bom.py,` `views.py` and `tests.py` so that vitamin descriptions can contain more than one colon.
|
||||
|
||||
### [v21.3.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.3.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.2.0...v21.3.0 "diff with v21.2.0")
|
||||
* 2023-04-23 [`61fc194`](https://github.com/nophead/NopSCADlib/commit/61fc19499524a2b750d17a90627a697bf626bbf0 "show commit") [C.P.](# "Chris Palmer") Refactored for readability.
|
||||
|
||||
* 2023-04-23 [`f8af615`](https://github.com/nophead/NopSCADlib/commit/f8af61568a8362cf470bc9eb8de8323c8fc001c7 "show commit") [C.P.](# "Chris Palmer") Updated images and readme.
|
||||
|
||||
* 2023-04-23 [`05d1684`](https://github.com/nophead/NopSCADlib/commit/05d16841c4d48c5c8f453e438af0ff6eb5bffe53 "show commit") [C.P.](# "Chris Palmer") Fixed thread pitch.
|
||||
|
||||
* 2023-04-05 [`07e7eb7`](https://github.com/nophead/NopSCADlib/commit/07e7eb77f73fcaab4291388b49781b0e2de5a64c "show commit") [M.B.](# "Martin Budden") Added support for shoulder screws.
|
||||
|
||||
### [v21.2.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.2.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.1.2...v21.2.0 "diff with v21.1.2")
|
||||
* 2023-04-22 [`5fc70e1`](https://github.com/nophead/NopSCADlib/commit/5fc70e19ac5d320290f4a2151665e83f0829d796 "show commit") [C.P.](# "Chris Palmer") Added SMD Tantalum caps and 0502 and 0402 resistor and capacitors.
|
||||
|
||||
#### [v21.1.2](https://github.com/nophead/NopSCADlib/releases/tag/v21.1.2 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v21.1.1...v21.1.2 "diff with v21.1.1")
|
||||
* 2023-03-29 [`1c5d9a8`](https://github.com/nophead/NopSCADlib/commit/1c5d9a8ef5892caf9b2c4d0d84dc3d20eba699d3 "show commit") [C.P.](# "Chris Palmer") Removed utility functions used by `invert()` from documentation as not generally useful.
|
||||
|
||||
#### [v21.1.1](https://github.com/nophead/NopSCADlib/releases/tag/v21.1.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v21.1.0...v21.1.1 "diff with v21.1.0")
|
||||
* 2023-03-29 [`d3f0bfc`](https://github.com/nophead/NopSCADlib/commit/d3f0bfc17f82b42f2d81f2d72a54c3f0cc375604 "show commit") [C.P.](# "Chris Palmer") Fixed typo in resistor comment.
|
||||
|
||||
### [v21.1.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.1.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.0.1...v21.1.0 "diff with v21.0.1")
|
||||
* 2023-03-11 [`18cd33c`](https://github.com/nophead/NopSCADlib/commit/18cd33c66388d4d4e7be664c0f883cff0854524b "show commit") [C.](# "Chris") Fixed typos, corrected vitamin call, added boilerplate, updated images and readme.
|
||||
|
||||
* 2023-03-11 [`ebfb330`](https://github.com/nophead/NopSCADlib/commit/ebfb330ac69f4e90de84ecffea94ce067d041031 "show commit") [D.K.](# "Dirkjan Krijnders") Added comments and make holes a `linear_extrude` result
|
||||
|
||||
* 2023-03-08 [`c5fab08`](https://github.com/nophead/NopSCADlib/commit/c5fab08a454383b295be2b151fd715ee79b85db3 "show commit") [D.K.](# "Dirkjan Krijnders") Added `photo_interrupter` to the test
|
||||
|
||||
* 2023-03-08 [`fecc937`](https://github.com/nophead/NopSCADlib/commit/fecc93746ab80ad1fc74f0fe3465de92ffee7b36 "show commit") [D.K.](# "Dirkjan Krijnders") Added vitamins for photo interrupters
|
||||
|
||||
#### [v21.0.1](https://github.com/nophead/NopSCADlib/releases/tag/v21.0.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v21.0.0...v21.0.1 "diff with v21.0.0")
|
||||
* 2023-03-11 [`07da7d8`](https://github.com/nophead/NopSCADlib/commit/07da7d8dc7d3fb769e57a6b9ca86465357007b6c "show commit") [C.](# "Chris") Removed `Python2.7` from `usage.md` as no longer works.
|
||||
|
||||
* 2023-03-10 [`5a3bbf9`](https://github.com/nophead/NopSCADlib/commit/5a3bbf967dc967eca4726af517382e7eb875dde1 "show commit") [C.](# "Chris") Fixed broken cover image.
|
||||
|
||||
## [v21.0.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.0.0 "show release") Breaking Changes [...](https://github.com/nophead/NopSCADlib/compare/v20.24.0...v21.0.0 "diff with v20.24.0")
|
||||
* 2023-03-10 [`9d4d5ab`](https://github.com/nophead/NopSCADlib/commit/9d4d5aba17974e7b5911e723d48d7b9403a4bcb4 "show commit") [C.](# "Chris") `veroboard_assembly()` renamed `veroboard_fastened_assembly()`.
|
||||
`veroboard_assembly()` now doesn't include the fasteners.
|
||||
|
||||
### [v20.24.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.24.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.23.0...v20.24.0 "diff with v20.23.0")
|
||||
* 2023-03-10 [`d939401`](https://github.com/nophead/NopSCADlib/commit/d939401183d12af3452e17aa5b020dab50f8edb0 "show commit") [C.](# "Chris") Added `vero_grid_pos()` function.
|
||||
|
||||
* 2023-03-10 [`584542f`](https://github.com/nophead/NopSCADlib/commit/584542f87a27efe06ff3ba597dbaff1f3c32c4fd "show commit") [C.](# "Chris") Added fastons.
|
||||
|
||||
* 2023-03-10 [`62372a0`](https://github.com/nophead/NopSCADlib/commit/62372a049b9ac7a0fecebfd3618df91ff6ffa87a "show commit") [C.](# "Chris") The `wire()` module can now draw wires if a path is specified.
|
||||
|
||||
* 2023-03-10 [`14698e5`](https://github.com/nophead/NopSCADlib/commit/14698e5203e1e860230ddb3729816730e221f49c "show commit") [C.](# "Chris") Added PTFE heatshrink sleeving.
|
||||
|
||||
* 2023-03-10 [`14f6bb5`](https://github.com/nophead/NopSCADlib/commit/14f6bb533a3dcc1d36b2b764906cdca7d8d24484 "show commit") [C.](# "Chris") Added `sleeving_length` to `al_clad_resistor_assembly()`.
|
||||
|
||||
* 2023-03-10 [`01e9aae`](https://github.com/nophead/NopSCADlib/commit/01e9aae698f57bac6046d1a04aaa11b0c88006b5 "show commit") [C.](# "Chris") Added `TO220_size()` and `TO220_lead_pos(i,` l).
|
||||
|
||||
* 2023-02-04 [`27f9b24`](https://github.com/nophead/NopSCADlib/commit/27f9b242f250c0083344a05527055bb2fbb56f91 "show commit") [C.P.](# "Chris Palmer") Added crystal, transistors, diode and LEDs to Arduino Uno.
|
||||
|
||||
* 2023-02-03 [`f07fda7`](https://github.com/nophead/NopSCADlib/commit/f07fda70cdfc743cd2462636fcc1eb13a092f9e4 "show commit") [C.P.](# "Chris Palmer") Wire links can now be sleeved.
|
||||
|
||||
* 2023-02-01 [`abf1f1a`](https://github.com/nophead/NopSCADlib/commit/abf1f1ab3f3eddc2f274df649e8481a4117901eb "show commit") [C.P.](# "Chris Palmer") PCB blocks can now have rounded edges for more realistic cans.
|
||||
|
||||
* 2023-02-01 [`df06d1f`](https://github.com/nophead/NopSCADlib/commit/df06d1f57fff64cd6da20684f8371da204f69a82 "show commit") [C.P.](# "Chris Palmer") Updated changelog.
|
||||
|
||||
### [v20.23.0](https://github.com/nophead/NopSCADlib/releases/tag/v20.23.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v20.22.0...v20.23.0 "diff with v20.22.0")
|
||||
* 2023-02-01 [`470d6d6`](https://github.com/nophead/NopSCADlib/commit/470d6d6216b1cef8ce6cafd4b14300edb62eac4a "show commit") [C.P.](# "Chris Palmer") Started radial components with crystals.
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
## Requirements
|
||||
1. OpenSCAD 2021.01 or later, download it from here: https://www.openscad.org/downloads.html
|
||||
1. Python 2.7+ or 3.6+ from https://www.python.org/downloads/
|
||||
1. Python 3.6+ from https://www.python.org/downloads/
|
||||
1. ImageMagick 7 www.imagemagick.org
|
||||
|
||||
These are all cross platform tools so NopSCADlib should work on any platform that supports them, although it has currently only been tested on Win7.
|
||||
|
2
lib.scad
@@ -49,6 +49,7 @@ include <vitamins/magnets.scad>
|
||||
include <vitamins/mains_sockets.scad>
|
||||
include <vitamins/modules.scad>
|
||||
include <vitamins/panel_meters.scad>
|
||||
include <vitamins/photo_interrupters.scad>
|
||||
include <vitamins/pillars.scad>
|
||||
include <vitamins/pillow_blocks.scad>
|
||||
include <vitamins/pin_headers.scad>
|
||||
@@ -100,3 +101,4 @@ use <utils/round.scad>
|
||||
use <utils/offset.scad>
|
||||
use <utils/sector.scad>
|
||||
use <utils/thread.scad>
|
||||
use <vitamins/photo_interrupter.scad>
|
BIN
libtest.png
Before Width: | Height: | Size: 0 B After Width: | Height: | Size: 972 KiB |
16
libtest.scad
@@ -85,6 +85,7 @@ use <tests/o_ring.scad>
|
||||
use <tests/opengrab.scad>
|
||||
use <tests/panel_meters.scad>
|
||||
use <tests/PCBs.scad>
|
||||
use <tests/photo_interrupters.scad>
|
||||
use <tests/pillars.scad>
|
||||
use <tests/pillow_blocks.scad>
|
||||
use <tests/potentiometers.scad>
|
||||
@@ -224,7 +225,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;
|
||||
@@ -401,21 +402,21 @@ extrusions_y = panel_meters_y + 80;
|
||||
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();
|
||||
|
||||
@@ -428,6 +429,9 @@ translate([x3 + 60, modules_y])
|
||||
translate([x3 + 90, modules_y])
|
||||
modules();
|
||||
|
||||
translate([x3 + 150, modules_y])
|
||||
photo_interrupters();
|
||||
|
||||
translate([x3, ssrs_y]) {
|
||||
ssrs();
|
||||
|
||||
|
129
readme.md
@@ -42,12 +42,12 @@ A list of changes classified as breaking, additions or fixes is maintained in [C
|
||||
<tr><td> <a href = "#Extrusion_brackets">Extrusion_brackets</a> </td><td> <a href = "#PCBs">PCBs</a> </td><td> <a href = "#Terminals">Terminals</a> </td><td> <a href = "#PSU_shroud">PSU_shroud</a> </td><td> <a href = "#Sweep">Sweep</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Extrusions">Extrusions</a> </td><td> <a href = "#PSUs">PSUs</a> </td><td> <a href = "#Toggles">Toggles</a> </td><td> <a href = "#Pocket_handle">Pocket_handle</a> </td><td> <a href = "#Thread">Thread</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Fans">Fans</a> </td><td> <a href = "#Panel_meters">Panel_meters</a> </td><td> <a href = "#Transformers">Transformers</a> </td><td> <a href = "#Press_fit">Press_fit</a> </td><td> <a href = "#Tube">Tube</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Fastons">Fastons</a> </td><td> <a href = "#Pillars">Pillars</a> </td><td> <a href = "#Tubings">Tubings</a> </td><td> <a href = "#Printed_box">Printed_box</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#Pillow_blocks">Pillow_blocks</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td> <a href = "#Printed_pulleys">Printed_pulleys</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#Pin_headers">Pin_headers</a> </td><td> <a href = "#Veroboard">Veroboard</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Green_terminals">Green_terminals</a> </td><td> <a href = "#Potentiometers">Potentiometers</a> </td><td> <a href = "#Washers">Washers</a> </td><td> <a href = "#SSR_shroud">SSR_shroud</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Pulleys">Pulleys</a> </td><td> <a href = "#Wire">Wire</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Hygrometer">Hygrometer</a> </td><td></td><td> <a href = "#Zipties">Zipties</a> </td><td> <a href = "#Socket_box">Socket_box</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Fastons">Fastons</a> </td><td> <a href = "#Photo_interrupters">Photo_interrupters</a> </td><td> <a href = "#Tubings">Tubings</a> </td><td> <a href = "#Printed_box">Printed_box</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#Pillars">Pillars</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td> <a href = "#Printed_pulleys">Printed_pulleys</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#Pillow_blocks">Pillow_blocks</a> </td><td> <a href = "#Veroboard">Veroboard</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Green_terminals">Green_terminals</a> </td><td> <a href = "#Pin_headers">Pin_headers</a> </td><td> <a href = "#Washers">Washers</a> </td><td> <a href = "#SSR_shroud">SSR_shroud</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Potentiometers">Potentiometers</a> </td><td> <a href = "#Wire">Wire</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Hygrometer">Hygrometer</a> </td><td> <a href = "#Pulleys">Pulleys</a> </td><td> <a href = "#Zipties">Zipties</a> </td><td> <a href = "#Socket_box">Socket_box</a> </td><td></td><td></td></tr>
|
||||
<tr><td></td><td></td><td></td><td> <a href = "#Strap_handle">Strap_handle</a> </td><td></td><td></td></tr>
|
||||
</table>
|
||||
|
||||
@@ -711,6 +711,7 @@ PCB cameras.
|
||||
### Vitamins
|
||||
| Qty | Module call | BOM entry |
|
||||
| ---:|:--- |:---|
|
||||
| 1 | `camera(ESP32_CAM)` | ESP32-CAM Camera module |
|
||||
| 1 | `camera(rpi_camera_v1)` | Raspberry Pi camera V1 |
|
||||
| 1 | `camera(rpi_camera_v2)` | Raspberry Pi camera V2 |
|
||||
| 1 | `camera(rpi_camera)` | Raspberry Pi focusable camera |
|
||||
@@ -828,7 +829,7 @@ Various electronic components used in hot ends and heated beds.
|
||||
| `panel_USBA()` | Draw a panel mount USBA connector |
|
||||
| `panel_USBA_hole_positions()` | Place children at hole positions |
|
||||
| `panel_USBA_holes(h = 100)` | Make holes for USBA connector |
|
||||
| `resistor(type)` | Draw specified type of resitor |
|
||||
| `resistor(type)` | Draw specified type of resistor |
|
||||
| `sleeved_resistor(type, sleeving, bare = 5, heatshrink = false)` | Draw a resistor with sleeved leads and option heatshrink |
|
||||
| `thermal_cutout(type)` | Draw specified thermal cutout |
|
||||
| `thermal_cutout_hole_positions(type)` | Place children at hole positions |
|
||||
@@ -2526,12 +2527,20 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| 1 | `smd_led(LED0603, orange)` | SMD LED 0603 orange |
|
||||
| 1 | `smd_led(LED0805, red)` | SMD LED 0805 red |
|
||||
| 1 | `smd_led(LED1206, blue)` | SMD LED 1306 blue |
|
||||
| 1 | `smd_tant(TANT_A)` | SMD Tantalum capacitor package A ,1uF, 2.5V |
|
||||
| 1 | `smd_tant(TANT_B)` | SMD Tantalum capacitor package B ,10uF, 10V |
|
||||
| 1 | `smd_tant(TANT_C)` | SMD Tantalum capacitor package C ,100uF, 16V |
|
||||
| 1 | `smd_capacitor(CAP0402)` | SMD capacitor 0402 10nF |
|
||||
| 1 | `smd_capacitor(CAP0502)` | SMD capacitor 0502 10nF |
|
||||
| 1 | `smd_capacitor(CAP0603)` | SMD capacitor 0603 10nF |
|
||||
| 1 | `smd_capacitor(CAP0805)` | SMD capacitor 0805 100nF |
|
||||
| 1 | `smd_capacitor(CAP1206)` | SMD capacitor 1206 1uF |
|
||||
| 1 | `smd_resistor(RES0603, 1K)` | SMD resistor 0603 1K 0.1W |
|
||||
| 1 | `smd_coax(U_FL_R_SMT_1)` | SMD coax connector type: U_FL_R_SMT_1 |
|
||||
| 1 | `smd_resistor(RES0402, 1)` | SMD resistor 0402 1 0.0625W |
|
||||
| 1 | `smd_resistor(RES0502, 10)` | SMD resistor 0502 10 0.05W |
|
||||
| 1 | `smd_resistor(RES0603, 100)` | SMD resistor 0603 100 0.1W |
|
||||
| 1 | `smd_resistor(RES0805, 1K)` | SMD resistor 0805 1K 0.125W |
|
||||
| 1 | `smd_resistor(RES1206, 1K)` | SMD resistor 1206 1K 0.25W |
|
||||
| 1 | `smd_resistor(RES1206, 1M)` | SMD resistor 1206 1M 0.25W |
|
||||
| 1 | `smd_soic(SOIC14)` | SOIC14 package 74HC00 |
|
||||
| 1 | `smd_soic(SOIC16)` | SOIC16 package ICL323 |
|
||||
| 1 | `smd_soic(SOIC18)` | SOIC18 package PIC18F88 |
|
||||
@@ -2754,6 +2763,49 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| 4 | pcb_spacer4090.stl |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
<a name="Photo_interrupters"></a>
|
||||
## Photo_interrupters
|
||||
Photo interrupter modules popular in robot kits and from China.
|
||||
|
||||
[vitamins/photo_interrupters.scad](vitamins/photo_interrupters.scad) Object definitions.
|
||||
|
||||
[vitamins/photo_interrupter.scad](vitamins/photo_interrupter.scad) Implementation.
|
||||
|
||||
[tests/photo_interrupters.scad](tests/photo_interrupters.scad) Code for this example.
|
||||
|
||||
### Properties
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| `pi_base_height(type)` | Height of the base |
|
||||
| `pi_base_length(type)` | Length of the base |
|
||||
| `pi_base_width(type)` | Width of the base |
|
||||
| `pi_color(type)` | Color of photo interrupter |
|
||||
| `pi_gap_height(type)` | Height of the gap where the light can be interrupted |
|
||||
| `pi_gap_width(type)` | Width of the gap |
|
||||
| `pi_hole_diameter(type)` | Diameter of the mounting holes |
|
||||
| `pi_pcb(type)` | Parameter for the support PCB, created with pi_pcb |
|
||||
| `pi_stem_width(type)` | Width of the stems |
|
||||
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| `photo_interrupter(type)` | Draw the photo interrupter, with PCB |
|
||||
| `pi_cutout(type)` | Shape to subtract for fitting a photo interrupter |
|
||||
| `pi_hole_locations(type)` | Locations of photo interrupter mounting holes |
|
||||
| `pi_pcb(type)` | Draw the support PCB |
|
||||
| `pi_pcb_hole_locations(pcb)` | Locations of the PCB holes |
|
||||
|
||||

|
||||
|
||||
### Vitamins
|
||||
| Qty | Module call | BOM entry |
|
||||
| ---:|:--- |:---|
|
||||
| 1 | `photo_interrupter(PH1)` | PH1 Photo interrupter |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
@@ -3434,6 +3486,7 @@ For an explanation of `screw_polysink()` see <https://hydraraptor.blogspot.com/2
|
||||
| `screw_radius(type)` | Nominal radius |
|
||||
| `screw_socket_af(type)` | Socket across flats |
|
||||
| `screw_socket_depth(type)` | Socket or slot depth |
|
||||
| `screw_thread_diameter(type)` | Thread diameter, if different from nominal diamter |
|
||||
| `screw_washer(type)` | Default washer |
|
||||
|
||||
### Functions
|
||||
@@ -3476,12 +3529,14 @@ For an explanation of `screw_polysink()` see <https://hydraraptor.blogspot.com/2
|
||||
| 1 | `screw(M3_hex_screw, 10)` | Screw M3 hex x 10mm |
|
||||
| 1 | `screw(M3_low_cap_screw, 10)` | Screw M3 low cap x 10mm |
|
||||
| 1 | `screw(M3_pan_screw, 10)` | Screw M3 pan x 10mm |
|
||||
| 1 | `screw(M3_shoulder_screw, 12)` | Screw M3 shoulder x 12mm |
|
||||
| 1 | `screw(M4_cap_screw, 25)` | Screw M4 cap x 25mm |
|
||||
| 1 | `screw(M4_cs_cap_screw, 25)` | Screw M4 cs cap x 25mm |
|
||||
| 1 | `screw(M4_dome_screw, 25)` | Screw M4 dome x 25mm |
|
||||
| 1 | `screw(M4_grub_screw, 8)` | Screw M4 grub x 8mm |
|
||||
| 1 | `screw(M4_hex_screw, 30)` | Screw M4 hex x 30mm |
|
||||
| 1 | `screw(M4_pan_screw, 30)` | Screw M4 pan x 30mm |
|
||||
| 1 | `screw(M4_shoulder_screw, 16)` | Screw M4 shoulder x 16mm |
|
||||
| 1 | `screw(M5_cap_screw, 30)` | Screw M5 cap x 30mm |
|
||||
| 1 | `screw(M5_cs_cap_screw, 30)` | Screw M5 cs cap x 30mm |
|
||||
| 1 | `screw(M5_dome_screw, 30)` | Screw M5 dome x 30mm |
|
||||
@@ -3769,6 +3824,21 @@ SK shaft support brackets
|
||||
## SMDs
|
||||
Surface mount components for PCBs.
|
||||
|
||||
Note that the value string for tantalum capacitors is the the capacitance in pico farads expressed as two digits plus an exponent plus a single letter voltage code.
|
||||
E.g. 475A is 4.7uF 10V on the parts list.
|
||||
|
||||
| Code | Voltage |
|
||||
| ---- | ------- |
|
||||
| e | 2.5 |
|
||||
| G | 4 |
|
||||
| J | 6.3 |
|
||||
| A | 10 |
|
||||
| C | 16 |
|
||||
| D | 20 |
|
||||
| E | 25 |
|
||||
| V | 35 |
|
||||
| H | 50 |
|
||||
|
||||
[vitamins/smds.scad](vitamins/smds.scad) Object definitions.
|
||||
|
||||
[vitamins/smd.scad](vitamins/smd.scad) Implementation.
|
||||
@@ -3780,6 +3850,14 @@ Surface mount components for PCBs.
|
||||
|:--- |:--- |
|
||||
| `smd_cap_end_cap(type)` | End cap width |
|
||||
| `smd_cap_size(type)` | Body length, width |
|
||||
| `smd_coax_base_r(type)` | Corner radius of the base |
|
||||
| `smd_coax_base_size(type)` | Size of the insulating base |
|
||||
| `smd_coax_groove(type)` | Groove id, width and z |
|
||||
| `smd_coax_lug_size(type)` | lug size |
|
||||
| `smd_coax_pin_d(type)` | Central pin diameter |
|
||||
| `smd_coax_tube(type)` | OD, ID, height |
|
||||
| `smd_contact_size(type)` | contact size |
|
||||
| `smd_diode_colour(type)` | Body colour |
|
||||
| `smd_diode_lead_z(type)` | Top of lead frame from top |
|
||||
| `smd_diode_leads(type)` | Lead extent in x, width, thickness and gap |
|
||||
| `smd_diode_size(type)` | Body length, width and height |
|
||||
@@ -3812,6 +3890,11 @@ Surface mount components for PCBs.
|
||||
| `smd_sot_size(type)` | Body length, width and height |
|
||||
| `smd_sot_tab_width(type)` | The wide lead at the top |
|
||||
| `smd_sot_z(type)` | Height above PCB surface |
|
||||
| `smd_tant_colours(type)` | Colours of body and stripe |
|
||||
| `smd_tant_lead_z(type)` | Top of lead frame from top |
|
||||
| `smd_tant_leads(type)` | Lead extent in x, width, thickness and gap |
|
||||
| `smd_tant_size(type)` | Body length, width and height |
|
||||
| `smd_tant_z(type)` | Height above PCB surface |
|
||||
|
||||
### Functions
|
||||
| Function | Description |
|
||||
@@ -3824,6 +3907,7 @@ Surface mount components for PCBs.
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| `smd_capacitor(type, height, value = undef)` | Draw an SMD capacitor with specified height |
|
||||
| `smd_coax(type)` | Draw an SMD coaxial connector |
|
||||
| `smd_diode(type, value)` | Draw an SMD diode |
|
||||
| `smd_inductor(type, value)` | Draw an SMD inductor |
|
||||
| `smd_led(type, colour, cutout)` | Draw an SMD LED with specified `colour` |
|
||||
@@ -3831,6 +3915,7 @@ Surface mount components for PCBs.
|
||||
| `smd_resistor(type, value)` | Draw an SMD resistor with specified value |
|
||||
| `smd_soic(type, value)` | Draw an SMD SOIC |
|
||||
| `smd_sot(type, value)` | Draw an SMD transistor |
|
||||
| `smd_tant(type, value)` | Draw an SMD tantalum capacitor |
|
||||
|
||||

|
||||
|
||||
@@ -3842,10 +3927,18 @@ Surface mount components for PCBs.
|
||||
| 1 | `smd_led(LED0603, green)` | SMD LED 0603 green |
|
||||
| 1 | `smd_led(LED0805, blue)` | SMD LED 0805 blue |
|
||||
| 1 | `smd_led(LED1206, red)` | SMD LED 1306 red |
|
||||
| 1 | `smd_tant(TANT_A)` | SMD Tantalum capacitor package A ,1uF, 2.5V |
|
||||
| 1 | `smd_tant(TANT_B)` | SMD Tantalum capacitor package B ,10uF, 6.3V |
|
||||
| 1 | `smd_tant(TANT_C)` | SMD Tantalum capacitor package C ,100uF, 10V |
|
||||
| 1 | `smd_capacitor(CAP0402)` | SMD capacitor 0402 |
|
||||
| 1 | `smd_capacitor(CAP0502)` | SMD capacitor 0502 |
|
||||
| 1 | `smd_capacitor(CAP0603)` | SMD capacitor 0603 |
|
||||
| 1 | `smd_capacitor(CAP0805)` | SMD capacitor 0805 |
|
||||
| 1 | `smd_capacitor(CAP1206)` | SMD capacitor 1206 |
|
||||
| 1 | `smd_resistor(RES0603, 1R0)` | SMD resistor 0603 1R0 0.1W |
|
||||
| 1 | `smd_coax(U_FL_R_SMT_1)` | SMD coax connector type: U_FL_R_SMT_1 |
|
||||
| 1 | `smd_resistor(RES0402, 1R0)` | SMD resistor 0402 1R0 0.0625W |
|
||||
| 1 | `smd_resistor(RES0502, 10)` | SMD resistor 0502 10 0.05W |
|
||||
| 1 | `smd_resistor(RES0603, 100)` | SMD resistor 0603 100 0.1W |
|
||||
| 1 | `smd_resistor(RES0805, 10M)` | SMD resistor 0805 10M 0.125W |
|
||||
| 1 | `smd_resistor(RES1206, 100K)` | SMD resistor 1206 100K 0.25W |
|
||||
| 1 | `smd_soic(SOIC14)` | SOIC14 package SOIC14 |
|
||||
@@ -4441,7 +4534,9 @@ Veroboard with mounting holes, track breaks, removed tracks, solder points and c
|
||||
| `vero_mounting_hole_positions(type)` | Positions children at the mounting holes |
|
||||
| `vero_mounting_holes(type, h = 100)` | Drill mounting holes in a panel |
|
||||
| `veroboard(type)` | Draw specified veroboard with missing tracks and track breaks |
|
||||
| `veroboard_assembly(type, height, thickness, flip = false, ngb = false)` | Draw the assembly with components and fasteners in place |
|
||||
| `veroboard_assembly(type, ngb = false)` | Draw the assembly with components |
|
||||
| `veroboard_fastened_assembly(type, height, thickness, flip = false, ngb = false)` | Draw the assembly with components and fasteners in place |
|
||||
| `veroboard_fasteners(type, height, thickness, flip = false)` | Draw the fasteners in place |
|
||||
|
||||

|
||||
|
||||
@@ -4449,16 +4544,16 @@ Veroboard with mounting holes, track breaks, removed tracks, solder points and c
|
||||
| Qty | Module call | BOM entry |
|
||||
| ---:|:--- |:---|
|
||||
| 2 | `idc_transition(2p54header, 10)` | IDC transition header 10 x 2 |
|
||||
| 4 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc |
|
||||
| 4 | `screw(M3_dome_screw, 25)` | Screw M3 dome x 25mm |
|
||||
| 2 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc |
|
||||
| 2 | `screw(M3_dome_screw, 25)` | Screw M3 dome x 25mm |
|
||||
| 2 | `green_terminal(gt_2p54, 10)` | Terminal block 10 way 0.1" |
|
||||
| 2 | `veroboard(z_vb)` | Veroboard 5 holes x 22 strips |
|
||||
| 8 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
|
||||
| 4 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
|
||||
|
||||
### Printed
|
||||
| Qty | Filename |
|
||||
| ---:|:--- |
|
||||
| 4 | pcb_spacer30120.stl |
|
||||
| 2 | pcb_spacer30120.stl |
|
||||
|
||||
### Assemblies
|
||||
| Qty | Name |
|
||||
@@ -6705,7 +6800,6 @@ Maths utilities for manipulating vectors and matrices.
|
||||
| `argcoth(x)` | inverse hyperbolic cotangent |
|
||||
| `argsinh(x)` | inverse hyperbolic sine |
|
||||
| `argtanh(x)` | inverse hyperbolic tangent |
|
||||
| `augment(m)` | Augment a matrix by adding an identity matrix to the right |
|
||||
| `circle_intersect(c1, r1, c2, r2)` | Calculate one point where two circles in the X-Z plane intersect, clockwise around c1 |
|
||||
| `cosh(x)` | hyperbolic cosine |
|
||||
| `coth(x)` | hyperbolic cotangent |
|
||||
@@ -6725,11 +6819,8 @@ Maths utilities for manipulating vectors and matrices.
|
||||
| `rot2_z(a)` | Generate a 2x2 matrix to rotate around z |
|
||||
| `rot3_z(a)` | Generate a 3x3 matrix to rotate around z |
|
||||
| `rotate(a, v)` | Generate a 4x4 rotation matrix, `a` can be a vector of three angles or a single angle around `z`, or around axis `v` |
|
||||
| `rowswap(m, i, j)` | Swap two rows of a matrix |
|
||||
| `scale(v)` | Generate a 4x4 matrix that scales by `v`, which can be a vector of xyz factors or a scalar to scale all axes equally |
|
||||
| `sinh(x)` | hyperbolic sine |
|
||||
| `solve(m, i = 0, j = 0)` | Solve each row ensuring diagonal is not zero |
|
||||
| `solve_row(m, i)` | Make diagonal one by dividing the row by it and subtract from other rows to make column zero |
|
||||
| `sqr(x)` | Square x |
|
||||
| `sumv(v)` | sum a vector of values that can be added with "+" |
|
||||
| `tanh(x)` | hyperbolic tangent |
|
||||
|
@@ -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:
|
||||
|
@@ -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('[[')
|
||||
|
@@ -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,19 +62,28 @@ 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"],
|
||||
[ 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",DO241AC, "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"],
|
||||
|
||||
[ 45, 35, 0, "2p54header", 4, 1],
|
||||
[ 60, 35, 0, "2p54header", 5, 1, false, "blue" ],
|
||||
|
@@ -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"][$i % 5]);
|
||||
|
||||
translate([0, 3])
|
||||
layout([for(l = smd_leds) smd_led_size(l).x], 1)
|
||||
@@ -35,27 +35,37 @@ 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");
|
||||
}
|
||||
|
@@ -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();
|
||||
|
28
tests/photo_interrupters.scad
Normal file
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2023
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// This file is part of NopSCADlib.
|
||||
//
|
||||
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
|
||||
// GNU General Public License as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
include <../utils/core/core.scad>
|
||||
include <../vitamins/photo_interrupters.scad>
|
||||
|
||||
use <../utils/layout.scad>
|
||||
|
||||
module photo_interrupters()
|
||||
layout([for(l = photo_interrupters) pi_base_length(l)], 5, true)
|
||||
photo_interrupter(photo_interrupters[$i]);
|
||||
|
||||
photo_interrupters();
|
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: 185 KiB After Width: | Height: | Size: 190 KiB |
BIN
tests/png/photo_interrupters.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: 185 KiB |
Before Width: | Height: | Size: 150 KiB After Width: | Height: | Size: 171 KiB |
@@ -56,7 +56,7 @@ module screws() {
|
||||
screw(screw, length);
|
||||
}
|
||||
}
|
||||
translate([20, 40, -15])
|
||||
translate([20, 60, -15])
|
||||
polysink_stl();
|
||||
}
|
||||
|
||||
|
@@ -36,11 +36,11 @@ z_vb = ["z_vb", "z_bed_terminal", 5, z_cable_ways / 2 + 12, inch(0.1), false, M3
|
||||
|
||||
module veroboard_test() translate([vero_length(z_vb) / 2, vero_width(z_vb) / 2]) {
|
||||
vflip()
|
||||
veroboard_assembly(z_vb, 12, 3);
|
||||
veroboard_assembly(z_vb);
|
||||
|
||||
translate([30, 0])
|
||||
rotate(180)
|
||||
veroboard_assembly(z_vb, 12, 3);
|
||||
veroboard_fastened_assembly(z_vb, 12, 3);
|
||||
}
|
||||
|
||||
if($preview)
|
||||
|
@@ -118,24 +118,24 @@ module position_children(list, t) //! Position children if they are on the Z = 0
|
||||
|
||||
// Matrix inversion: https://www.mathsisfun.com/algebra/matrix-inverse-row-operations-gauss-jordan.html
|
||||
|
||||
function augment(m) = let(l = len(m), n = identity(l)) [ //! Augment a matrix by adding an identity matrix to the right
|
||||
function augment(m) = let(l = len(m), n = identity(l)) [ // Augment a matrix by adding an identity matrix to the right
|
||||
for(i = [0 : l - 1])
|
||||
concat(m[i], n[i])
|
||||
];
|
||||
|
||||
function rowswap(m, i, j) = [ //! Swap two rows of a matrix
|
||||
function rowswap(m, i, j) = [ // Swap two rows of a matrix
|
||||
for(k = [0 : len(m) - 1])
|
||||
k == i ? m[j] : k == j ? m[i] : m[k]
|
||||
];
|
||||
|
||||
function solve_row(m, i) = let(diag = m[i][i]) [ //! Make diagonal one by dividing the row by it and subtract from other rows to make column zero
|
||||
function solve_row(m, i) = let(diag = m[i][i]) [ // Make diagonal one by dividing the row by it and subtract from other rows to make column zero
|
||||
for(j = [0 : len(m) - 1])
|
||||
i == j ? m[j] / diag : m[j] - m[i] * m[j][i] / diag
|
||||
];
|
||||
|
||||
function nearly_zero(x) = abs(x) < 1e-5; //! True if x is close to zero
|
||||
|
||||
function solve(m, i = 0, j = 0) = //! Solve each row ensuring diagonal is not zero
|
||||
function solve(m, i = 0, j = 0) = // Solve each row ensuring diagonal is not zero
|
||||
i < len(m) ?
|
||||
assert(i + j < len(m), "matrix is singular")
|
||||
solve(!nearly_zero(m[i + j][i]) ? solve_row(j ? rowswap(m, i, i + j) : m, i) : solve(m, i, j + 1), i + 1)
|
||||
|
@@ -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>
|
||||
|
@@ -41,7 +41,7 @@ function resistor_sleeved(type) = type[9]; //! Are the leads sleeved
|
||||
|
||||
splay_angle = 2; // radial lead splay angle
|
||||
|
||||
module resistor(type) { //! Draw specified type of resitor
|
||||
module resistor(type) { //! Draw specified type of resistor
|
||||
length = resistor_length(type);
|
||||
dia = resistor_diameter(type);
|
||||
|
||||
|
@@ -1146,11 +1146,13 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
|
||||
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, "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");
|
||||
|
103
vitamins/photo_interrupter.scad
Normal file
@@ -0,0 +1,103 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2023
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// This file is part of NopSCADlib.
|
||||
//
|
||||
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
|
||||
// GNU General Public License as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
//
|
||||
//! Photo interrupter modules popular in robot kits and from China.
|
||||
//
|
||||
include <../utils/core/core.scad>
|
||||
include <../utils/rounded_polygon.scad>
|
||||
|
||||
function pi_base_width(type) = type[1]; //! Width of the base
|
||||
function pi_base_length(type) = type[2]; //! Length of the base
|
||||
function pi_base_height(type) = type[3]; //! Height of the base
|
||||
function pi_gap_height(type) = type[4]; //! Height of the gap where the light can be interrupted
|
||||
function pi_gap_width(type) = type[6]; //! Width of the gap
|
||||
function pi_stem_width(type) = type[5]; //! Width of the stems
|
||||
function pi_hole_diameter(type) = type[7]; //! Diameter of the mounting holes
|
||||
function pi_color(type) = type[8]; //! Color of photo interrupter
|
||||
function pi_pcb(type) = type[9]; //! Parameter for the support PCB, created with pi_pcb
|
||||
|
||||
module pi_hole_locations(type) { //! Locations of photo interrupter mounting holes
|
||||
translate([0, -(pi_base_length(type) - pi_base_width(type)) / 2, 0])
|
||||
children();
|
||||
translate([0, (pi_base_length(type) - pi_base_width(type)) / 2, 0])
|
||||
children();
|
||||
}
|
||||
|
||||
module pi_pcb_hole_locations(pcb) { //! Locations of the PCB holes
|
||||
for (xy = pcb[7]) {
|
||||
translate([xy[0], xy[1], 0])
|
||||
children();
|
||||
}
|
||||
}
|
||||
|
||||
module pi_pcb(type) { //! Draw the support PCB
|
||||
pcb = pi_pcb(type);
|
||||
color(pcb[6]) {
|
||||
translate([0, 0, -pcb[2]]) {
|
||||
linear_extrude(pcb[2]) {
|
||||
difference() {
|
||||
rounded_polygon([[0, -(pi_base_length(type) - pi_base_width(type)) / 2, -pi_base_width(type) / 2],
|
||||
[pi_base_width(type) / 2, -pcb[1]/2, eps],
|
||||
[pcb[0]+1, -pcb[1]/2, eps],
|
||||
[pcb[0]+1, pcb[1]/2, eps],
|
||||
[pi_base_width(type) / 2, pcb[1]/2, eps],
|
||||
[0, (pi_base_length(type) - pi_base_width(type)) / 2, -pi_base_width(type) / 2]
|
||||
]);
|
||||
pi_pcb_hole_locations(pcb)
|
||||
circle(d = pcb[8]);
|
||||
pi_hole_locations(type)
|
||||
circle(d=pi_hole_diameter(type));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module photo_interrupter(type) { //! Draw the photo interrupter, with PCB
|
||||
vitamin(str("photo_interrupter(", type[0], "): ", type[0], " Photo interrupter"));
|
||||
color(pi_color(type)) {
|
||||
linear_extrude(pi_base_height(type)) {
|
||||
difference() {
|
||||
hull() {
|
||||
pi_hole_locations(type)
|
||||
circle(d = pi_base_width(type));
|
||||
}
|
||||
pi_hole_locations(type)
|
||||
circle(d = pi_hole_diameter(type));
|
||||
}
|
||||
}
|
||||
translate([-pi_base_width(type)/2, -(pi_gap_width(type)/2 + pi_stem_width(type)), 0])
|
||||
cube([pi_base_width(type), pi_stem_width(type), pi_gap_height(type) + pi_base_height(type)]);
|
||||
translate([-pi_base_width(type)/2, pi_gap_width(type)/2, 0])
|
||||
cube([pi_base_width(type), pi_stem_width(type), pi_gap_height(type) + pi_base_height(type)]);
|
||||
}
|
||||
pi_pcb(type);
|
||||
}
|
||||
|
||||
module pi_cutout(type) { //! Shape to subtract for fitting a photo interrupter
|
||||
hull() {
|
||||
pi_hole_locations(type)
|
||||
cylinder(h = pi_base_height(type), d = pi_base_width(type));
|
||||
}
|
||||
translate([-pi_base_width(type)/2, -(pi_gap_width(type)/2 + pi_stem_width(type)), 0])
|
||||
cube([pi_base_width(type), pi_stem_width(type), pi_gap_height(type) + pi_base_height(type)]);
|
||||
translate([-pi_base_width(type)/2, pi_gap_width(type)/2, 0])
|
||||
cube([pi_base_width(type), pi_stem_width(type), pi_gap_height(type) + pi_base_height(type)]);
|
||||
};
|
23
vitamins/photo_interrupters.scad
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2023
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// This file is part of NopSCADlib.
|
||||
//
|
||||
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
|
||||
// GNU General Public License as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
PH1 = ["PH1", 6.4, 25.9 , 3.5, 8.6, 4.1, 5.9, 3, grey(20), [22, 20, 1.6, true, 11-3.2, 0, "blue",[[8.3, -7.5], [8.3, 7.5]], 3]];
|
||||
|
||||
photo_interrupters = [PH1];
|
||||
|
||||
use <photo_interrupter.scad>
|
@@ -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 diamter
|
||||
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>
|
||||
|
||||
@@ -234,6 +249,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 +264,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 +303,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 +516,65 @@ 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]);
|
||||
}
|
||||
}
|
||||
|
@@ -27,34 +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];
|
||||
|
||||
smd_resistors = [RES0603, RES0805, RES1206];
|
||||
smd_resistors = [RES0402, RES0502, RES0603, RES0805, RES1206];
|
||||
|
||||
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]];
|
||||
DO241AC = ["DO241AC", [4.0, 2.5, 2.0], 0.1, 1, [4.8, 1.2, 0.15, 2], grey(20)];
|
||||
|
||||
smd_diodes = [DO241AC];
|
||||
|
||||
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)];
|
||||
|
||||
smd_inductors = [IND2525];
|
||||
@@ -63,4 +73,9 @@ 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];
|
||||
|
||||
use <smd.scad>
|
||||
|
@@ -148,23 +148,25 @@ module vero_components(type, cutouts = false, angle = undef)
|
||||
module vero_cutouts(type, angle = undef) //! Make cutouts to clear components
|
||||
vero_components(type, true, angle);
|
||||
|
||||
module veroboard_assembly(type, height, thickness, flip = false, ngb = false) //! Draw the assembly with components and fasteners in place
|
||||
module veroboard_assembly(type, ngb = false) //! Draw the assembly with components
|
||||
pose_vflip(exploded = true)
|
||||
assembly(vero_assembly(type), ngb = ngb) {
|
||||
veroboard(type);
|
||||
|
||||
vero_components(type);
|
||||
|
||||
for(r = vero_joints(type))
|
||||
for(x = r.x, y = r.y)
|
||||
vero_grid_pos(type, x, y)
|
||||
vflip()
|
||||
solder_meniscus(type);
|
||||
}
|
||||
|
||||
module veroboard_fasteners(type, height, thickness, flip = false) { //! Draw the fasteners in place
|
||||
screw = vero_screw(type);
|
||||
nut = screw_nut(screw);
|
||||
screw_length = screw_length(screw, height + thickness + vero_thickness(type), 2, nyloc = true);
|
||||
|
||||
translate_z(height) {
|
||||
veroboard(type);
|
||||
|
||||
vero_components(type);
|
||||
|
||||
for(r = vero_joints(type))
|
||||
for(x = r.x, y = r.y)
|
||||
vero_grid_pos(type, x, y)
|
||||
vflip()
|
||||
solder_meniscus(type);
|
||||
}
|
||||
vero_mounting_hole_positions(type) {
|
||||
translate_z(height + vero_thickness(type))
|
||||
if(flip)
|
||||
@@ -182,3 +184,11 @@ assembly(vero_assembly(type), ngb = ngb) {
|
||||
nut_and_washer(nut, true);
|
||||
}
|
||||
}
|
||||
|
||||
module veroboard_fastened_assembly(type, height, thickness, flip = false, ngb = false) { //! Draw the assembly with components and fasteners in place
|
||||
|
||||
translate_z(height)
|
||||
veroboard_assembly(type, ngb = ngb);
|
||||
|
||||
veroboard_fasteners(type, height, thickness, flip);
|
||||
}
|
||||
|