1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-08-19 05:39:10 +02: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

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