1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-01-16 21:18:15 +01:00

Added axial diodes, radial transistors, discs and modules.

Verboard and perboard components get solder menisci added automatically.
Radial leads now made by bezier curves rather than straights and arcs.
This commit is contained in:
Chris 2023-07-28 10:39:07 +01:00
parent 9e45e4eb79
commit 74293b6c22
76 changed files with 671 additions and 159 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 KiB

After

Width:  |  Height:  |  Size: 265 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 KiB

After

Width:  |  Height:  |  Size: 326 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 KiB

After

Width:  |  Height:  |  Size: 337 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 KiB

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 KiB

After

Width:  |  Height:  |  Size: 249 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 KiB

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 KiB

After

Width:  |  Height:  |  Size: 236 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 KiB

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 KiB

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 KiB

After

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 KiB

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

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

View File

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

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

View File

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

View File

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

View File

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

View File

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

View File

@ -33,16 +33,16 @@ A list of changes classified as breaking, additions or fixes is maintained in [C
<tr><td> <a href = "#bulldogs">Bulldogs</a> </td><td> <a href = "#magnets">Magnets</a> </td><td> <a href = "#screws">Screws</a> </td><td> <a href = "#drag_chain">Drag_chain</a> </td><td> <a href = "#layout">Layout</a> </td><td></td></tr>
<tr><td> <a href = "#buttons">Buttons</a> </td><td> <a href = "#mains_sockets">Mains_sockets</a> </td><td> <a href = "#sealing_strip">Sealing_strip</a> </td><td> <a href = "#fan_guard">Fan_guard</a> </td><td> <a href = "#maths">Maths</a> </td><td></td></tr>
<tr><td> <a href = "#cable_strips">Cable_strips</a> </td><td> <a href = "#microswitches">Microswitches</a> </td><td> <a href = "#servo_motors">Servo_motors</a> </td><td> <a href = "#fixing_block">Fixing_block</a> </td><td> <a href = "#offset">Offset</a> </td><td></td></tr>
<tr><td> <a href = "#cameras">Cameras</a> </td><td> <a href = "#microview">Microview</a> </td><td> <a href = "#shaft_couplings">Shaft_couplings</a> </td><td> <a href = "#flat_hinge">Flat_hinge</a> </td><td> <a href = "#quadrant">Quadrant</a> </td><td></td></tr>
<tr><td> <a href = "#circlips">Circlips</a> </td><td> <a href = "#modules">Modules</a> </td><td> <a href = "#sheets">Sheets</a> </td><td> <a href = "#foot">Foot</a> </td><td> <a href = "#round">Round</a> </td><td></td></tr>
<tr><td> <a href = "#components">Components</a> </td><td> <a href = "#nuts">Nuts</a> </td><td> <a href = "#spades">Spades</a> </td><td> <a href = "#handle">Handle</a> </td><td> <a href = "#rounded_cylinder">Rounded_cylinder</a> </td><td></td></tr>
<tr><td> <a href = "#dip">DIP</a> </td><td> <a href = "#o_ring">O_ring</a> </td><td> <a href = "#spools">Spools</a> </td><td> <a href = "#knob">Knob</a> </td><td> <a href = "#rounded_polygon">Rounded_polygon</a> </td><td></td></tr>
<tr><td> <a href = "#d_connectors">D_connectors</a> </td><td> <a href = "#opengrab">Opengrab</a> </td><td> <a href = "#springs">Springs</a> </td><td> <a href = "#led_bezel">LED_bezel</a> </td><td> <a href = "#rounded_triangle">Rounded_triangle</a> </td><td></td></tr>
<tr><td> <a href = "#displays">Displays</a> </td><td> <a href = "#pcb">PCB</a> </td><td> <a href = "#stepper_motors">Stepper_motors</a> </td><td> <a href = "#pcb_mount">PCB_mount</a> </td><td> <a href = "#sector">Sector</a> </td><td></td></tr>
<tr><td> <a href = "#extrusion_brackets">Extrusion_brackets</a> </td><td> <a href = "#pcbs">PCBs</a> </td><td> <a href = "#swiss_clips">Swiss_clips</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 = "#terminals">Terminals</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 = "#toggles">Toggles</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 = "#photo_interrupters">Photo_interrupters</a> </td><td> <a href = "#transformers">Transformers</a> </td><td> <a href = "#printed_box">Printed_box</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#cameras">Cameras</a> </td><td> <a href = "#microview">Microview</a> </td><td> <a href = "#shaft_couplings">Shaft_couplings</a> </td><td> <a href = "#flat_hinge">Flat_hinge</a> </td><td> <a href = "#pcb_utils">PCB_utils</a> </td><td></td></tr>
<tr><td> <a href = "#circlips">Circlips</a> </td><td> <a href = "#modules">Modules</a> </td><td> <a href = "#sheets">Sheets</a> </td><td> <a href = "#foot">Foot</a> </td><td> <a href = "#quadrant">Quadrant</a> </td><td></td></tr>
<tr><td> <a href = "#components">Components</a> </td><td> <a href = "#nuts">Nuts</a> </td><td> <a href = "#spades">Spades</a> </td><td> <a href = "#handle">Handle</a> </td><td> <a href = "#round">Round</a> </td><td></td></tr>
<tr><td> <a href = "#dip">DIP</a> </td><td> <a href = "#o_ring">O_ring</a> </td><td> <a href = "#spools">Spools</a> </td><td> <a href = "#knob">Knob</a> </td><td> <a href = "#rounded_cylinder">Rounded_cylinder</a> </td><td></td></tr>
<tr><td> <a href = "#d_connectors">D_connectors</a> </td><td> <a href = "#opengrab">Opengrab</a> </td><td> <a href = "#springs">Springs</a> </td><td> <a href = "#led_bezel">LED_bezel</a> </td><td> <a href = "#rounded_polygon">Rounded_polygon</a> </td><td></td></tr>
<tr><td> <a href = "#displays">Displays</a> </td><td> <a href = "#pcb">PCB</a> </td><td> <a href = "#stepper_motors">Stepper_motors</a> </td><td> <a href = "#pcb_mount">PCB_mount</a> </td><td> <a href = "#rounded_triangle">Rounded_triangle</a> </td><td></td></tr>
<tr><td> <a href = "#extrusion_brackets">Extrusion_brackets</a> </td><td> <a href = "#pcbs">PCBs</a> </td><td> <a href = "#swiss_clips">Swiss_clips</a> </td><td> <a href = "#psu_shroud">PSU_shroud</a> </td><td> <a href = "#sector">Sector</a> </td><td></td></tr>
<tr><td> <a href = "#extrusions">Extrusions</a> </td><td> <a href = "#psus">PSUs</a> </td><td> <a href = "#terminals">Terminals</a> </td><td> <a href = "#pocket_handle">Pocket_handle</a> </td><td> <a href = "#sweep">Sweep</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 = "#toggles">Toggles</a> </td><td> <a href = "#press_fit">Press_fit</a> </td><td> <a href = "#thread">Thread</a> </td><td></td></tr>
<tr><td> <a href = "#fastons">Fastons</a> </td><td> <a href = "#photo_interrupters">Photo_interrupters</a> </td><td> <a href = "#transformers">Transformers</a> </td><td> <a href = "#printed_box">Printed_box</a> </td><td> <a href = "#tube">Tube</a> </td><td></td></tr>
<tr><td> <a href = "#fuseholder">Fuseholder</a> </td><td> <a href = "#pillars">Pillars</a> </td><td> <a href = "#tubings">Tubings</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 = "#variacs">Variacs</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 = "#veroboard">Veroboard</a> </td><td> <a href = "#ssr_shroud">SSR_shroud</a> </td><td></td><td></td></tr>
@ -98,6 +98,9 @@ Axial components for PCBs.
### Properties
| Function | Description |
|:--- |:--- |
| `ax_diode_colour(type)` | Body colour and stripe colour |
| `ax_diode_size(type)` | Body length, diameter and corner radius |
| `ax_diode_wire(type)` | Wire diameter |
| `ax_res_colour(type)` | Body colour |
| `ax_res_diameter(type)` | Body diameter |
| `ax_res_end_d(type)` | End cap diameter |
@ -109,6 +112,7 @@ Axial components for PCBs.
### Modules
| Module | Description |
|:--- |:--- |
| `ax_diode(type, value, pitch = 0)` | Through hole axial diode. If `pitch` is zero the minimum is used. If below the minimum the resistor is placed vertical. |
| `ax_res(type, value, tol = 5, pitch = 0)` | Through hole axial resistor. If `pitch` is zero the minimum is used. If below the minimum the resistor is placed vertical. |
| `wire_link(d, l, h = 1, tail = 3, sleeve = false)` | Draw a wire jumper link. `sleeve` can be a list with the diameter and colour. If `l` is zero then a vertical wire is drawn. |
@ -117,6 +121,8 @@ Axial components for PCBs.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 2 | `ax_diode(DO_41, "1N4007")` | Diode 1N4007 |
| 2 | `ax_diode(DO_35, "1N4148")` | Diode 1N4148 |
| 1 | `pcb(PERF60x40)` | Perfboard 60 x 40mm |
| 1 | `ax_res(res1_8, 1000)` | Resistor 1000 Ohms 5% 0.125W |
| 1 | `ax_res(res1_8, 2200, tol = 1)` | Resistor 2200 Ohms 1% 0.125W |
@ -2525,6 +2531,8 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 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(DO214AC)` | DO214AC package SS34 |
| 2 | `ax_diode(DO_41, "1N4007")` | Diode 1N4007 |
| 2 | `ax_diode(DO_35, "1N4148")` | Diode 1N4148 |
| 1 | `hdmi(hdmi_full)` | HDMI socket |
| 1 | `pdip(24, 27C32, w = 15.24)` | IC 27C32 PDIP24 |
| 1 | `pdip(8, NE555)` | IC NE555 PDIP8 |
@ -2549,6 +2557,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 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 |
| 1 | `rd_transistor(TO92, "78L05")` | Regulator TO92 78L05 |
| 1 | `ax_res(res1_2, 10, tol = 10)` | Resistor 10 Ohms 10% 0.5W |
| 1 | `ax_res(res1_4, 100, tol = 2)` | Resistor 100 Ohms 2% 0.25W |
| 1 | `ax_res(res1_8, 1000)` | Resistor 1000 Ohms 5% 0.125W |
@ -2594,6 +2603,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 2 | `green_terminal(gt_3p5, 4)` | Terminal block 4 way 3.5mm |
| 1 | `terminal_35(4)` | Terminal block 4 way 3.5mm |
| 1 | `pcb(test_pcb)` | Test PCB |
| 1 | `rd_transistor(E_LINE, "ZTX853")` | Transistor E_LINE ZTX853 |
| 2 | `vero_pin()` | Vero board pin |
| 1 | `wire_link(0.8, 5.08, h = 10.16)` | Wire link 0.8mm x 0.2" |
| 1 | `wire_link(0.8, 10.16)` | Wire link 0.8mm x 0.4" |
@ -2981,7 +2991,7 @@ Pin headers and sockets, etc.
| `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, PH or ZH connector |
| `pin(type, length = undef)` | Draw a header pin |
| `pin(type, length = undef, colour = 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 |
@ -3235,6 +3245,21 @@ Radial components for PCBs.
### Properties
| Function | Description |
|:--- |:--- |
| `rd_disc_colours(type)` | Colours of body and text |
| `rd_disc_kind(type)` | Capacitor, etc |
| `rd_disc_lead_d(type)` | Lead diameter and sleeve diameter |
| `rd_disc_pitch(type)` | Lead pitch X & Y |
| `rd_disc_size(type)` | Diameter, thickness and height |
| `rd_module_colour(type)` | Colour |
| `rd_module_kind(type)` | Relay, PSU, etc. |
| `rd_module_pin_posns(type)` | list of pin positions |
| `rd_module_pin_size(type)` | Pin size |
| `rd_module_radius(type)` | Corner radius |
| `rd_module_size(type)` | Size |
| `rd_transistor_colours(type)` | Body colour and text colour |
| `rd_transistor_lead(type)` | Lead diameter or width and depth |
| `rd_transistor_lead_posns(type)` | List of lead xy coordinates |
| `rd_transistor_size(type)` | Width / diameter, depth / flat and height |
| `rd_xtal_flange(type)` | Crystal flange width and thickness |
| `rd_xtal_lead_d(type)` | Crystal lead diameter |
| `rd_xtal_pitch(type)` | Crystal lead pitch |
@ -3243,7 +3268,9 @@ Radial components for PCBs.
### Modules
| Module | Description |
|:--- |:--- |
| `cylindrical_wrap(r, h = eps)` | Wrap a 2D child extruded to height `h` around a cylinder with radius `r`. |
| `rd_disc(type, value, pitch = undef, z = 0, tail = 3)` | Draw a radial disc component |
| `rd_module(type, value)` | Draw a PCB mounted potted module, e.g. PSU or relay |
| `rd_transistor(type, value, kind = "Transistor", lead_positions = undef, z = 5, tail = 3)` | Draw a radial lead transistor |
| `rd_xtal(type, value, z = 0, pitch = undef, tail = 3)` | Draw a crystal |
![radials](tests/png/radials.png)
@ -3251,12 +3278,18 @@ Radial components for PCBs.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `rd_disc(6p4mm_disc, "10nF")` | Ceramic capacitor, 6p4mm_disc 10nF |
| 1 | `rd_xtal(ACT1100, "ACT1100")` | Crystal ACT1100 ACT1100 |
| 1 | `rd_xtal(ACT1700, "ACT1700")` | Crystal ACT1700 ACT1700 |
| 1 | `rd_xtal(C_002RX, "C_002RX")` | Crystal C_002RX C_002RX |
| 1 | `rd_xtal(HC49, "HC49")` | Crystal HC49 HC49 |
| 1 | `rd_xtal(HC49_4H, "HC49_4H")` | Crystal HC49_4H HC49_4H |
| 1 | `pcb(PERF60x40)` | Perfboard 60 x 40mm |
| 1 | `rd_module(VCE03, "12V 250ma")` | PSU VCE03 / 12V 250ma |
| 1 | `pcb(PERF70x50)` | Perfboard 70 x 50mm |
| 1 | `rd_module(HF33F, "012-HSL3F")` | Relay HF33F / 012-HSL3F |
| 1 | `rd_transistor(E_LINE, "ZTX853")` | Transistor E_LINE ZTX853 |
| 1 | `rd_transistor(TO92, "BC337")` | Transistor TO92 BC337 |
| 1 | `rd_disc(ERZV07D471, "470V")` | Varistor, ERZV07D471 470V |
<a href="#top">Top</a>
@ -4634,7 +4667,6 @@ Veroboard with mounting holes, track breaks, removed tracks, solder points and c
### Modules
| Module | Description |
|:--- |:--- |
| `solder_meniscus(type, ir = 0.3, r = undef)` | Draw a solder meniscus |
| `vero_cutouts(type, angle = undef)` | Make cutouts to clear components |
| `vero_grid_pos(type, x, y)` | Convert grid position to offset from the centre |
| `vero_mounting_hole_positions(type)` | Positions children at the mounting holes |
@ -6971,6 +7003,27 @@ If `chamfer_base` is true then the bottom edge is made suitable for 3D printing
![offset](tests/png/offset.png)
<a href="#top">Top</a>
---
<a name="pcb_utils"></a>
## PCB_utils
Utilities for making PCBs and components
[utils/pcb_utils.scad](utils/pcb_utils.scad) Implementation.
[tests/PCB_utils.scad](tests/PCB_utils.scad) Code for this example.
### Modules
| Module | Description |
|:--- |:--- |
| `cylindrical_wrap(r, h = eps)` | Wrap a 2D child extruded to height `h` around a cylinder with radius `r`. |
| `solder(ir = 0.3)` | Maybe add solder meniscus if $solder is set |
| `solder_meniscus(ir = 0.3, r)` | Draw a solder meniscus |
![pcb_utils](tests/png/pcb_utils.png)
<a href="#top">Top</a>
---

View File

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

View File

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

48
tests/pcb_utils.scad Normal file
View File

@ -0,0 +1,48 @@
//
// NopSCADlib Copyright Chris Palmer 2023
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
include <../utils/core/core.scad>
use <../utils/pcb_utils.scad>
module pcb_utils() {
let($solder = [1, 0, 1.6])
solder();
r = 2;
h = 10;
color(grey(20))
cylinder(r = r, h = h);
color("silver")
vflip()
cylinder(d = 0.6, h = 3, $fn = 16);
color("white")
translate_z(h / 2)
cylindrical_wrap(r = r)
resize([0, h * .8], auto = true)
rotate(90)
text("Hello", halign = "center", valign = "center");
}
if($preview)
rotate(-45)
pcb_utils();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 KiB

After

Width:  |  Height:  |  Size: 278 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 KiB

After

Width:  |  Height:  |  Size: 199 KiB

BIN
tests/png/pcb_utils.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 KiB

After

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 KiB

After

Width:  |  Height:  |  Size: 170 KiB

View File

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

View File

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

58
utils/pcb_utils.scad Normal file
View File

@ -0,0 +1,58 @@
//
// NopSCADlib Copyright Chris Palmer 2023
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
//
//! Utilities for making PCBs and components
//
include <../utils/core/core.scad>
module solder_meniscus(ir = 0.3, r) { //! Draw a solder meniscus
h = 0.7;
color("silver") rotate_extrude()
difference() {
square([r, h]);
translate([r + eps, h + eps])
ellipse(r - ir + eps, h, $fn = 64);
}
}
module solder(ir = 0.3) { //! Maybe add solder meniscus if $solder is set
if(!is_undef($solder))
vflip()
translate_z($solder.z)
solder_meniscus(ir = ir, r = $solder.x);
}
module cylindrical_wrap(r, h = eps) { //! Wrap a 2D child extruded to height `h` around a cylinder with radius `r`.
sides = r2sides(r);
dx = 2 * r * tan(180 / sides);
for(i = [0 : sides - 1])
rotate((i - 0.5) * 360 / sides)
translate([0, r])
rotate([-90, 0, 0])
linear_extrude(h, center = true)
intersection() {
translate([(sides / 2 - i) * -dx, 0])
children();
square([dx, inf], center = true);
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -22,6 +22,7 @@
//
include <../core.scad>
use <pcb.scad>
use <../utils/pcb_utils.scad>
function vero_assembly(type) = type[1]; //! Name of the assembly
function vero_holes(type) = type[2]; //! Number of holes in each strip
@ -46,20 +47,6 @@ function vero(name, assembly, holes, strips, pitch = 2.54, fr4 = false, screw =
function vero_size(type) = [vero_length(type), vero_width(type), vero_thickness(type)]; //! Board size
module solder_meniscus(type, ir = 0.3, r = undef) { //! Draw a solder meniscus
h = 0.7;
r = is_undef(r) ? vero_track_width(type) / 2 : r;
translate_z(vero_track_thickness(type))
color("silver") rotate_extrude()
difference() {
square([r, h]);
translate([r + eps, h + eps])
ellipse(r - ir , h, $fn = 64);
}
}
function vero_grid_pos(type, x, y) = //! Convert grid position to offset from the centre
let(holes = vero_holes(type), strips = vero_strips(type))
[((x + holes) % holes) - holes / 2 + 0.5,
@ -126,13 +113,16 @@ module veroboard(type) { //! Draw specified veroboard with missing tracks and tr
circle(d = pitch * 1.1);
for(p = vero_breaks(type))
vero_grid_pos(type, p.x, p.y)
if(ceil(p.x) == p.x)
hull() {
for(x = p.x)
vero_grid_pos(type, x, p.y)
if(ceil(x) == x)
circle(d = pitch * 1.1);
else
square([pitch * 0.3, pitch], center = true);
}
}
}
}
module vero_components(type, cutouts = false, angle = undef)
@ -153,13 +143,14 @@ pose_vflip(exploded = true)
assembly(vero_assembly(type), ngb = ngb) {
veroboard(type);
let($solder = [vero_track_width(type) / 2, 0, vero_thickness(type) + vero_track_thickness(type)])
vero_components(type);
let($solder = [vero_track_width(type) / 2, 0, vero_track_thickness(type)])
for(r = vero_joints(type))
for(x = r.x, y = r.y)
vero_grid_pos(type, x, y)
vflip()
solder_meniscus(type);
solder();
}
module veroboard_fasteners(type, height, thickness, flip = false) { //! Draw the fasteners in place