1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-09-04 20:56:07 +02:00

Compare commits

...

11 Commits

Author SHA1 Message Date
Chris
5899ffe88f More typos in comments. 2023-06-29 10:43:15 +01:00
Chris
b05131145c Comment typo. 2023-06-28 23:04:15 +01:00
Chris Palmer
5da0f97485 Updated changelog. 2023-05-08 20:19:50 +01:00
Chris Palmer
c3f3d629b1 Added PanelDue V3. 2023-05-08 20:14:18 +01:00
Chris Palmer
c7ba052ccf Added SMD QFP package. 2023-05-08 20:13:53 +01:00
Chris Palmer
c2c5f50986 Can now used smd_res() to draw chokes. 2023-05-08 20:07:18 +01:00
Chris Palmer
d0ae8ca216 Added the ability to have more than one grid on a PCB. 2023-05-08 19:56:53 +01:00
Chris Palmer
e81dcfdbd8 Added right angle option to box headers. 2023-05-08 19:52:51 +01:00
Chris Palmer
06a286dc98 Fixed missing BOM entry for JST connectors.
Fixed default colour for JST connectors.
Corrected BOM entry to show right angle options on Molex and pin headers.
2023-05-08 19:51:29 +01:00
Chris Palmer
f5496c373a Fixed typo in smd_diode(DO214AC) package name. 2023-05-08 19:42:05 +01:00
Chris Palmer
1c6d3d8e95 Updated changelog. 2023-05-01 12:22:10 +01:00
23 changed files with 338 additions and 90 deletions

View File

