1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-03-14 19:59:45 +01:00

Can now make perfboards with screws holes only at one end.

I.e. for making models of chopped down boards.
This commit is contained in:
Chris Palmer 2021-09-14 10:09:58 +01:00
parent 24b391578b
commit 119c2cb6f4

View File

@ -1196,9 +1196,10 @@ module pcb(type) { //! Draw specified PCB
}
if(fr4 && len(grid) < 3 && pcb_holes(type)) { // oval lands at the ends
screw_x = pcb_coord(type, pcb_holes(type)[0]).x;
both_ends = len(pcb_holes(type)) > 2;
y0 = pcb_grid(type).y;
rows = round((pcb_width(type) - 2 * y0) / inch(0.1));
for(end = [-1, 1], y = [1 : rows - 1])
for(end = both_ends ? [-1, 1] : [1], y = [1 : rows - 1])
translate([end * screw_x, y0 + y * inch(0.1) - pcb_width(type) / 2])
hull()
for(x = [-1, 1])