From e46d5040196199fbff097c572df8b47117d1a9d3 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Wed, 24 May 2017 13:15:17 +0800 Subject: [PATCH] supported 2d points --- src/bezier_curve.scad | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bezier_curve.scad b/src/bezier_curve.scad index 20f5e826..9f09cb62 100644 --- a/src/bezier_curve.scad +++ b/src/bezier_curve.scad @@ -12,6 +12,8 @@ * **/ +include <__private__/__to2d.scad>; + function _combi(n, k) = let( bi_coef = [ @@ -56,4 +58,5 @@ function bezier_curve(t_step, points) = for(t = [0: t_step: 1]) _bezier_curve_point(t, points) ], [_bezier_curve_point(1, points)]) - ) pts; \ No newline at end of file + ) + len(points[0]) == 3 ? pts : [for(pt = pts) __to2d(pt)]; \ No newline at end of file