1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-06 23:06:43 +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) =
let(
p = point - size / 2,
leng = norm(p)
)
leng == 0 ? [0, 0] :
let(p = point - size / 2)
p == [0, 0] ? p :
let(
n = max(abs(p.x), abs(p.y)),
r = n * 1.41421356237
)
[p.y, p.x] * (r / leng);
[p.y, p.x] * (r / norm(p));