mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-01-17 13:38:16 +01:00
Can now draw right angle Molex KK connectors and can skip pins to allow high voltage.
This commit is contained in:
parent
8a838dd1ce
commit
726d9ed2dc
@ -2344,7 +2344,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
|||||||
| `flex(cutout = false)` | Draw flexistrip connector |
|
| `flex(cutout = false)` | Draw flexistrip connector |
|
||||||
| `hdmi(type, cutout = false)` | Draw HDMI socket |
|
| `hdmi(type, cutout = false)` | Draw HDMI socket |
|
||||||
| `jack(cutout = false)` | Draw 3.5mm jack |
|
| `jack(cutout = false)` | Draw 3.5mm jack |
|
||||||
| `molex_254(ways)` | Draw molex header |
|
| `molex_254(ways, right_angle = 0, skip = undef)` | Draw molex header, set `right_angle` to 1 for normal right angle version or -1 for inverted right angle version. |
|
||||||
| `molex_usb_Ax1(cutout)` | Draw Molex USB A 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 |
|
| `molex_usb_Ax2(cutout)` | Draw Molex dual USB A connector suitable for perf board |
|
||||||
| `pcb(type)` | Draw specified PCB |
|
| `pcb(type)` | Draw specified PCB |
|
||||||
@ -2488,7 +2488,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
|||||||
| `flex(cutout = false)` | Draw flexistrip connector |
|
| `flex(cutout = false)` | Draw flexistrip connector |
|
||||||
| `hdmi(type, cutout = false)` | Draw HDMI socket |
|
| `hdmi(type, cutout = false)` | Draw HDMI socket |
|
||||||
| `jack(cutout = false)` | Draw 3.5mm jack |
|
| `jack(cutout = false)` | Draw 3.5mm jack |
|
||||||
| `molex_254(ways)` | Draw molex header |
|
| `molex_254(ways, right_angle = 0, skip = undef)` | Draw molex header, set `right_angle` to 1 for normal right angle version or -1 for inverted right angle version. |
|
||||||
| `molex_usb_Ax1(cutout)` | Draw Molex USB A 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 |
|
| `molex_usb_Ax2(cutout)` | Draw Molex dual USB A connector suitable for perf board |
|
||||||
| `pcb(type)` | Draw specified PCB |
|
| `pcb(type)` | Draw specified PCB |
|
||||||
|
@ -878,7 +878,7 @@ module terminal_35(ways, colour = "blue") { //! Draw 3.5mm terminal block
|
|||||||
single();
|
single();
|
||||||
}
|
}
|
||||||
|
|
||||||
module molex_254(ways) { //! Draw molex header
|
module molex_254(ways, right_angle = 0, skip = undef) { //! Draw molex 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, "): Molex KK header ", ways, " way"));
|
||||||
pitch = 2.54;
|
pitch = 2.54;
|
||||||
width = ways * pitch - 0.1;
|
width = ways * pitch - 0.1;
|
||||||
@ -888,20 +888,41 @@ module molex_254(ways) { //! Draw molex header
|
|||||||
back = 1;
|
back = 1;
|
||||||
below = 2.3;
|
below = 2.3;
|
||||||
above = 9;
|
above = 9;
|
||||||
|
pin_w = 0.64;
|
||||||
|
r = 1;
|
||||||
|
a = right_angle ? width / 2 - r - pin_w / 2 : above;
|
||||||
|
ra_offset = 2.72;
|
||||||
color("white")
|
color("white")
|
||||||
union() {
|
translate(right_angle ? [-ra_offset, 0, depth / 2] : [ 0, 0, 0])
|
||||||
translate([ -depth / 2, -width / 2,])
|
rotate(right_angle ? right_angle > 0 ? [180, 90, 0] : [0, -90, 0] : [ 0, 0, 0])
|
||||||
cube([depth, width, base]);
|
union() {
|
||||||
|
translate([ -depth / 2, -width / 2,])
|
||||||
|
cube([depth, width, base]);
|
||||||
|
|
||||||
w = width - pitch;
|
w = width - pitch;
|
||||||
translate([- depth / 2, -w / 2])
|
translate([- depth / 2, -w / 2])
|
||||||
cube([back, w, height]);
|
cube([back, w, height]);
|
||||||
}
|
}
|
||||||
|
|
||||||
color("silver")
|
color("silver")
|
||||||
for(i = [0: ways -1])
|
for(i = [0 : ways -1])
|
||||||
translate([0, i * pitch - width / 2 + pitch / 2, (above + below) / 2 - below])
|
if(is_undef(skip) || !in(skip, i))
|
||||||
cube([0.44, 0.75, above + below], center = true);
|
translate([0, i * pitch - width / 2 + pitch / 2]) {
|
||||||
|
translate_z((a + below) / 2 - below)
|
||||||
|
cube([pin_w, pin_w, a + below], center = true);
|
||||||
|
|
||||||
|
l = above + ra_offset - r - pin_w / 2;
|
||||||
|
if(right_angle) {
|
||||||
|
translate([-l / 2 - r - pin_w / 2, 0, width / 2])
|
||||||
|
cube([l, pin_w, pin_w], center = true);
|
||||||
|
|
||||||
|
translate([-r - pin_w / 2, 0, a])
|
||||||
|
rotate([90, 0, 0])
|
||||||
|
rotate_extrude(angle = 90)
|
||||||
|
translate([r + pin_w / 2, 0])
|
||||||
|
square(pin_w, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module vero_pin(cropped = false) { //! Draw a vero pin
|
module vero_pin(cropped = false) { //! Draw a vero pin
|
||||||
|
Loading…
x
Reference in New Issue
Block a user