diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2023-01-13 17:17:33 +0100 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2023-01-13 17:17:33 +0100 |
commit | 1d6da26a5370e399ff1d5a48575b6d03b8d36a85 (patch) | |
tree | 27149de5766816dbb7c64aa20dca26c125931b1c | |
parent | b05edd760906d36306482b0dea304c7416a79ae9 (diff) | |
download | oscad_gridfinity-1d6da26a5370e399ff1d5a48575b6d03b8d36a85.tar.gz |
minor fixes and comments
-rw-r--r-- | gridfinity.scad | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gridfinity.scad b/gridfinity.scad index 9c71723..bd9924e 100644 --- a/gridfinity.scad +++ b/gridfinity.scad @@ -87,18 +87,20 @@ module stacking_lip(units_x, units_y) { stacking_lip_negative(units_x, units_y); } } + module gridfinity(units_x, units_y, units_z, lip = true, magnets = false) { for (ux = [0:units_x -1]) { for (uy = [0:units_y -1]) { translate([ux * width, uy * width,0]) base(magnets = magnets); } } - if (units_z > 0) - translate([coord_centered(units_x), coord_centered(units_y), 4.75]) { - extr = units_z * height - 4.75; - linear_extrude(extr) rounded_square(units_x * width - 0.5, units_y * width - 0.5, rounding); + if (units_z > 0) { + translate([coord_centered(units_x), coord_centered(units_y), 4.75]) { + extr = units_z * height - 4.75; + linear_extrude(extr) rounded_square(units_x * width - 0.5, units_y * width - 0.5, rounding); + } } - if (lip) + if (lip && units_z > 0) // Just to safeguard. h=0 is not intended to be used with lip. translate([coord_centered(units_x), coord_centered(units_y), units_z * height]) stacking_lip(units_x, units_y); } |