From abea476c152f402622f30caace72f18fb219eaea Mon Sep 17 00:00:00 2001 From: xengineering Date: Sat, 23 Dec 2023 20:45:06 +0100 Subject: mech: pcb_case: Fix bug if no sockets are given --- mech/pcb_case/shell.scad | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'mech') diff --git a/mech/pcb_case/shell.scad b/mech/pcb_case/shell.scad index d60248b..ff34061 100644 --- a/mech/pcb_case/shell.scad +++ b/mech/pcb_case/shell.scad @@ -58,13 +58,14 @@ module pcb_case_shell(dim, t, h, sockets) { union() { shell_base(dim, t); shell_connector(dim, t); - for (socket = [0:len(sockets)-1]) { - translate([sockets[socket][0], sockets[socket][1], 0]) + for (socket = sockets) { + echo(socket=socket); + translate([socket[0], socket[1], 0]) cylinder(d=nut_d+2, h=h); } } - for (socket = [0:len(sockets)-1]) { - translate([sockets[socket][0], sockets[socket][1], 0]) { + for (socket = sockets) { + translate([socket[0], socket[1], 0]) { cylinder(d=bolt_d, h=h); cylinder(d=0.9*nut_d, h=nut_h); } -- cgit v1.2.3-70-g09d2