diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2023-01-15 20:47:14 +0100 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2023-01-15 20:47:14 +0100 |
commit | e91581d515b0ac1489669e02b14046ed8fd095be (patch) | |
tree | dd8551ceacb60268f35814d1287f3ca5d5f6e2c1 | |
parent | 3a2f90b4c45055184221a64e35127398edf0a26d (diff) | |
download | oscad_gridfinity-e91581d515b0ac1489669e02b14046ed8fd095be.tar.gz |
more functions
-rw-r--r-- | gridfinity.scad | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gridfinity.scad b/gridfinity.scad index 31ba3c9..a26e758 100644 --- a/gridfinity.scad +++ b/gridfinity.scad @@ -1,4 +1,4 @@ -$fn = 30; +$fn = 50; // https://gridfinity.xyz/specification/ @@ -13,12 +13,19 @@ minimal_thickness = 1.5; function gf_top(units_z) = max(units_z * height - 4.75, minimal_thickness) + 4.75; +function gf_top_vec(units_z) = + [0,0,gf_top(units_z)]; + // Get center of GridFinity object function gf_center(units_x, units_y) = [ (units_x * width - 0.5) / 2 - width/2, (units_y * width - 0.5) / 2 - width/2 ]; +function flatten(l) = [ for (a = l) for (b = a) b ] ; +function gf_top_center(units_x, units_y, units_z) = + flatten([gf_center(units_x,units_y),gf_top(units_z)]); + module rounding(r,angle) { rotate(angle,[0,0,1]) translate([-r + 0.01, -r + 0.01]) |