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

refactor: we don't really need angle

This commit is contained in:
Justin Lin
2022-04-12 19:37:15 +08:00
parent 6548996334
commit 7b3f27358b

View File

@@ -12,8 +12,11 @@ function ptf_circle(size, point) =
let( let(
p_offset = -size / 2, p_offset = -size / 2,
p = point + p_offset, p = point + p_offset,
n = max(abs(p.x), abs(p.y)), leng = norm(p)
r = n * 1.414,
a = atan2(p.x, p.y)
) )
[r * cos(a), r * sin(a)]; leng == 0 ? [0, 0] :
let(
n = max(abs(p.x), abs(p.y)),
r = n * 1.414
)
[p.y, p.x] * (r / leng);