aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gridfinity.scad9
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])