From f71d6271675282f121cca286a932cab236f8f542 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Mon, 23 Jan 2023 21:22:23 +0100 Subject: add fill option --- README.md | 8 +++++--- gridfinity.scad | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d3326c7..66a43fb 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,11 @@ Create fully parameterized Templates for GridFinity. `gridfinity(, , , lip=<>, magnets=<>);` * **x, y** Vertical size in *GridFinity* units -* **z** Height in GridFinity units (`z * 7mm`). This in excluding the base and stacking lip. -* **lip** `true/false` Sets wether to put a stacking lip on top. Only works with z >= 1. -* **magnets** `true/false` Sets wether to put holes for magnets in the base. +* **z** Height in GridFinity units (`z * 7mm`). This is excluding the base and stacking lip. +* **lip** `true/false` Sets wether to put a stacking lip on top. Only works with z >= 1. Default `true` +* **magnets** `true/false` Sets wether to put holes for magnets in the base. Default `false` +* **fill** `true/false` Sets wether the created object is solid or hollow. Default `true` +* **bottom_height** Height offset for floor. Only applicable, if `fill == false`. Default `0` ## Example diff --git a/gridfinity.scad b/gridfinity.scad index a26e758..c67fe3c 100644 --- a/gridfinity.scad +++ b/gridfinity.scad @@ -148,7 +148,7 @@ module bottom_cutout(units_x, units_y) { } } -module gridfinity(units_x, units_y, units_z, lip = true, magnets = false) { +module gridfinity(units_x, units_y, units_z, lip = true, magnets = false, fill = true, bottom_height = 0) { units_x = floor(abs(units_x)); units_y = floor(abs(units_y)); units_z = floor(abs(units_z)); @@ -167,7 +167,19 @@ module gridfinity(units_x, units_y, units_z, lip = true, magnets = false) { linear_extrude(extr) rounded_square(units_x * width - 0.5, units_y * width - 0.5, rounding); } - bottom_cutout(units_x, units_y); + union(){ + bottom_cutout(units_x, units_y); + + // remove solid block if set, leave walls + if (! fill) { + wall_thickness = 2.95; // thickness of stacking lip + extr = units_z * height - (4.75 + minimal_thickness) - bottom_height + 0.01; + + translate([coord_centered(units_x), coord_centered(units_y), 4.75 + minimal_thickness + bottom_height]) + linear_extrude(extr) + rounded_square(units_x * width - wall_thickness * 2, units_y * width - wall_thickness * 2, 0.7); + } + } } // Stacking Lip -- cgit v1.2.3