diff --git a/src/__private__/__triangles_tape.scad b/src/__private__/__triangles_tape.scad index 056013b7..1019dc8c 100644 --- a/src/__private__/__triangles_tape.scad +++ b/src/__private__/__triangles_tape.scad @@ -1,11 +1,12 @@ -function __triangles_tape(leng_pts) = +function __triangles_tape(shape_pts) = + let(leng = len(shape_pts)) concat( [ - for(i = [0:leng_pts / 2 - 2]) - [i, leng_pts - i - 1, leng_pts - i - 2] + for(i = [0:leng / 2 - 2]) + [i, leng - i - 1, leng - i - 2] ], [ - for(i = [0:leng_pts / 2 - 2]) - [i, i + 1, leng_pts - i - 2] + for(i = [0:leng / 2 - 2]) + [i, i + 1, leng - i - 2] ] ); \ No newline at end of file diff --git a/src/polysections.scad b/src/polysections.scad index c8c43c15..a71f3197 100644 --- a/src/polysections.scad +++ b/src/polysections.scad @@ -12,6 +12,7 @@ **/ include <__private__/__triangles_radial.scad>; +include <__private__/__triangles_tape.scad>; module polysections(sections, triangles = "RADIAL") { module tri_sections(tri1, tri2) { @@ -46,8 +47,12 @@ module polysections(sections, triangles = "RADIAL") { ) flat(pair_idxes); function tris() = triangles == "RADIAL" ? __triangles_radial(sections[0]) : - (triangles == "HOLLOW" ? hollow_tris() : triangles); - + ( + triangles == "HOLLOW" ? hollow_tris() : ( + triangles == "TAPE" ? __triangles_tape(sections[0]) : triangles + ) + ); + module two_sections(section1, section2) { for(idx = tris()) { // hull is for preventing from WARNING: Object may not be a valid 2-manifold