1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-02-12 11:20:48 +01:00
dotSCAD/src/ptf/ptf_circle.scad

9 lines
263 B
OpenSCAD
Raw Normal View History

2020-03-24 17:45:30 +08:00
function ptf_circle(size, point) =
2020-03-11 09:48:34 +08:00
let(
2020-03-24 17:45:30 +08:00
p_offset = -size / 2,
p = [point[0] + p_offset[1], point[1] + p_offset[0]],
2020-03-11 09:48:34 +08:00
n = max(abs(p[0]), abs(p[1])),
r = n * 1.414,
a = atan2(p[0], p[1])
)
[r * cos(a), r * sin(a)];