From 1c15ab28054dfb6b52d92b46b12dfa0e51d80f00 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Mon, 12 Jun 2017 12:49:19 +0800 Subject: [PATCH] added test hook for "faces" --- src/function_grapher.scad | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/function_grapher.scad b/src/function_grapher.scad index a2cd63cc..332666ab 100644 --- a/src/function_grapher.scad +++ b/src/function_grapher.scad @@ -144,17 +144,23 @@ module function_grapher(points, thickness, style = "FACES", slicing = "SLASH") { ] ]; - polyhedron( - points = concat(top_pts, base_pts), - faces = concat( + pts = concat(top_pts, base_pts); + face_idxs = concat( top_tri_faces1, top_tri_faces2, base_tri_faces1, base_tri_faces2, side_faces1, side_faces2, side_faces3, side_faces4 - ) - ); + ); + + polyhedron( + points = pts, + faces = face_idxs + ); + + // hook for testing + test_function_grapher_faces(pts, face_idxs); } module tri_to_lines(tri1, tri2) { @@ -220,4 +226,9 @@ module function_grapher(points, thickness, style = "FACES", slicing = "SLASH") { } } } +} + +// override it to test +module test_function_grapher_faces(points, faces) { + } \ No newline at end of file