From 5111b1f0d41b80945f36b8641744bae553f22f37 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Thu, 15 Jun 2017 10:37:17 +0800 Subject: [PATCH] refactored --- src/polysections.scad | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/polysections.scad b/src/polysections.scad index 0194aca6..93528912 100644 --- a/src/polysections.scad +++ b/src/polysections.scad @@ -171,18 +171,23 @@ module polysections(sections, triangles = "SOLID") { the_same_after_twisting(first_inner_sect, last_inner_sect, leng_pts_sect) ); + v_pts = concat(outer_v_pts, inner_v_pts); + if(begin_end_the_same()) { + f_idxes = concat(outer_idxes, inner_idxes); + polyhedron( - concat(outer_v_pts, inner_v_pts), - concat(outer_idxes, inner_idxes) + v_pts, + f_idxes ); } else { first_idxes = first_idxes(); last_idxes = last_idxes(half_leng_v_pts - half_leng_sect); - + + f_idxes = concat(first_idxes, outer_idxes, inner_idxes, last_idxes); polyhedron( - concat(outer_v_pts, inner_v_pts), - concat(first_idxes, outer_idxes, inner_idxes, last_idxes) + v_pts, + f_idxes ); } }