1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-23 14:54:12 +02:00

add tf_x_twist

This commit is contained in:
Justin Lin
2020-02-13 08:04:45 +08:00
parent 6a9e1e7b06
commit 1900801cad

View File

@@ -0,0 +1,16 @@
use <rotate_p.scad>;
/*
size: The size of a rectangle.
point: A point in the rectangle.
angle: twisted angle.
*/
function tf_x_twist(size, point, angle) =
let(
xlen = size[0],
ylen = size[1],
y_offset = ylen / 2,
a_step = angle / xlen,
y_centered = [point[0], point[1], 0] + [0, -y_offset, 0]
)
rotate_p(y_centered, [point[0] * a_step, 0, 0]) + [0, y_offset, 0];