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

Added molex_usb_Ax1() and now shows SMT caps in the PCB test.

This commit is contained in:
Chris Palmer
2021-06-17 15:08:53 +01:00
parent fe3b84f672
commit c7a6d8164f
4 changed files with 79 additions and 10 deletions

View File

@@ -2283,7 +2283,8 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| `hdmi(type, cutout = false)` | Draw HDMI socket |
| `jack(cutout = false)` | Draw 3.5mm jack |
| `molex_254(ways)` | Draw molex header |
| `molex_usb_Ax2(cutout)` | Draw Molex USB connector suitable for perf board |
| `molex_usb_Ax1(cutout)` | Draw Molex USB A connector suitable for perf board |
| `molex_usb_Ax2(cutout)` | Draw Molex dual USB A connector suitable for perf board |
| `pcb(type)` | Draw specified PCB |
| `pcb_assembly(type, height, thickness)` | Draw PCB assembly with spaces and fasteners in place |
| `pcb_base(type, height, thickness, wall = 2)` | Generate STL for a base with PCB spacers |
@@ -2336,6 +2337,9 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `ax_res(res1_8, 1e+6, tol = 1)` | Resistor 1e+6 Ohms 1% 0.125W |
| 1 | `smd_led(LED0603, orange)` | SMD LED 0603 orange |
| 1 | `smd_led(LED0805, red)` | SMD LED 0805 red |
| 1 | `smd_capacitor(CAP0603)` | SMD capacitor 0603 |
| 1 | `smd_capacitor(CAP0805)` | SMD capacitor 0805 |
| 1 | `smd_capacitor(CAP1206)` | SMD capacitor 1206 |
| 1 | `smd_resistor(RES0603, 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 |
@@ -2420,7 +2424,8 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| `hdmi(type, cutout = false)` | Draw HDMI socket |
| `jack(cutout = false)` | Draw 3.5mm jack |
| `molex_254(ways)` | Draw molex header |
| `molex_usb_Ax2(cutout)` | Draw Molex USB connector suitable for perf board |
| `molex_usb_Ax1(cutout)` | Draw Molex USB A connector suitable for perf board |
| `molex_usb_Ax2(cutout)` | Draw Molex dual USB A connector suitable for perf board |
| `pcb(type)` | Draw specified PCB |
| `pcb_assembly(type, height, thickness)` | Draw PCB assembly with spaces and fasteners in place |
| `pcb_base(type, height, thickness, wall = 2)` | Generate STL for a base with PCB spacers |

View File

@@ -64,21 +64,25 @@ test_pcb = ["TestPCB", "Test PCB",
[ 16, 2, 90, "smd_res", RES1206, "1K"],
[ 19, 2, 90, "smd_res", RES0805, "1K"],
[ 22, 2, 90, "smd_res", RES0603, "1K"],
[ 25, 2, 90, "smd_cap", CAP1206, 1.5],
[ 28, 2, 90, "smd_cap", CAP0805, 1.0],
[ 31, 2, 90, "smd_cap", CAP0603, 0.7],
[ 10, 10, 0, "2p54header", 4, 1],
[ 25, 10, 0, "2p54header", 5, 1, false, "blue" ],
[ 10, 20, 0, "2p54boxhdr", 4, 2],
[ 10, 30, 0, "2p54socket", 6, 1],
[ 25, 30, 0, "2p54socket", 4, 1, false, 0, false, "red" ],
[ 10, 40, 0, "chip", 10, 5, 1, grey(20)],
[ 5, 50, 0, "led", LED3mm, "red"],
[ 12, 50, 0, "led", LED5mm, "orange"],
[ 25, 50, 0, "led", LED10mm, "yellow"],
[ 10, 65, 180, "rj45"],
[ 8, 85, 180, "usb_A"],
[ 65, 50, 0, "led", LED3mm, "red"],
[ 75, 50, 0, "led", LED5mm, "orange"],
[ 90, 50, 0, "led", LED10mm, "yellow"],
[ 10, 45, 180, "rj45"],
[ 8, 65, 180, "usb_A"],
[ 8, 105, 180, "usb_Ax2"],
[ 7, 85, 180, "molex_usb_Ax1"],
[ 8.5,125, 180, "molex_usb_Ax2"],
[ 3, 140, 180, "usb_uA"],
[ 8, 155, 180, "usb_B"],
[ 8.5, 125, 180, "molex_usb_Ax2"],
[ 25, 200, 0, "buzzer", 4.5, 8.5],
[ 25, 218, 0, "buzzer"],
[ 8, 190, 180, "jack"],
@@ -127,6 +131,8 @@ test_pcb = ["TestPCB", "Test PCB",
[ 52, 200, 0, "pcb", 11, TMC2130 ],
[ 80, 200, 0, "pdip", 24, "27C32", true, inch(0.6) ],
[ 80, 170, 0, "pdip", 8, "NE555" ],
[ 80, 150, 0, "chip", 10, 5, 1, grey(20)],
[ 52, 206, 0, "2p54socket", 8, 1 ],
[ 52, 194, 0, "2p54socket", 8, 1, false, 0, false, "red" ],
[ 50, 220, 0, "standoff", 5, 4.5, 12.5, 2.54],

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 176 KiB

View File

@@ -161,7 +161,7 @@ module usb_A(h, v_flange_l, bar, cutout) {
}
}
module molex_usb_Ax2(cutout) { //! Draw Molex USB connector suitable for perf board
module molex_usb_Ax2(cutout) { //! Draw Molex dual USB A connector suitable for perf board
w = 15.9;
h = 16.6;
l = 17;
@@ -221,6 +221,63 @@ module molex_usb_Ax2(cutout) { //! Draw Molex USB connector suitable for perf bo
}
}
module molex_usb_Ax1(cutout) { //! Draw Molex USB A connector suitable for perf board
w = 15.3;
h = 7.7;
l = 14.5;
pin_l = 2.8;
clearance = 0.2;
tag_l = 4.4;
tag_r = 0.5;
tag_w = 1.5;
tag_t = 0.3;
if(cutout)
translate([0, -w / 2 - clearance, -clearance])
cube([100, w + 2 * clearance, h + 2 * clearance]);
else {
color(silver)
translate([-l / 2, 0])
rotate([90, 0, 90])
translate([-w / 2, 0]) {
cube([w, h, l - 9]);
linear_extrude(l)
difference() {
square([w, h]);
translate([w / 2, h / 2])
square([12.6, 5.08], center = true);
}
}
translate([-1.5, 0, h / 2])
usb_A_tongue();
color(silver)
rotate(-90) {
for(x = [-1.5 : 1 : 1.5])
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);
}
for(side = [-1, 1])
translate([side * w / 2, -l / 2 + 4.2])
rotate(-side * 90)
hull() {
translate([0, tag_l - tag_r])
cylinder(r = tag_r, h = tag_t);
translate([-tag_w / 2, 0])
cube([tag_w, eps, tag_t]);
}
}
}
}
module rj45(cutout = false) { //! Draw RJ45 Ethernet connector
l = 21;
w = 16;
@@ -939,6 +996,7 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
if(show(comp, "uSD")) uSD(comp[4], cutouts);
if(show(comp, "trimpot10")) trimpot10(param(4, false), cutouts);
if(show(comp, "molex_usb_Ax2")) molex_usb_Ax2(cutouts);
if(show(comp, "molex_usb_Ax1")) molex_usb_Ax1(cutouts);
if(show(comp, "smd_led")) smd_led(comp[4], comp[5], cutouts);
if(show(comp, "block")) block(size = [comp[4], comp[5], comp[6]], colour = comp[7], makes_cutout = param(8));
if(!cutouts) {