mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-01-16 13:08:15 +01:00
Added right angle option to box headers.
This commit is contained in:
parent
06a286dc98
commit
e81dcfdbd8
@ -2492,6 +2492,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| ---:|:--- |:---|
|
||||
| 1 | `potentiometer(BTT_encoder)` | BTT_encoder |
|
||||
| 1 | `box_header(2p54header, 4, 2)` | Box header 4 x 2 |
|
||||
| 1 | `box_header(2p54header, 4, 2, right_angle = true)` | Box header 4 x 2 right angle |
|
||||
| 1 | `rd_xtal(ACT1100, "40MHz")` | Crystal ACT1100 40MHz |
|
||||
| 1 | `rd_xtal(ACT1700, "80MHz")` | Crystal ACT1700 80MHz |
|
||||
| 1 | `rd_xtal(C_002RX, "60KHz")` | Crystal C_002RX 60KHz |
|
||||
@ -2944,7 +2945,7 @@ Pin headers and sockets, etc.
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| `box_header(type, cols = 1, rows = 1, smt = false, cutout = false)` | Draw box header |
|
||||
| `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 |
|
||||
@ -2957,7 +2958,9 @@ Pin headers and sockets, etc.
|
||||
| Qty | Module call | BOM entry |
|
||||
| ---:|:--- |:---|
|
||||
| 1 | `box_header(2p54header, 10, 2)` | Box header 10 x 2 |
|
||||
| 1 | `box_header(2p54header, 10, 2, right_angle = true)` | Box header 10 x 2 right angle |
|
||||
| 1 | `box_header(2p54header, 8, 1)` | Box header 8 x 1 |
|
||||
| 1 | `box_header(2p54header, 8, 1, right_angle = true)` | Box header 8 x 1 right angle |
|
||||
| 1 | `idc_transition(2p54header, 10)` | IDC transition header 10 x 2 |
|
||||
| 1 | `jst_xh_header(jst_ph_header, 2)` | JST PH connector 2 way |
|
||||
| 1 | `jst_xh_header(jst_ph_header, 2, right_angle = true)` | JST PH connector 2 way right_angle |
|
||||
|
@ -45,9 +45,15 @@ module pin_headers() {
|
||||
translate([0, 50])
|
||||
box_header(pin_headers[$i], 8, 1);
|
||||
|
||||
translate([40, 40])
|
||||
box_header(pin_headers[$i], 8, 1, right_angle = true);
|
||||
|
||||
translate([0, 60])
|
||||
box_header(pin_headers[$i], 10, 2);
|
||||
|
||||
translate([40, 60])
|
||||
box_header(pin_headers[$i], 10, 2, right_angle = true);
|
||||
|
||||
translate([0, 70])
|
||||
pin_socket(pin_headers[$i], 8, 1);
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 146 KiB After Width: | Height: | Size: 168 KiB |
@ -74,8 +74,11 @@ module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cu
|
||||
|
||||
translate_z(smt ? 3.5 - h : 0) {
|
||||
for(x = [0 : cols - 1], y = [0 : rows - 1]) {
|
||||
py = pitch * (y - (rows - 1) / 2);
|
||||
pin = [pitch * (x - (cols - 1) / 2), py, py + width / 2]; // Position of pin joint
|
||||
|
||||
// Vertical part of the pin
|
||||
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2)])
|
||||
translate([pin.x, pin.y])
|
||||
if(right_angle)
|
||||
pin(type, hdr_pin_below(type) + (y + 0.5) * pitch);
|
||||
else
|
||||
@ -84,11 +87,12 @@ module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cu
|
||||
if(right_angle) {
|
||||
w = hdr_pin_width(type);
|
||||
// Horizontal part of the pin
|
||||
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])
|
||||
pin(type, hdr_pin_length(type) - hdr_pin_below(type) + ra_offset + pitch / 2 + (y - 0.5) * pitch);
|
||||
translate([pin.x, pin.y - hdr_pin_below(type), pin.z])
|
||||
rotate([-90, 0, 180])
|
||||
pin(type, hdr_pin_length(type) - hdr_pin_below(type) + ra_offset + y * pitch);
|
||||
|
||||
// corner
|
||||
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2) - w / 2, pitch * (y - (rows - 1) / 2) + width / 2 - w / 2])
|
||||
translate([pin.x, pin.y - w / 2, pin.z - w / 2])
|
||||
rotate([0, -90, 0])
|
||||
color(hdr_pin_colour(type))
|
||||
rotate_extrude(angle = 90, $fn = 32)
|
||||
@ -119,7 +123,7 @@ module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cu
|
||||
}
|
||||
}
|
||||
|
||||
module box_header(type, cols = 1, rows = 1, smt = false, cutout = false) { //! Draw box header
|
||||
module box_header(type, cols = 1, rows = 1, smt = false, cutout = false, right_angle = false) { //! Draw box header
|
||||
pitch = hdr_pitch(type);
|
||||
size = hdr_box_size(type);
|
||||
w = cols * pitch + 7.62;
|
||||
@ -127,36 +131,63 @@ module box_header(type, cols = 1, rows = 1, smt = false, cutout = false) { //! D
|
||||
h = size.z;
|
||||
t = hdr_box_wall(type);
|
||||
base = h - 6.4;
|
||||
ra_offset = 2.4;
|
||||
|
||||
if(cutout)
|
||||
dogbone_rectangle([cols * pitch + 2 * panel_clearance, rows * pitch + 2 * panel_clearance, 100], center = false);
|
||||
else {
|
||||
vitamin(str("box_header(", type[0], ", ", cols, ", ", rows, arg(smt, false, "smt"), "): Box header ", cols, " x ", rows));
|
||||
vitamin(str("box_header(", type[0], ", ", cols, ", ", rows, arg(smt, false, "smt"), arg(right_angle, false, "right_angle"), "): Box header ", cols, " x ", rows, right_angle ? " right angle " : ""));
|
||||
|
||||
translate_z(smt ? 3.5 - h : 0) {
|
||||
for(x = [0 : cols - 1], y = [0 : rows - 1])
|
||||
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2), 0])
|
||||
pin(type, hdr_pin_length(type) - pitch + base);
|
||||
for(x = [0 : cols - 1], y = [0 : rows - 1]) {
|
||||
py = -pitch * (y - (rows - 1) / 2);
|
||||
pin = [pitch * (x - (cols - 1) / 2), py, l / 2 - py]; // Position of pin joint
|
||||
|
||||
color(hdr_base_colour(type)) {
|
||||
linear_extrude(base)
|
||||
square([w, l], center = true);
|
||||
translate([pin.x, pin.y])
|
||||
if(right_angle)
|
||||
pin(type, hdr_pin_below(type) + pin.z);
|
||||
else
|
||||
pin(type, hdr_pin_length(type) - pitch + base);
|
||||
|
||||
linear_extrude(h)
|
||||
difference() {
|
||||
square([w, l], center = true);
|
||||
if(right_angle) {
|
||||
pw = hdr_pin_width(type);
|
||||
// Horizontal part of the pin
|
||||
translate([pin.x, pin.y + hdr_pin_below(type), pin.z])
|
||||
rotate([-90, 0, 0])
|
||||
pin(type, hdr_pin_length(type) - hdr_pin_below(type) + ra_offset + y * pitch);
|
||||
|
||||
square([w - t, l - t], center = true);
|
||||
|
||||
translate([0, -l / 2])
|
||||
square([4.5, 4.5], center = true);
|
||||
}
|
||||
// corner
|
||||
translate([pin.x, pin.y + pw / 2, pin.z - pw / 2])
|
||||
rotate([0, -90, 180])
|
||||
color(hdr_pin_colour(type))
|
||||
rotate_extrude(angle = 90, $fn = 32)
|
||||
translate([0, -pw / 2])
|
||||
square(pw);
|
||||
}
|
||||
}
|
||||
if(show_plugs)
|
||||
color(housing_colour)
|
||||
translate_z(base)
|
||||
linear_extrude(housing_height)
|
||||
square([cols * pitch, rows * pitch], center = true);
|
||||
|
||||
translate([0, right_angle ? ra_offset + (rows - 1) * pitch / 2 : 0, right_angle ? l / 2 : 0])
|
||||
rotate([right_angle ? -90 : 0, 0, 0]) {
|
||||
color(hdr_base_colour(type)) {
|
||||
linear_extrude(base)
|
||||
square([w, l], center = true);
|
||||
|
||||
linear_extrude(h)
|
||||
difference() {
|
||||
square([w, l], center = true);
|
||||
|
||||
square([w - t, l - t], center = true);
|
||||
|
||||
translate([0, -l / 2])
|
||||
square([4.5, 4.5], center = true);
|
||||
}
|
||||
}
|
||||
if(show_plugs)
|
||||
color(housing_colour)
|
||||
translate_z(base)
|
||||
linear_extrude(housing_height)
|
||||
square([cols * pitch, rows * pitch], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user