1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-11 09:14:29 +02:00

supported tape triangles

This commit is contained in:
Justin Lin
2017-05-09 15:01:02 +08:00
parent 7441f0f381
commit ec05ea95a0
2 changed files with 13 additions and 7 deletions

View File

@@ -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]
]
);

View File

@@ -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