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