From 4e4c06b8608f7914c051dc90ca83eb75a0dab891 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Thu, 18 May 2017 09:39:51 +0800 Subject: [PATCH] refactored --- src/function_grapher.scad | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/function_grapher.scad b/src/function_grapher.scad index 7724cc28..1e6d9c90 100644 --- a/src/function_grapher.scad +++ b/src/function_grapher.scad @@ -15,6 +15,8 @@ * **/ +include <__private__/__reverse.scad>; + module function_grapher(points, thickness, style = "FACES", slicing = "SLASH") { rows = len(points); @@ -24,12 +26,6 @@ module function_grapher(points, thickness, style = "FACES", slicing = "SLASH") { module faces() { function xy_to_index(x, y, columns) = y * columns + x; - function reverse(vt) = - let(leng = len(vt)) - [ - for(i = [0:leng - 1]) - vt[leng - 1 - i] - ]; top_pts = [ for(row_pts = points) @@ -82,12 +78,12 @@ module function_grapher(points, thickness, style = "FACES", slicing = "SLASH") { base_tri_faces1 = [ for(face = top_tri_faces1) - reverse(face) + [leng_pts, leng_pts, leng_pts] + __reverse(face) + [leng_pts, leng_pts, leng_pts] ]; base_tri_faces2 = [ for(face = top_tri_faces2) - reverse(face) + [leng_pts, leng_pts, leng_pts] + __reverse(face) + [leng_pts, leng_pts, leng_pts] ]; side_faces1 = [