1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-08 07:46:39 +02:00

add tf_bend

This commit is contained in:
Justin Lin
2020-02-17 14:30:46 +08:00
parent afd337e84f
commit cd46a948df

View File

@@ -0,0 +1,18 @@
/*
size: The size of the rectangle which can contain the point.
point: A point in the rectangle.
radius: The radius of the arc after being bent
angle: The central angle of the arc.
*/
function tf_bend(size, point, radius, angle) =
let(
xlen = size[0],
// ignored
// ylen = size[1],
y = point[0],
z = point[1],
a_step = angle / xlen,
a = a_step * y
)
[radius * cos(a), radius * sin(a), z];