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

Merge branch 'MS3FGX-SOIC'

This commit is contained in:
Chris
2022-07-04 10:16:04 +01:00
8 changed files with 83 additions and 4 deletions

View File

@@ -2447,6 +2447,9 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `smd_resistor(RES0603, 1K)` | SMD resistor 0603 1K 0.1W |
| 1 | `smd_resistor(RES0805, 1K)` | SMD resistor 0805 1K 0.125W |
| 1 | `smd_resistor(RES1206, 1K)` | SMD resistor 1206 1K 0.25W |
| 1 | `smd_soic(SOIC16)` | SOIC16 package ICL323 |
| 1 | `smd_soic(SOIC18)` | SOIC18 package PIC18F88 |
| 1 | `smd_soic(SOIC8)` | SOIC8 package M34063 |
| 1 | `smd_sot(SOT223)` | SOT223 package LM117 |
| 1 | `smd_sot(SOT23)` | SOT23 package 2N7000 |
| 1 | `square_button(button_4p5mm)` | Square button 4.5mm |
@@ -3644,6 +3647,12 @@ Surface mount components for PCBs.
| `smd_res_end_cap(type)` | End cap width |
| `smd_res_power(type)` | Power rating in Watts |
| `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 |
| `smd_soic_lead_span(type)` | Total span of leads |
| `smd_soic_lead_z(type)` | Top of lead frame from top |
| `smd_soic_size(type)` | Body length, width and height |
| `smd_soic_z(type)` | Height above PCB surface |
| `smd_sot_lead_pitch(type)` | Lead pitch |
| `smd_sot_lead_size(type)` | Lead width, foot depth, lead thickness |
| `smd_sot_lead_span(type)` | Total span of leads |
@@ -3665,6 +3674,7 @@ Surface mount components for PCBs.
| `smd_capacitor(type, height, value = undef)` | Draw an SMD capacitor with specified height |
| `smd_led(type, colour, cutout)` | Draw an SMD LED with specified `colour` |
| `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 |
![smds](tests/png/smds.png)
@@ -3681,6 +3691,9 @@ Surface mount components for PCBs.
| 1 | `smd_resistor(RES0603, 1R0)` | SMD resistor 0603 1R0 0.1W |
| 1 | `smd_resistor(RES0805, 10M)` | SMD resistor 0805 10M 0.125W |
| 1 | `smd_resistor(RES1206, 100K)` | SMD resistor 1206 100K 0.25W |
| 1 | `smd_soic(SOIC16)` | SOIC16 package SOIC16 |
| 1 | `smd_soic(SOIC18)` | SOIC18 package SOIC18 |
| 1 | `smd_soic(SOIC8)` | SOIC8 package SOIC8 |
| 1 | `smd_sot(SOT223)` | SOT223 package FZT851 |
| 1 | `smd_sot(SOT23)` | SOT23 package 2N7000 |

View File

