1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-31 10:11:53 +02:00

accept 3D point

This commit is contained in:
Justin Lin
2020-02-18 15:03:11 +08:00
parent 02fac4ea5c
commit 68234d6079

View File

@@ -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;