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:
18
src/experimental/tf_bend.scad
Normal file
18
src/experimental/tf_bend.scad
Normal 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];
|
Reference in New Issue
Block a user