@@ -115,7 +115,6 @@ test_pcb = ["test_pcb", "Test PCB",
[ 60, 3, 0, "flex"],
[ 50, 15, -90, "flat_flex"],
[ 40, 15, -90, "flat_flex", true],
[ 60, 35, 0, "D_plug", DCONN9],
[ 50, 50, 0, "molex_hdr", 2],
[ 50, 60, 0, "jst_xh", 2],
@@ -140,8 +139,11 @@ test_pcb = ["test_pcb", "Test PCB",
[ 55, 170, 0, "button_4p5mm"],
[ 50, 185, 0, "microswitch", small_microswitch],
[ 52, 200, 0, "pcb", 11, TMC2130 ],
[ 80, 200, 0, "pdip", 24, "27C32", true, inch(0.6) ],
[ 80, 170, 0, "pdip", 8, "NE555" ],
[ 80, 210, 0, "pdip", 24, "27C32", true, inch(0.6) ],
[ 80, 180, 0, "pdip", 8, "NE555" ],
[ 80, 166, -90, "smd_soic", SOIC18, "PIC18F88"],
[ 71, 166, -90, "smd_soic", SOIC16, "ICL323"],
[ 64, 166, -90, "smd_soic", SOIC8, "M34063"],
[ 80, 150, 0, "chip", 10, 5, 1, grey(20)],
[ 52, 206, 0, "2p54socket", 8, 1 ],
@@ -149,7 +151,8 @@ test_pcb = ["test_pcb", "Test PCB",
[ 50, 220, 0, "standoff", 5, 4.5, 12.5, 2.54],
[ 50, 240, 0, "potentiometer"],
[ 75, 240, 0, "potentiometer", KY_040_encoder, 8],
[ 30, 85, -90, "7seg", WT5011BSR, 2],
[ 30, 85, -90, "7seg", WT5011BSR, 2],
[ 30, 55, -90, "D_plug", DCONN9],
],
// accessories
[]

View File

@@ -38,6 +38,12 @@ module smds() {
layout([for(s = smd_sots) smd_sot_size(s).x], 1)
let(s = smd_sots[$i])
smd_sot(s, ["2N7000", "FZT851"][$i]);
translate([0, 20])
layout([for(s = smd_soics) smd_soic_size(s).x], 1)
let(s = smd_soics[$i])
smd_soic(s, s[0]);
}
if($preview)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 182 KiB

View File

@@ -1134,6 +1134,7 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
if(show(comp, "smd_res")) smd_resistor(comp[4], comp[5]);
if(show(comp, "smd_cap")) smd_capacitor(comp[4], comp[5], param(6, undef));
if(show(comp, "smd_sot")) smd_sot(comp[4], comp[5]);
if(show(comp, "smd_soic")) smd_soic(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");

View File

@@ -178,3 +178,53 @@ module smd_sot(type, value) { //! Draw an SMD transistor
text(value, halign = "center", valign = "center");
}
function smd_soic_size(type) = type[1]; //! Body length, width and height
function smd_soic_z(type) = type[2]; //! Height above PCB surface
function smd_soic_lead_z(type) = type[3]; //! Top of lead frame from top
function smd_soic_lead_pitch(type) = type[4]; //! Lead pitch
function smd_soic_lead_span(type) = type[5]; //! Total span of leads
function smd_soic_lead_size(type) = type[6]; //! Lead width, foot depth, lead thickness
module smd_soic(type, value) { //! Draw an SMD SOIC
vitamin(str("smd_soic(", type[0], "): ", type[0], " package ", value));
size = smd_soic_size(type);
z0 = smd_soic_z(type);
z2 = z0 + size.z;
z1 = z2 - smd_soic_lead_z(type);
slant = 5; //! 5 degree body draft angle
pitch = smd_soic_lead_pitch(type);
span = (smd_soic_lead_span(type) / 2);
leads = floor(size.x / pitch) + 1;
ls = smd_soic_lead_size(type);
r = ls.z;
gullwing = rounded_path([[0, 0, ls.z / 2], [0, ls.y - ls.z, ls.z / 2], r, [0, ls.y -ls.z + z1 - ls.z, z1 - ls.z / 2], r, [0, span / 2, z1 - ls.z / 2]], $fn = 32);
color(grey(20))
hull()
for(z = [z0, z1, z2], inset = abs(z - z1) * tan(slant))
translate_z(z)
cube([size.x - 2 * inset, size.y - 2 * inset, eps], center = true);
color(silver) {
for(i = [0 : leads - 1]) {
translate([i * pitch - size.x / 2 + (size.x - (leads - 1) * pitch) / 2, -span])
sweep(gullwing, rectangle_points(ls.x, ls.z));
rotate(180)
translate([0, -span / 2])
translate([i * pitch - size.x / 2 + (size.x - (leads - 1) * pitch) / 2, -span / 2])
sweep(gullwing, rectangle_points(ls.x, ls.z));
}
}
color("white")
translate_z(z0 + size.z)
linear_extrude(eps)
resize([size.x * 0.9, size.y / 2])
text(value, halign = "center", valign = "center");
}

View File

@@ -44,4 +44,10 @@ SOT223 = ["SOT223", [6.5, 3.5, 1.6], 0.05, 0.89, 2.3, 7.0, [0.7, 0.95, 0.25], 3]
smd_sots = [SOT23, SOT223];
SOIC8 = ["SOIC8", [4.90, 3.90, 1.25], 0.10, 0.66, 1.27, 6.00, [0.31, .50, 0.20]];
SOIC16 = ["SOIC16", [9.90, 3.90, 1.25], 0.10, 0.66, 1.27, 6.00, [0.31, .50, 0.20]];
SOIC18 = ["SOIC18", [11.40, 7.50, 2.00], 0.10, 1.20, 1.27, 10.30, [0.31, .50, 0.20]];
smd_soics = [SOIC8, SOIC16, SOIC18];
use <smd.scad>