@@ -3,6 +3,29 @@
This changelog is generated by `changelog.py` using manually added semantic version tags to classify commits as breaking changes, additions or fixes.
### [v21.5.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.5.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.4.1...v21.5.0 "diff with v21.4.1")
* 2023-05-08 [`c3f3d62`](https://github.com/nophead/NopSCADlib/commit/c3f3d629b1ff79d40cc5ad3efcb33e940d6c8056 "show commit") [C.P.](# "Chris Palmer") Added PanelDue V3.
* 2023-05-08 [`c7ba052`](https://github.com/nophead/NopSCADlib/commit/c7ba052ccf24d764aa6460d4559e92596c9e4cf4 "show commit") [C.P.](# "Chris Palmer") Added SMD QFP package.
* 2023-05-08 [`c2c5f50`](https://github.com/nophead/NopSCADlib/commit/c2c5f509860b909ca8fca5ffcc65dbef2f7177c5 "show commit") [C.P.](# "Chris Palmer") Can now used `smd_res()` to draw chokes.
* 2023-05-08 [`d0ae8ca`](https://github.com/nophead/NopSCADlib/commit/d0ae8ca216108f53c9b8e60896ea9b59b845b7e0 "show commit") [C.P.](# "Chris Palmer") Added the ability to have more than one grid on a PCB.
* 2023-05-08 [`e81dcfd`](https://github.com/nophead/NopSCADlib/commit/e81dcfdbd8163ce8e2db450f3a20c296c21327a8 "show commit") [C.P.](# "Chris Palmer") Added right angle option to box headers.
#### [v21.4.1](https://github.com/nophead/NopSCADlib/releases/tag/v21.4.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v21.4.0...v21.4.1 "diff with v21.4.0")
* 2023-05-08 [`06a286d`](https://github.com/nophead/NopSCADlib/commit/06a286dc989e9cc8cf7918049cd16a862b1a9b94 "show commit") [C.P.](# "Chris Palmer") Fixed missing BOM entry for JST connectors.
Fixed default colour for JST connectors.
Corrected BOM entry to show right angle options on Molex and pin headers.
* 2023-05-08 [`f5496c3`](https://github.com/nophead/NopSCADlib/commit/f5496c373a1ab8ae47d07cc0a52d76e4299876cc "show commit") [C.P.](# "Chris Palmer") Fixed typo in `smd_diode(DO214AC)` package name.
### [v21.4.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.4.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.3.1...v21.4.0 "diff with v21.3.1")
* 2023-05-01 [`5e24a32`](https://github.com/nophead/NopSCADlib/commit/5e24a32a0b422e8032c3c5d377c1a756ff6f1022 "show commit") [C.P.](# "Chris Palmer") Added ESP32 camera.
* 2023-05-01 [`fbd8d8c`](https://github.com/nophead/NopSCADlib/commit/fbd8d8c7cdff0bd7de0d42aa74bf0ab6551c205b "show commit") [C.P.](# "Chris Palmer") Added `smd_coax`
#### [v21.3.1](https://github.com/nophead/NopSCADlib/releases/tag/v21.3.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v21.3.0...v21.3.1 "diff with v21.3.0")
* 2023-04-29 [`b1592f5`](https://github.com/nophead/NopSCADlib/commit/b1592f51d4b16a125d9b28edae56f758fcac2f02 "show commit") [C.P.](# "Chris Palmer") Fixed `bom.py,` `views.py` and `tests.py` so that vitamin descriptions can contain more than one colon.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 972 KiB

After

Width:  |  Height:  |  Size: 977 KiB

View File

@@ -2441,7 +2441,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| `pcb_component(type, name, index = 0)` | Return the component specified by name and index |
| `pcb_component_position(type, name, index = 0)` | Return x y position of specified component |
| `pcb_coord(type, p)` | Convert offsets from the edge to coordinates relative to the centre |
| `pcb_grid_pos(type, x, y, z = 0)` | Returns a pcb grid position |
| `pcb_grid_pos(type, x, y, z = 0, i = 0)` | Returns a pcb grid position |
| `pcb_screw(type, cap = hs_cap)` | Mounting screw type |
| `pcb_size(type)` | Length, width and thickness in a vector |
@@ -2467,7 +2467,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| `pcb_component_position(type, name)` | Position child at the specified component position |
| `pcb_components(type, cutouts = false, angle = undef)` | Draw list of PCB components on the PCB |
| `pcb_cutouts(type, angle = undef)` | Make cut outs to clear components on a PCB |
| `pcb_grid(type, x, y, z = 0)` | Positions children at specified grid position |
| `pcb_grid(type, x, y, z = 0, i = 0)` | Positions children at specified grid position |
| `pcb_grid_components(type, components, cutouts = false, angle = undef)` | Draw list of components on the PCB grid for perf board |
| `pcb_screw_positions(type)` | Positions children at the mounting hole positions |
| `pcb_spacer(screw, height, wall = 1.8, taper = 0)` | Generate STL for PCB spacer |
@@ -2492,6 +2492,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| ---:|:--- |:---|
| 1 | `potentiometer(BTT_encoder)` | BTT_encoder |
| 1 | `box_header(2p54header, 4, 2)` | Box header 4 x 2 |
| 1 | `box_header(2p54header, 4, 2, right_angle = true)` | Box header 4 x 2 right angle |
| 1 | `rd_xtal(ACT1100, "40MHz")` | Crystal ACT1100 40MHz |
| 1 | `rd_xtal(ACT1700, "80MHz")` | Crystal ACT1700 80MHz |
| 1 | `rd_xtal(C_002RX, "60KHz")` | Crystal C_002RX 60KHz |
@@ -2499,12 +2500,15 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `rd_xtal(HC49_4H, "10MHz")` | Crystal HC49_4H 10MHz |
| 1 | `d_plug(DCONN9, pcb = true)` | D-type 9 way PCB mount plug |
| 1 | `dil_socket(12, 15.24)` | DIL socket 24 x 0.6" |
| 1 | `smd_diode(DO241AC)` | DO241AC package SS34 |
| 1 | `smd_diode(DO214AC)` | DO214AC package SS34 |
| 1 | `hdmi(hdmi_full)` | HDMI socket |
| 1 | `pdip(24, 27C32, w = 15.24)` | IC 27C32 PDIP24 |
| 1 | `pdip(8, NE555)` | IC NE555 PDIP8 |
| 1 | `idc_transition(2p54header, 5)` | IDC transition header 5 x 2 |
| 1 | `smd_inductor(IND2525)` | IND2525 package 4R7 |
| 1 | `jst_xh_header(jst_ph_header, 2)` | JST PH connector 2 way |
| 1 | `jst_xh_header(jst_xh_header, 2)` | JST XH connector 2 way |
| 1 | `jst_xh_header(jst_zh_header, 2)` | JST ZH connector 2 way |
| 1 | `potentiometer(KY_040_encoder)` | KY_040_encoder |
| 1 | `led(LED10mm, "yellow")` | LED 10 mm yellow |
| 1 | `led(LED3mm)` | LED 3 mm red |
@@ -2513,8 +2517,11 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `microswitch(small_microswitch)` | Microswitch DM1-00P-110-3 |
| 1 | `hdmi(hdmi_mini)` | Mini HDMI socket |
| 1 | `molex_254(2)` | Molex KK header 2 way |
| 1 | `molex_254(2, right_angle = 1)` | Molex KK header 2 way right angle |
| 1 | `molex_254(2, right_angle = -1)` | Molex KK header 2 way right angle |
| 1 | `pin_header(2p54header, 4, 1)` | Pin header 4 x 1 |
| 1 | `pin_header(2p54header, 5, 1)` | Pin header 5 x 1 |
| 1 | `pin_header(2p54header, 5, 1, right_angle = true)` | Pin header 5 x 1 right_angle |
| 1 | `pin_socket(2p54header, 4, 1)` | Pin socket 4 x 1 |
| 1 | `pin_socket(2p54header, 6, 1)` | Pin socket 6 x 1 |
| 2 | `pin_socket(2p54header, 8, 1)` | Pin socket 8 x 1 |
@@ -2535,6 +2542,8 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `smd_capacitor(CAP0603)` | SMD capacitor 0603 10nF |
| 1 | `smd_capacitor(CAP0805)` | SMD capacitor 0805 100nF |
| 1 | `smd_capacitor(CAP1206)` | SMD capacitor 1206 1uF |
| 1 | `smd_qfp(QFP50P1200X1200X160_64N)` | SMD chip: ATSAM4S4BA, package : QFP50P1200X1200X160_64N |
| 1 | `smd_resistor(L2012C, 1u)` | SMD choke 0805 1u |
| 1 | `smd_coax(U_FL_R_SMT_1)` | SMD coax connector type: U_FL_R_SMT_1 |
| 1 | `smd_resistor(RES0402, 1)` | SMD resistor 0402 1 0.0625W |
| 1 | `smd_resistor(RES0502, 10)` | SMD resistor 0502 10 0.05W |
@@ -2616,7 +2625,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| `pcb_component(type, name, index = 0)` | Return the component specified by name and index |
| `pcb_component_position(type, name, index = 0)` | Return x y position of specified component |
| `pcb_coord(type, p)` | Convert offsets from the edge to coordinates relative to the centre |
| `pcb_grid_pos(type, x, y, z = 0)` | Returns a pcb grid position |
| `pcb_grid_pos(type, x, y, z = 0, i = 0)` | Returns a pcb grid position |
| `pcb_screw(type, cap = hs_cap)` | Mounting screw type |
| `pcb_size(type)` | Length, width and thickness in a vector |
@@ -2642,7 +2651,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| `pcb_component_position(type, name)` | Position child at the specified component position |
| `pcb_components(type, cutouts = false, angle = undef)` | Draw list of PCB components on the PCB |
| `pcb_cutouts(type, angle = undef)` | Make cut outs to clear components on a PCB |
| `pcb_grid(type, x, y, z = 0)` | Positions children at specified grid position |
| `pcb_grid(type, x, y, z = 0, i = 0)` | Positions children at specified grid position |
| `pcb_grid_components(type, components, cutouts = false, angle = undef)` | Draw list of components on the PCB grid for perf board |
| `pcb_screw_positions(type)` | Positions children at the mounting hole positions |
| `pcb_spacer(screw, height, wall = 1.8, taper = 0)` | Generate STL for PCB spacer |
@@ -2694,11 +2703,12 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `molex_254(3)` | Molex KK header 3 way - not shown |
| 20 | `nut(M2_nut, nyloc = true)` | Nut M2 x 1.6mm nyloc |
| 34 | `nut(M2p5_nut, nyloc = true)` | Nut M2.5 x 2.2mm nyloc |
| 40 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc |
| 43 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc |
| 8 | `nut(M4_nut, nyloc = true)` | Nut M4 x 3.2mm nyloc |
| 1 | `pcb(OPZ2)` | Orange Pi Zero 2 |
| 1 | `pcb(PI_IO)` | PI_IO V2 - not shown |
| 1 | `pcb(PSU12V1A)` | PSU 12V 1A - not shown |
| 1 | `pcb(PanelDue_v3)` | Panel Due v3.0a LCD Display interface |
| 1 | `pcb(PERF60x40)` | Perfboard 60 x 40mm |
| 1 | `pcb(PERF70x30)` | Perfboard 70 x 30mm |
| 1 | `pcb(PERF70x50)` | Perfboard 70 x 50mm |
@@ -2716,12 +2726,13 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 12 | `screw(M2_cap_screw, 20)` | Screw M2 cap x 20mm |
| 2 | `screw(M2p5_cap_screw, 16)` | Screw M2.5 cap x 16mm |
| 8 | `screw(M2p5_cap_screw, 25)` | Screw M2.5 cap x 25mm |
| 12 | `screw(M2p5_cap_screw, 30)` | Screw M2.5 cap x 30mm |
| 8 | `screw(M2p5_cap_screw, 30)` | Screw M2.5 cap x 30mm |
| 4 | `screw(M2p5_cap_screw, 35)` | Screw M2.5 cap x 35mm |
| 4 | `screw(M2p5_pan_screw, 20)` | Screw M2.5 pan x 20mm |
| 8 | `screw(M2p5_pan_screw, 25)` | Screw M2.5 pan x 25mm |
| 17 | `screw(M3_cap_screw, 16)` | Screw M3 cap x 16mm |
| 15 | `screw(M3_cap_screw, 20)` | Screw M3 cap x 20mm |
| 8 | `screw(M3_cap_screw, 30)` | Screw M3 cap x 30mm |
| 11 | `screw(M3_cap_screw, 30)` | Screw M3 cap x 30mm |
| 4 | `screw(M4_cap_screw, 20)` | Screw M4 cap x 20mm |
| 4 | `screw(M4_cap_screw, 25)` | Screw M4 cap x 25mm |
| 1 | `pcb(XIAO)` | Seeeduino XIAO |
@@ -2732,7 +2743,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `pcb(WD2002SJ)` | WD2002SJ Buck Boost DC-DC converter |
| 20 | `washer(M2_washer)` | Washer M2 x 5mm x 0.3mm |
| 34 | `washer(M2p5_washer)` | Washer M2.5 x 5.9mm x 0.5mm |
| 40 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
| 43 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
| 8 | `washer(M4_washer)` | Washer M4 x 9mm x 0.8mm |
| 1 | `pcb(ZC_A0591)` | ZC-A0591 ULN2003 driver PCB |
@@ -2748,13 +2759,14 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 4 | pcb_spacer25140.stl |
| 4 | pcb_spacer25150_2.stl |
| 4 | pcb_spacer25160_2.stl |
| 4 | pcb_spacer25190.stl |
| 4 | pcb_spacer25200.stl |
| 4 | pcb_spacer25210.stl |
| 4 | pcb_spacer25220.stl |
| 2 | pcb_spacer2550.stl |
| 4 | pcb_spacer2590.stl |
| 4 | pcb_spacer30170.stl |
| 4 | pcb_spacer30180.stl |
| 3 | pcb_spacer30190.stl |
| 8 | pcb_spacer3050.stl |
| 9 | pcb_spacer3060.stl |
| 7 | pcb_spacer3070.stl |
@@ -2938,9 +2950,9 @@ Pin headers and sockets, etc.
### Modules
| Module | Description |
|:--- |:--- |
| `box_header(type, cols = 1, rows = 1, smt = false, cutout = false)` | Draw box header |
| `box_header(type, cols = 1, rows = 1, smt = false, cutout = false, right_angle = false)` | Draw box header |
| `idc_transition(type, cols = 5, skip = [], cutout = false)` | Draw IDC transition header |
| `jst_xh_header(type, pin_count, right_angle = false, colour = false, pin_colour = false, smt = false)` | Draw JST XH connector |
| `jst_xh_header(type, pin_count, right_angle = false, colour = false, pin_colour = false, smt = false)` | Draw JST XH, PH or ZH connector |
| `pin(type, length = undef)` | Draw a header pin |
| `pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cutout = false, colour)` | Draw pin header |
| `pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt = false, cutout = false, colour)` | Draw pin socket |
@@ -2951,8 +2963,22 @@ Pin headers and sockets, etc.
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `box_header(2p54header, 10, 2)` | Box header 10 x 2 |
| 1 | `box_header(2p54header, 10, 2, right_angle = true)` | Box header 10 x 2 right angle |
| 1 | `box_header(2p54header, 8, 1)` | Box header 8 x 1 |
| 1 | `box_header(2p54header, 8, 1, right_angle = true)` | Box header 8 x 1 right angle |
| 1 | `idc_transition(2p54header, 10)` | IDC transition header 10 x 2 |
| 1 | `jst_xh_header(jst_ph_header, 2)` | JST PH connector 2 way |
| 1 | `jst_xh_header(jst_ph_header, 2, right_angle = true)` | JST PH connector 2 way right_angle |
| 1 | `jst_xh_header(jst_ph_header, 5)` | JST PH connector 5 way |
| 1 | `jst_xh_header(jst_ph_header, 5, right_angle = true)` | JST PH connector 5 way right_angle |
| 1 | `jst_xh_header(jst_xh_header, 2)` | JST XH connector 2 way |
| 1 | `jst_xh_header(jst_xh_header, 2, right_angle = true)` | JST XH connector 2 way right_angle |
| 1 | `jst_xh_header(jst_xh_header, 5)` | JST XH connector 5 way |
| 1 | `jst_xh_header(jst_xh_header, 5, right_angle = true)` | JST XH connector 5 way right_angle |
| 1 | `jst_xh_header(jst_zh_header, 2)` | JST ZH connector 2 way |
| 1 | `jst_xh_header(jst_zh_header, 2, right_angle = true)` | JST ZH connector 2 way right_angle |
| 1 | `jst_xh_header(jst_zh_header, 5)` | JST ZH connector 5 way |
| 1 | `jst_xh_header(jst_zh_header, 5, right_angle = true)` | JST ZH connector 5 way right_angle |
| 1 | `pin_header(2p54header, 10, 2)` | Pin header 10 x 2 |
| 1 | `pin_header(2p54header, 3, 1, right_angle = true)` | Pin header 3 x 1 right_angle |
| 1 | `pin_header(2p54header, 3, 2, right_angle = true)` | Pin header 3 x 2 right_angle |
@@ -2993,7 +3019,7 @@ Potentiometers and rotary encoders
| `pot_spigot_x(type)` | Spigot offset from the shaft centre |
| `pot_thread_d(type)` | Nomininal thread diameter |
| `pot_thread_h(type)` | Height of threaded part |
| `pot_thread_p(type)` | Thread pritch |
| `pot_thread_p(type)` | Thread pitch |
| `pot_wafer(type)` | Width, diameter and thickness of the track wafer plus true if curved |
| `pot_washer(type)` | Outside diameter and thickness of the washer |
@@ -3486,7 +3512,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_thread_diameter(type)` | Thread diameter, if different from nominal diameter |
| `screw_washer(type)` | Default washer |
### Functions
@@ -3874,8 +3900,14 @@ E.g. 475A is 4.7uF 10V on the parts list.
| `smd_pot_flat(type)` | Flat at the back of the wiper |
| `smd_pot_size(type)` | Base length, width and height |
| `smd_pot_wiper(type)` | Wiper diameter, offset, thickness, height, d1, d2, d3, d4 |
| `smd_qfp_body_size(type)` | Size of the body |
| `smd_qfp_gullwing(type)` | Gullwing S, L, R1, R2 |
| `smd_qfp_pin_size(type)` | Pins dimensions |
| `smd_qfp_pins(type)` | Number of pins |
| `smd_qfp_pitch(type)` | Pin pitch |
| `smd_qfp_slant(type)` | Angle of the slope |
| `smd_res_end_cap(type)` | End cap width |
| `smd_res_power(type)` | Power rating in Watts |
| `smd_res_power(type)` | Power rating in Watts, 0 for choke |
| `smd_res_size(type)` | Body length, width and height |
| `smd_soic_lead_pitch(type)` | Lead pitch |
| `smd_soic_lead_size(type)` | Lead width, foot depth, lead thickness |
@@ -3912,6 +3944,7 @@ E.g. 475A is 4.7uF 10V on the parts list.
| `smd_inductor(type, value)` | Draw an SMD inductor |
| `smd_led(type, colour, cutout)` | Draw an SMD LED with specified `colour` |
| `smd_pot(type, value)` | Draw an SMD pot |
| `smd_qfp(type, value)` | Draw and SMD QFP package |
| `smd_resistor(type, value)` | Draw an SMD resistor with specified value |
| `smd_soic(type, value)` | Draw an SMD SOIC |
| `smd_sot(type, value)` | Draw an SMD transistor |
@@ -3922,7 +3955,7 @@ E.g. 475A is 4.7uF 10V on the parts list.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `smd_diode(DO241AC)` | DO241AC package SS34 |
| 1 | `smd_diode(DO214AC)` | DO214AC package SS34 |
| 1 | `smd_inductor(IND2525)` | IND2525 package 4R7 |
| 1 | `smd_led(LED0603, green)` | SMD LED 0603 green |
| 1 | `smd_led(LED0805, blue)` | SMD LED 0805 blue |
@@ -3935,6 +3968,8 @@ E.g. 475A is 4.7uF 10V on the parts list.
| 1 | `smd_capacitor(CAP0603)` | SMD capacitor 0603 |
| 1 | `smd_capacitor(CAP0805)` | SMD capacitor 0805 |
| 1 | `smd_capacitor(CAP1206)` | SMD capacitor 1206 |
| 1 | `smd_qfp(QFP50P1200X1200X160_64N)` | SMD chip: ATSAM4S4BA, package : QFP50P1200X1200X160_64N |
| 1 | `smd_resistor(L2012C, 10u)` | SMD choke 0805 10u |
| 1 | `smd_coax(U_FL_R_SMT_1)` | SMD coax connector type: U_FL_R_SMT_1 |
| 1 | `smd_resistor(RES0402, 1R0)` | SMD resistor 0402 1R0 0.0625W |
| 1 | `smd_resistor(RES0502, 10)` | SMD resistor 0502 10 0.05W |

View File

@@ -65,6 +65,7 @@ test_pcb = ["test_pcb", "Test PCB",
[ 19, 2, 90, "smd_led", LED1206, "blue"],
[ 16, 2, 90, "smd_led", LED0805, "red"],
[ 13, 2, 90, "smd_led", LED0603, "orange"],
[ 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"],
@@ -78,23 +79,27 @@ test_pcb = ["test_pcb", "Test PCB",
[ 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"],
[ 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"],
@@ -139,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"],

View File

@@ -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", "10", "100", "10M", "100K"][$i % 5]);
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)
@@ -68,6 +68,11 @@ module smds() {
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)

View File

@@ -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);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 KiB

After

Width:  |  Height:  |  Size: 258 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 KiB

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 104 KiB

View File

@@ -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,8 +1139,9 @@ 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]);
@@ -1153,6 +1153,7 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
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");
@@ -1212,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

View File

@@ -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,73 @@ L9110S = ["L9110S", "L9110S 2-Channel motor driver module", 29.2, 23, 1.6, 0, 3,
],
[]];
PanelDue_v3 = ["PanelDue_v3", "Panel Due v3.0a LCD Display interface", 53, 73, 1.2, 0, 3.2, 0, "#2140BE", false, [[5,5], [5, -5], [43.7, 37.2]],
[
[ 45.0, 26.5, 45, "buzzer", 6, 12],
[ 32.8, 36.5, 90, "2p54socket", 20, 2],
[ 31.3, 5.9, 180, "molex_hdr", 4, 1],
[ 38.0, 53.2, -90, "2p54boxhdr", 5, 2, false, true, true],
[ 40.8, 67.4, 0, "button_6mm"],
[ 45.1, 16.5, 0, "button_6mm"],
[ 51.2, 68.0, 0, "usb_uA"],
[ 13.6, 35.2, 0, "smd_qfp", QFP50P1200X1200X160_64N, "ATSAM4S4BA"],
[ 14.6, 7.9, 180, "smd_sot", SOT223],
[ 23.2, 14, 0, "smd_sot", SOT23],
[ 31.7, 65, 180, "smd_diode", DO214AC],
[ 24.9, 3.8, 180, "smd_diode", DO214AC],
[ 1.9, 33, -90, "smd_cap", CAP0603, 0.5],
[ 1.9, 28.9, 90, "smd_cap", CAP0603, 0.5],
[ 14.6, 13.2, 0, "smd_cap", CAP0805, 0.85],
[ 20.3, 57.5, 90, "smd_res", RES0603],
[ 18.1, 57.5, 90, "smd_res", RES0603],
[ 27.6, 57, 0, "smd_res", RES0603],
[ 27.3, 7.2, 0, "smd_res", RES0603],
[ 27.3, 9.7, 0, "smd_res", RES0603],
[ 18.5, 11.5, 90, "smd_cap", CAP0805, 0.85],
[ 32.5, 71.2, 180, "smd_cap", CAP0603, 0.5],
[ 14.1, 25.1, 90, "smd_cap", CAP0603, 0.5],
[ 4.2, 36.9, 0, "smd_cap", CAP0603, 0.5],
[ 7.7, 28.4, 90, "smd_cap", CAP0603, 0.5],
[ 22.0, 34.6, 0, "smd_cap", CAP0603, 0.5],
[ 11.4, 44.5, 90, "smd_cap", CAP0603, 0.5],
[ 22.1, 31.2, 0, "smd_cap", CAP0603, 0.5],
[ 12.0, 25.5, 90, "smd_cap", CAP0603, 0.5],
[ 16.2, 24.2, 90, "smd_cap", CAP0603, 0.85],
[ 9.3, 44.5, 90, "smd_cap", CAP0603, 0.85],
[ 5.3, 34.9, 0, "smd_cap", CAP0603, 0.5],
[ 37.5, 61.9, 90, "smd_res", RES0603, "0"],
[ 4.8, 26.5, 0, "smd_cap", CAP0603, 0.85],
[ 3.3, 24.5, 0, "smd_res", RES0603, "1"],
[ 4.8, 30.8, 90, "chip", 5, 3.2, 1.1],
[ 6.9, 24.5, 0, "smd_res", L2012C],
[ 21.8, 7.4, 0, "smd_res", L2012C],
[ 40.8, 71.9, 0, "text", 6, 1.42, "Erase"],
[ 51.4, 16.5, 90, "text", 6, 1.42, "Reset"],
[ 51.4, 52.2, 90, "text", 7.4, 1.42, "CONN_SD"],
[ 2.7, 9.7, 0, "text", 4, 1.27, "GND"],
[ 8.0, 9.7, 0, "text", 4, 1.27, "3.3V"],
[ 38.1, 21.2, 0, "text", 4, 1.42, "3.3V"],
[ 40.7, 12.2, 0, "text", 2, 1.42, "5V"],
[ 49.8, 9.8, 0, "text", 3, 1.27, "Din"],
[ 50.3, 7.3, 0, "text", 4, 1.27, "Dout"],
[ 49.8, 4.7, 0, "text", 3, 1.27, "Gnd"],
[ 49.8, 2.2, 0, "text", 3, 1.27, "+5V"],
],
[],
[6, 60.8 - inch(0.3), 1, 4, silver, 2.54, 2.54, // X4
38, 16.1 - inch(0.1), 1, 3, silver, 2.54, 2.54, // JP1
3.1, 12, 2, 1, silver, 4.6, 2.54, // test points
31.3, 5.9 - inch(0.15), 1, 4, silver, 2.54, 2.64, // X1
38 - inch(0.05), 53.2 - inch(0.2), 2, 5, silver, 2.54, 2.54, // X5
32.8- inch(0.05),36.5 - inch(0.95),2, 20, silver, 2.54, 2.54, // X3
],
];
tiny_pcbs = [XIAO, MP1584EN, TP4056, ESP_01, LIPO_fuel_gauge];
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, RPI_Pico, ESP32_DOIT_V1, RPI0, EnviroPlus, ArduinoUno3, ArduinoLeonardo, WD2002SJ, OPZ2, PanelDue_v3, RPI3A, RPI3, RPI4];
pcbs_not_shown = [Melzi, Duex2, PSU12V1A, Keyes5p1, PI_IO, ExtruderPCB];

View File

@@ -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])

View File

@@ -27,9 +27,9 @@
2p54header = ["2p54header", 2.54, 11.6, 3.2, 0.66, gold, grey(20), 8.5, [0, 0, 8.7], 2.4, 0, 0, 0 ];
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 ];

View File

@@ -32,7 +32,7 @@ function pot_face(type) = type[2]; //! Faceplate rib width, plate depth and
function pot_wafer(type) = type[3]; //! Width, diameter and thickness of the track wafer plus true if curved
function pot_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

View File

@@ -41,7 +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_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

View File

@@ -99,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);
@@ -578,3 +583,63 @@ module smd_coax(type) { //! Draw an SMD coaxial connector
cube([contact.x, contact.y / 2, tube_wall]);
}
}
function smd_qfp_body_size(type) = type[1]; //! Size of the body
function smd_qfp_slant(type) = type[2]; //! Angle of the slope
function smd_qfp_pins(type) = type[3]; //! Number of pins
function smd_qfp_pitch(type) = type[4]; //! Pin pitch
function smd_qfp_pin_size(type) = type[5]; //! Pins dimensions
function smd_qfp_gullwing(type) = type[6]; //! Gullwing S, L, R1, R2
module smd_qfp(type, value) { //! Draw and SMD QFP package
vitamin(str("smd_qfp(", type[0], "): SMD chip: ", value, ", package : ", type[0]));
size = smd_qfp_body_size(type);
offset = size.z / 2 * tan(smd_qfp_slant(type));
d = 3 * offset;
pitch = smd_qfp_pitch(type);
pin = smd_qfp_pin_size(type);
pins = smd_qfp_pins(type);
g = smd_qfp_gullwing(type);
s = g[0]; // length of top flat
l = g[1]; // length of bottom flat
r1 = g[2]; // top radius
r2 = g[3] + pin.z / 2; // bottom radius
pz = -size.z / 2 + pin.z / 2;
gullwing = rounded_path([[-1, 0, 0], [s, 0, 0], r1, [pin.x - l + r2, 0, pz], r2, [pin.x, 0, pz]], $fn = 32);
color(grey(20))
hull() {
translate_z(size.z / 2)
linear_extrude(eps)
offset(delta = d, chamfer = true)
offset(-d)
square([size.x, size.y], center = true);
translate_z(size.z - eps)
linear_extrude(eps)
offset(-offset)
square([size.x, size.y], center = true);
linear_extrude(eps)
offset(-offset)
square([size.x, size.y], center = true);
}
color(silver)
for(a = [0 : 90: 270])
rotate(a)
for(i = [0 : pins / 4 - 1])
translate([size.x / 2, (i - (pins / 4 - 1) / 2) * pitch, size.z / 2])
sweep(gullwing, rectangle_points(pin.y, pin.z));
color("white")
translate_z(size.z)
linear_extrude(eps) {
resize([size.x * 0.9, size.y / 8])
text(value, halign = "center", valign = "center");
translate([(-(pins / 4 - 1) * pitch) / 2, (-(pins / 4 - 1) * pitch) / 2])
circle(r = pin.y, $fn = 32);
}
}

View File

@@ -32,8 +32,9 @@ 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 = [RES0402, RES0502, 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];
@@ -55,9 +56,9 @@ SOIC18 = ["SOIC18", [11.40,7.50, 2.00], 0.10, 1.20, 1.27, 10.30, [0.31, .50, 0.2
smd_soics = [SOIC8, SOIC14, SOIC16, SOIC18];
DO241AC = ["DO241AC", [4.0, 2.5, 2.0], 0.1, 1, [4.8, 1.2, 0.15, 2], grey(20)];
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"]];
@@ -78,4 +79,8 @@ 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.
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>