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

compare to [0, 0]

This commit is contained in:
Justin Lin
2022-05-15 09:42:53 +08:00
parent 9e74b763e6
commit 762c8b6859

View File

@@ -9,13 +9,10 @@
**/ **/
function ptf_circle(size, point) = function ptf_circle(size, point) =
let( let(p = point - size / 2)
p = point - size / 2, p == [0, 0] ? p :
leng = norm(p)
)
leng == 0 ? [0, 0] :
let( let(
n = max(abs(p.x), abs(p.y)), n = max(abs(p.x), abs(p.y)),
r = n * 1.41421356237 r = n * 1.41421356237
) )
[p.y, p.x] * (r / leng); [p.y, p.x] * (r / norm(p));