1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-06 23:06:43 +02:00

changed parameter, supported single value

This commit is contained in:
Justin Lin
2017-05-22 09:32:12 +08:00
parent cda3805f1a
commit f560cdfedf

View File

@@ -13,6 +13,7 @@
**/
include <__private__/__frags.scad>;
include <__private__/__is_vector.scad>;
include <__private__/__ra_to_xy.scad>;
function _edge_r_begin(orig_r, a, a_step, m) =
@@ -23,7 +24,7 @@ function _edge_r_end(orig_r, a, a_step, n) =
let(leng = orig_r * cos(a_step / 2))
leng / cos((n + 0.5) * a_step - a);
function shape_arc(radius, angles, width, width_mode = "LINE_CROSS") =
function shape_arc(radius, angle, width, width_mode = "LINE_CROSS") =
let(
w_offset = width_mode == "LINE_CROSS" ? [width / 2, -width / 2] : (
width_mode == "LINE_INWARD" ? [0, -width] : [width, 0]
@@ -31,6 +32,7 @@ function shape_arc(radius, angles, width, width_mode = "LINE_CROSS") =
frags = __frags(radius),
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),
r_outer = radius + w_offset[0],