From c07d61b9b6c91ca33d6e8227bbb1f0969e61fe77 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Mon, 22 May 2017 07:52:10 +0800 Subject: [PATCH] change parameter name and support single value --- src/arc.scad | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/arc.scad b/src/arc.scad index 989c94fd..d43f1d8d 100644 --- a/src/arc.scad +++ b/src/arc.scad @@ -13,9 +13,10 @@ **/ include <__private__/__frags.scad>; +include <__private__/__is_vector.scad>; include <__private__/__ra_to_xy.scad>; -module arc(radius, angles, width, width_mode = "LINE_CROSS") { +module arc(radius, angle, width, width_mode = "LINE_CROSS") { w_offset = width_mode == "LINE_CROSS" ? [width / 2, -width / 2] : ( width_mode == "LINE_INWARD" ? [0, -width] : [width, 0] @@ -26,6 +27,8 @@ module arc(radius, angles, width, width_mode = "LINE_CROSS") { a_step = 360 / frags; half_a_step = a_step / 2; + angles = __is_vector(angle) ? angle : [0, angle]; + m = floor(angles[0] / a_step) + 1; n = floor(angles[1] / a_step);