From 29b5c227668143b1020eab1345330a68ea430a04 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Thu, 6 Aug 2020 08:25:56 +0800 Subject: [PATCH] add deprecated msg --- src/pixel/px_ascii.scad | 5 ++++- src/pixel/px_circle.scad | 5 ++++- src/pixel/px_cylinder.scad | 5 ++++- src/pixel/px_from.scad | 6 +++++- src/pixel/px_gray.scad | 3 +++ src/pixel/px_line.scad | 6 +++++- src/pixel/px_polygon.scad | 5 ++++- src/pixel/px_polyline.scad | 1 + src/pixel/px_sphere.scad | 5 ++++- 9 files changed, 34 insertions(+), 7 deletions(-) diff --git a/src/pixel/px_ascii.scad b/src/pixel/px_ascii.scad index 8d805f76..551ecccb 100644 --- a/src/pixel/px_ascii.scad +++ b/src/pixel/px_ascii.scad @@ -11,7 +11,10 @@ use ; function px_ascii(char, center = false, invert = false) = - let(code = ord(char)) + let( + _ = echo("pixel/px_ascii is deprecated: use voxel/vx_ascii instead."), + code = ord(char) + ) assert(code > 31 && code < 127, "not printable character") let( idx = code - 32, diff --git a/src/pixel/px_circle.scad b/src/pixel/px_circle.scad index 576ba4e4..d55c8040 100644 --- a/src/pixel/px_circle.scad +++ b/src/pixel/px_circle.scad @@ -13,5 +13,8 @@ use <../util/sort.scad>; use <../util/dedup.scad>; function px_circle(radius, filled = false) = - let(all = _px_circle_impl(radius, filled)) + let( + _ = echo("pixel/px_circle is deprecated: use voxel/vx_circle instead."), + all = _px_circle_impl(radius, filled) + ) dedup(sort(all, by = "vt"), sorted = true); \ No newline at end of file diff --git a/src/pixel/px_cylinder.scad b/src/pixel/px_cylinder.scad index d2ede64e..63cf6352 100644 --- a/src/pixel/px_cylinder.scad +++ b/src/pixel/px_cylinder.scad @@ -13,5 +13,8 @@ use <../util/sort.scad>; use <../util/dedup.scad>; function px_cylinder(r, h, filled = false, thickness = 1) = - let(all = _px_cylinder_impl(r, h, filled, thickness)) + let( + _ = echo("pixel/px_cylinder is deprecated: use voxel/vx_cylinder instead."), + all = _px_cylinder_impl(r, h, filled, thickness) + ) dedup(sort(all, by = "vt"), sorted = true); \ No newline at end of file diff --git a/src/pixel/px_from.scad b/src/pixel/px_from.scad index 324a677b..040512ef 100644 --- a/src/pixel/px_from.scad +++ b/src/pixel/px_from.scad @@ -10,4 +10,8 @@ use <_impl/_px_from_impl.scad>; -function px_from(binaries, center = false, invert = false) = _px_from_impl(binaries, center, invert); \ No newline at end of file +function px_from(binaries, center = false, invert = false) = + let( + _ = echo("pixel/px_from is deprecated: use voxel/vx_from instead.") + ) + _px_from_impl(binaries, center, invert); \ No newline at end of file diff --git a/src/pixel/px_gray.scad b/src/pixel/px_gray.scad index 3c8a9d7e..15e9ba2b 100644 --- a/src/pixel/px_gray.scad +++ b/src/pixel/px_gray.scad @@ -11,4 +11,7 @@ use <_impl/_px_gray_impl.scad>; function px_gray(levels, center = false, invert = false, normalize = false) = + let( + _ = echo("pixel/px_gray is deprecated: use voxel/vx_gray instead.") + ) _px_gray_impl(levels, center, invert, normalize); \ No newline at end of file diff --git a/src/pixel/px_line.scad b/src/pixel/px_line.scad index 521de53b..52ae407a 100644 --- a/src/pixel/px_line.scad +++ b/src/pixel/px_line.scad @@ -10,4 +10,8 @@ use <_impl/_px_line_impl.scad>; -function px_line(p1, p2) = _px_line_impl(p1, p2); \ No newline at end of file +function px_line(p1, p2) = + let( + _ = echo("pixel/px_line is deprecated: use voxel/vx_line instead.") + ) + _px_line_impl(p1, p2); \ No newline at end of file diff --git a/src/pixel/px_polygon.scad b/src/pixel/px_polygon.scad index c463d015..ae176a50 100644 --- a/src/pixel/px_polygon.scad +++ b/src/pixel/px_polygon.scad @@ -4,7 +4,10 @@ use <../util/dedup.scad>; use ; function px_polygon(points, filled = false) = - let(contour = px_polyline(concat(points, [points[0]]))) + let( + _ = echo("pixel/px_polygon is deprecated: use voxel/vx_polygon instead."), + contour = px_polyline(concat(points, [points[0]])) + ) !filled ? contour : let( sortedXY = sort(contour, by = "vt"), diff --git a/src/pixel/px_polyline.scad b/src/pixel/px_polyline.scad index eae8c3b9..9c33be9b 100644 --- a/src/pixel/px_polyline.scad +++ b/src/pixel/px_polyline.scad @@ -17,6 +17,7 @@ use ; function px_polyline(points) = let( + _ = echo("pixel/px_polyline is deprecated: use voxel/vx_polyline instead."), is_2d = len(points[0]) == 2, pts = is_2d ? [for(pt = points) __to3d(pt)] : points, polyline = [for(line = __lines_from(pts)) each px_line(line[0], line[1])] diff --git a/src/pixel/px_sphere.scad b/src/pixel/px_sphere.scad index f25e9de3..9475be12 100644 --- a/src/pixel/px_sphere.scad +++ b/src/pixel/px_sphere.scad @@ -9,7 +9,10 @@ **/ function px_sphere(radius, filled = false, thickness = 1) = - let(range = [-radius: radius - 1]) + let( + _ = echo("pixel/px_sphere is deprecated: use voxel/vx_sphere instead."), + range = [-radius: radius - 1] + ) filled ? [ for(z = range) for(y = range)