1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-13 18:24:28 +02:00

added edge_aligned_sections

This commit is contained in:
Justin Lin
2019-05-17 10:00:04 +08:00
parent a3e2077b46
commit 1a92c27b28

View File

@@ -0,0 +1,18 @@
function edge_aligned_sections(shape_pts, edge_path) =
let(
start_point = edge_path[0],
base_leng = norm(start_point),
scaling_matrice = [
for(p = edge_path)
let(s = norm([p[0], p[1], 0]) / base_leng)
m_scaling([s, s, 1])
]
)
[
for(i = [0:len(edge_path) - 1])
[
for(p = shape_pts)
let(scaled_p = scaling_matrice[i] * [p[0], p[1], edge_path[i][2], 1])
[scaled_p[0], scaled_p[1], scaled_p[2]]
]
];