diff --git a/src/edge_aligned_sections.scad b/src/edge_aligned_sections.scad new file mode 100644 index 00000000..db8f38ab --- /dev/null +++ b/src/edge_aligned_sections.scad @@ -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]] + ] + ]; \ No newline at end of file