1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-18 12:31:17 +02:00

changed parameter and supported single value

This commit is contained in:
Justin Lin
2017-05-22 09:28:26 +08:00
parent e923eb4c03
commit 90eec1e53d

View File

@@ -13,13 +13,15 @@
**/ **/
include <__private__/__frags.scad>; include <__private__/__frags.scad>;
include <__private__/__is_vector.scad>;
include <__private__/__ra_to_xy.scad>; include <__private__/__ra_to_xy.scad>;
function shape_pie(radius, angles) = function shape_pie(radius, angle) =
let( let(
frags = __frags(radius), frags = __frags(radius),
a_step = 360 / frags, a_step = 360 / frags,
leng = radius * cos(a_step / 2), leng = radius * cos(a_step / 2),
angles = __is_vector(angle) ? angle : [0:angle],
m = floor(angles[0] / a_step) + 1, m = floor(angles[0] / a_step) + 1,
n = floor(angles[1] / a_step), n = floor(angles[1] / a_step),
edge_r_begin = leng / cos((m - 0.5) * a_step - angles[0]), edge_r_begin = leng / cos((m - 0.5) * a_step - angles[0]),