From 68234d60792031c95adc3a3cb6c4b9e2e3d1e185 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Tue, 18 Feb 2020 15:03:11 +0800 Subject: [PATCH] accept 3D point --- src/experimental/tf_sphere.scad | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/experimental/tf_sphere.scad b/src/experimental/tf_sphere.scad index 0a98c686..1b7abb35 100644 --- a/src/experimental/tf_sphere.scad +++ b/src/experimental/tf_sphere.scad @@ -10,13 +10,14 @@ function tf_sphere(size, point, radius, angle = [180, 360]) = let( x = point[0], y = point[1], + z = is_undef(point[2]) ? 0 : point[2], za = angle[0], xa = angle[1], xlen = size[0], ylen = size[1], za_step = za / ylen, rza = za_step * y, - rzpt = [radius * cos(rza), radius * sin(rza), 0], + rzpt = [(radius + z) * cos(rza), (radius + z) * sin(rza), 0], rxpt = rotate_p(rzpt, [xa / xlen * x, 0, 0]) ) rxpt; \ No newline at end of file