Can now have PCB screw holes without screws for RAMPS endstop.

This commit is contained in:
Chris Palmer 2020-03-07 22:11:09 +00:00
parent c16a1c3804
commit b56ddea1e3
4 changed files with 16 additions and 13 deletions

View File

@ -1982,7 +1982,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | ```molex_254(2)``` | Molex KK header 2 way |
| 1 | ```molex_254(3)``` | Molex KK header 3 way |
| 16 | ```nut(M2_nut, nyloc = true)``` | Nut M2 x 1.6mm nyloc |
| 32 | ```nut(M2p5_nut, nyloc = true)``` | Nut M2.5 x 2.2mm nyloc |
| 30 | ```nut(M2p5_nut, nyloc = true)``` | Nut M2.5 x 2.2mm nyloc |
| 12 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
| 12 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
| 1 | ```pcb(PI_IO)``` | PI_IO V2 |
@ -1997,7 +1997,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | ```pcb(RPI3)``` | Raspberry Pi 3 |
| 1 | ```pcb(RPI0)``` | Raspberry Pi Zero |
| 16 | ```screw(M2_cap_screw, 25)``` | Screw M2 cap x 25mm |
| 4 | ```screw(M2p5_cap_screw, 16)``` | Screw M2.5 cap x 16mm |
| 2 | ```screw(M2p5_cap_screw, 16)``` | Screw M2.5 cap x 16mm |
| 12 | ```screw(M2p5_cap_screw, 20)``` | Screw M2.5 cap x 20mm |
| 4 | ```screw(M2p5_pan_screw, 20)``` | Screw M2.5 pan x 20mm |
| 8 | ```screw(M2p5_pan_screw, 25)``` | Screw M2.5 pan x 25mm |
@ -2009,7 +2009,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 2 | ```green_terminal(gt_2p54, 4)``` | Terminal block 4 way 0.1" |
| 1 | | USB A to Mini B lead |
| 16 | ```washer(M2_washer)``` | Washer M2 x 5mm x 0.3mm |
| 32 | ```washer(M2p5_washer)``` | Washer M2.5 x 5.9mm x 0.5mm |
| 30 | ```washer(M2p5_washer)``` | Washer M2.5 x 5.9mm x 0.5mm |
| 12 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
| 12 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
| 1 | ```pcb(ZC_A0591)``` | ZC-A0591 ULN2003 driver PCB |
@ -2026,7 +2026,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 4 | pcb_spacer25120_2.stl |
| 4 | pcb_spacer25130_2.stl |
| 4 | pcb_spacer25240.stl |
| 4 | pcb_spacer2550.stl |
| 2 | pcb_spacer2550.stl |
| 4 | pcb_spacer2580.stl |
| 4 | pcb_spacer2590.stl |
| 4 | pcb_spacer30180.stl |

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 143 KiB

View File

@ -63,17 +63,20 @@ function pcb_coord(type, p) = let(l = pcb_length(type), w = pcb_width(type)) //!
[(p.x >= 0 ? p.x : l + p.x) - l / 2,
(p.y >= 0 ? p.y : w + p.y) - w / 2];
module pcb_screw_positions(type) { //! Positions children at the mounting hole positions
module pcb_hole_positions(type, all = true) { // Positition children at the hole positions, including holes not used for screws
holes = pcb_holes(type);
if(len(holes))
for($i = [0 : len(holes) - 1]) {
p = pcb_coord(type, holes[$i]);
translate([p.x, p.y, 0])
for($i = [0 : 1 : len(holes) - 1]) {
hole = holes[$i];
if(len(hole) == 2 || all)
translate(pcb_coord(type, hole))
children();
}
}
}
module pcb_screw_positions(type) //! Positions children at the mounting hole positions
pcb_hole_positions(type, false) children();
module chip(length, width, thickness, colour, cutout = false) //! Draw a coloured cube to represent a chip, or other rectangular component
if(!cutout)
color(colour)
@ -837,7 +840,7 @@ module pcb(type) { //! Draw specified PCB
else
rounded_square([pcb_length(type), pcb_width(type)], r = pcb_radius(type));
pcb_screw_positions(type)
pcb_hole_positions(type)
circle(d = pcb_hole_d(type) + eps);
if(Len(grid))
@ -847,7 +850,7 @@ module pcb(type) { //! Draw specified PCB
color("silver")
translate_z(t / 2)
pcb_screw_positions(type)
pcb_hole_positions(type)
tube(or = max(pcb_land_d(type), 1) / 2, ir = pcb_hole_d(type) / 2, h = t + 2 * eps);
fr4 = pcb_colour(type) != "sienna";

View File

@ -342,7 +342,7 @@ PSU12V1A = ["PSU12V1A", "PSU 12V 1A", 67, 31, 1.7, 0, 3.9, 0, "green", true, [[3
RAMPSEndstop = ["RAMPSEndstop", "RAMPS Endstop Switch",
40.0, 16.0, 1.6, 0.5, 2.54, 0, "red", false,
[
[2, 2], [2, 13.5], [17, 13.5], [36, 13.5]
[2, 2, false], [2, 13.5, false], [17, 13.5], [36, 13.5]
],
[
[ 12, 8, -90, "jst_xh", 3, true, "white", "silver"],