From 3a2f90b4c45055184221a64e35127398edf0a26d Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Sun, 15 Jan 2023 01:26:12 +0100 Subject: helper functions --- gridfinity.scad | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gridfinity.scad') diff --git a/gridfinity.scad b/gridfinity.scad index 2ebd8a1..31ba3c9 100644 --- a/gridfinity.scad +++ b/gridfinity.scad @@ -9,6 +9,16 @@ rounding = 3.75; minimal_thickness = 1.5; +// Get top of GridFinity object from GF units +function gf_top(units_z) = + max(units_z * height - 4.75, minimal_thickness) + 4.75; + +// 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 +]; + module rounding(r,angle) { rotate(angle,[0,0,1]) translate([-r + 0.01, -r + 0.01]) -- cgit v1.2.3