From f915b072897370e0e7c0d068fc3bf124351154a2 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Sat, 29 Jun 2019 17:53:38 +0800 Subject: [PATCH] rename --- src/pixel/px_cylinder.scad | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/pixel/px_cylinder.scad b/src/pixel/px_cylinder.scad index 18a518bd..c9c97ea3 100644 --- a/src/pixel/px_cylinder.scad +++ b/src/pixel/px_cylinder.scad @@ -1,4 +1,4 @@ -function _px_cylinder_px_circle(radius, filled, width) = +function _px_cylinder_px_circle(radius, filled, thickness) = let(range = [-radius: radius - 1]) filled ? [ for(y = range) @@ -6,7 +6,7 @@ function _px_cylinder_px_circle(radius, filled, width) = let(v = [x, y]) if(norm(v) < radius) v ] : - let(ishell = radius * radius - 2 * width * radius) + let(ishell = radius * radius - 2 * thickness * radius) [ for(y = range) for(x = range) @@ -17,24 +17,24 @@ function _px_cylinder_px_circle(radius, filled, width) = if(leng < radius && (leng * leng) > ishell) v ]; -function _px_cylinder_diff_r(r, h, filled, width) = +function _px_cylinder_diff_r(r, h, filled, thickness) = let( r1 = r[0], r2 = r[1] ) - r1 == r2 ? _px_cylinder_same_r(r1, h, filled, width) : + r1 == r2 ? _px_cylinder_same_r(r1, h, filled, thickness) : let(dr = (r2 - r1) / (h - 1)) [ for(i = 0; i < h; i = i + 1) let(r = round(r1 + dr * i)) each [ - for(pt = _px_cylinder_px_circle(r, filled, width)) + for(pt = _px_cylinder_px_circle(r, filled, thickness)) [pt[0], pt[1], i] ] ]; -function _px_cylinder_same_r(r, h, filled, width) = - let(c = _px_cylinder_px_circle(r, filled, width)) +function _px_cylinder_same_r(r, h, filled, thickness) = + let(c = _px_cylinder_px_circle(r, filled, thickness)) [ for(i = 0; i < h; i = i + 1) each [ @@ -43,7 +43,7 @@ function _px_cylinder_same_r(r, h, filled, width) = ] ]; -function px_cylinder(r, h, filled = true, width = 1) = +function px_cylinder(r, h, filled = true, thickness = 1) = is_num(r) ? - _px_cylinder_same_r(r, h, filled, width) : - _px_cylinder_diff_r(r, h, filled, width); \ No newline at end of file + _px_cylinder_same_r(r, h, filled, thickness) : + _px_cylinder_diff_r(r, h, filled, thickness); \ No newline at end of file