diff --git a/src/__comm__/_pt2_hash.scad b/src/__comm__/_pt2_hash.scad new file mode 100644 index 00000000..8541c3b0 --- /dev/null +++ b/src/__comm__/_pt2_hash.scad @@ -0,0 +1 @@ +function _pt2_hash(p) = floor(abs(p * [73856093, 19349669])); \ No newline at end of file diff --git a/src/maze/mz_hamiltonian.scad b/src/maze/mz_hamiltonian.scad index c9621f3a..75b9a29c 100644 --- a/src/maze/mz_hamiltonian.scad +++ b/src/maze/mz_hamiltonian.scad @@ -8,6 +8,7 @@ * **/ +use <../__comm__/_pt2_hash.scad>; use <_impl/_mz_hamiltonian_impl.scad>; use ; use ; @@ -40,7 +41,7 @@ function mz_hamiltonian(rows, columns, start = [0, 0], init_cells, seed) = dot_pts = hashset_elems( hashset( all, - hash = function(p) floor(abs(p * [73856093, 19349669])) + hash = function(p) _pt2_hash(p) ) ), falseRow = [for(c = [0:c * 2]) false], diff --git a/src/util/_impl/_parse_number_impl.scad b/src/util/_impl/_parse_number_impl.scad index 518c9c65..434ddec5 100644 --- a/src/util/_impl/_parse_number_impl.scad +++ b/src/util/_impl/_parse_number_impl.scad @@ -6,12 +6,10 @@ function _str_to_int(t) = ord(t) - 48; function _parse_positive_int(t, value = 0, i = 0) = i == len(t) ? value : _parse_positive_int(t, value * pow(10, i) + _str_to_int(t[i]), i + 1); -function _parse_positive_decimal(t, value = 0, i = 0) = - i == len(t) ? value : _parse_positive_decimal(t, value + _str_to_int(t[i]) * pow(10, -(i + 1)), i + 1); - function _parse_positive_number(t) = len(search(".", t)) == 0 ? _parse_positive_int(t) : - _parse_positive_int(split_str(t, ".")[0]) + _parse_positive_decimal(split_str(t, ".")[1]); + let(splitted = split_str(t, ".")) + _parse_positive_int(splitted[0]) + _parse_positive_int(splitted[1]) / 10 ^ (len(splitted[1])); function _parse_number_impl(t) = t[0] == "-" ? -_parse_positive_number(sub_str(t, 1, len(t))) : _parse_positive_number(t); diff --git a/src/voxel/vx_circle.scad b/src/voxel/vx_circle.scad index 8ea90568..f8cd8dac 100644 --- a/src/voxel/vx_circle.scad +++ b/src/voxel/vx_circle.scad @@ -8,8 +8,12 @@ * **/ +use <../__comm__/_pt2_hash.scad>; use <_impl/_vx_circle_impl.scad>; -use <../util/dedup.scad>; +use <../util/set/hashset.scad>; +use <../util/set/hashset_elems.scad>; function vx_circle(radius, filled = false) = - dedup(_vx_circle_impl(radius, filled)); \ No newline at end of file + hashset_elems( + hashset(_vx_circle_impl(radius, filled), hash = function(p) _pt2_hash(p)) + ); \ No newline at end of file diff --git a/src/voxel/vx_polygon.scad b/src/voxel/vx_polygon.scad index 1d4ec30b..2d673a19 100644 --- a/src/voxel/vx_polygon.scad +++ b/src/voxel/vx_polygon.scad @@ -1,7 +1,9 @@ +use <../__comm__/_pt2_hash.scad>; use <../in_shape.scad>; use <../util/sort.scad>; -use <../util/dedup.scad>; use ; +use <../util/set/hashset.scad>; +use <../util/set/hashset_elems.scad>; function vx_polygon(points, filled = false) = let(contour = vx_polyline([each points, points[0]])) @@ -26,4 +28,6 @@ function vx_polygon(points, filled = false) = ] ) ) - dedup(all); \ No newline at end of file + hashset_elems( + hashset(all, hash = function(p) _pt2_hash(p)) + ); \ No newline at end of file diff --git a/src/voxel/vx_polyline.scad b/src/voxel/vx_polyline.scad index 68ce6b10..69ed5677 100644 --- a/src/voxel/vx_polyline.scad +++ b/src/voxel/vx_polyline.scad @@ -11,6 +11,8 @@ use <../__comm__/__to3d.scad>; use <../__comm__/__to2d.scad>; use <../__comm__/__lines_from.scad>; +use <../__comm__/_pt2_hash.scad>; +use <../__comm__/_pt3_hash.scad>; use <../util/dedup.scad>; use ; @@ -20,7 +22,7 @@ function vx_polyline(points) = pts = is_2d ? [for(pt = points) __to3d(pt)] : points, polyline = [for(line = __lines_from(pts)) each vx_line(line[0], line[1])] ) - dedup(is_2d ? - [for(pt = polyline) __to2d(pt)] : - polyline + dedup( + is_2d ? [for(pt = polyline) __to2d(pt)] : polyline, + hash = is_2d ? function(p) _pt2_hash(p) : function(p) _pt3_hash(p) ); \ No newline at end of file diff --git a/src/voxel/vx_union.scad b/src/voxel/vx_union.scad index 8601f819..ca9e5031 100644 --- a/src/voxel/vx_union.scad +++ b/src/voxel/vx_union.scad @@ -9,7 +9,10 @@ **/ use <../__comm__/_pt3_hash.scad>; -use <../util/dedup.scad>; +use <../util/set/hashset.scad>; +use <../util/set/hashset_elems.scad>; function vx_union(points1, points2) = - dedup(concat(points1, points2), hash = function(p) _pt3_hash(p)); \ No newline at end of file + hashset_elems( + hashset(concat(points1, points2), hash = function(p) _pt3_hash(p)) + ); \ No newline at end of file diff --git a/test/test_along_with.scad b/test/test_along_with.scad index 5e324719..0912ae0c 100644 --- a/test/test_along_with.scad +++ b/test/test_along_with.scad @@ -1,4 +1,3 @@ -use ; use ; include ; diff --git a/test/util/test_fibseq.scad b/test/util/test_fibseq.scad index bb0c666a..68dcad9f 100644 --- a/test/util/test_fibseq.scad +++ b/test/util/test_fibseq.scad @@ -1,4 +1,3 @@ -use ; use ; module test_fibseq() { diff --git a/test/util/test_find_index.scad b/test/util/test_find_index.scad index 79547167..4d2b3eba 100644 --- a/test/util/test_find_index.scad +++ b/test/util/test_find_index.scad @@ -1,4 +1,3 @@ -use ; use ; module test_find_index() { diff --git a/test/util/test_parse_number.scad b/test/util/test_parse_number.scad index a13b45f8..6908d842 100644 --- a/test/util/test_parse_number.scad +++ b/test/util/test_parse_number.scad @@ -1,11 +1,10 @@ -use ; use ; module test_parse_number() { echo("==== test_parse_number ===="); - assertEqualNum(11, parse_number("10") + 1); - assertEqualNum(-0.1, parse_number("-1.1") + 1); + assert(11 == parse_number("10") + 1); + assert(-1.1 == parse_number("-1.1")); } test_parse_number(); diff --git a/test/util/test_reverse.scad b/test/util/test_reverse.scad index 2be911ee..d4236739 100644 --- a/test/util/test_reverse.scad +++ b/test/util/test_reverse.scad @@ -1,12 +1,9 @@ -use ; use ; module test_reverse() { echo("==== test_reverse ===="); - lt = [1, 2, 3, 4, 5]; - - assert([5, 4, 3, 2, 1] == reverse(lt)); + assert([5, 4, 3, 2, 1] == reverse([1, 2, 3, 4, 5])); } test_reverse(); \ No newline at end of file diff --git a/test/util/test_shuffle.scad b/test/util/test_shuffle.scad index e6c7c260..f708c517 100644 --- a/test/util/test_shuffle.scad +++ b/test/util/test_shuffle.scad @@ -1,4 +1,3 @@ -use ; use ; module test_shuffle() { diff --git a/test/util/test_slice.scad b/test/util/test_slice.scad index dc1db3a6..4f78228d 100644 --- a/test/util/test_slice.scad +++ b/test/util/test_slice.scad @@ -1,4 +1,3 @@ -use ; use ; module test_slice() { diff --git a/test/util/test_spherical_coordinate.scad b/test/util/test_spherical_coordinate.scad index 4334a805..7a83c52f 100644 --- a/test/util/test_spherical_coordinate.scad +++ b/test/util/test_spherical_coordinate.scad @@ -1,4 +1,3 @@ -use ; use ; module test_spherical_coordinate() { diff --git a/test/util/test_split_str.scad b/test/util/test_split_str.scad index 40df22b7..452e6793 100644 --- a/test/util/test_split_str.scad +++ b/test/util/test_split_str.scad @@ -1,4 +1,3 @@ -use ; use ; module test_split_str() { diff --git a/test/util/test_sub_str.scad b/test/util/test_sub_str.scad index 7236b9ad..01e4b932 100644 --- a/test/util/test_sub_str.scad +++ b/test/util/test_sub_str.scad @@ -1,4 +1,3 @@ -use ; use ; module test_sub_str() { diff --git a/test/voxel/test_vx_circle.scad b/test/voxel/test_vx_circle.scad index 78ddc340..46a5bc00 100644 --- a/test/voxel/test_vx_circle.scad +++ b/test/voxel/test_vx_circle.scad @@ -1,13 +1,12 @@ -use ; use ; module test_vx_circle() { echo("==== test_vx_circle ===="); - expected = [[0, 10], [0, -10], [-10, 0], [-9, 0], [-8, 0], [-7, 0], [-6, 0], [-5, 0], [-4, 0], [-3, 0], [-2, 0], [-1, 0], [0, 0], [1, 0], [2, 0], [3, 0], [4, 0], [5, 0], [6, 0], [7, 0], [8, 0], [9, 0], [10, 0], [-1, -10], [1, -10], [-10, -1], [-9, -1], [-8, -1], [-7, -1], [-6, -1], [-5, -1], [-4, -1], [-3, -1], [-2, -1], [-1, -1], [0, -1], [1, -1], [2, -1], [3, -1], [4, -1], [5, -1], [6, -1], [7, -1], [8, -1], [9, -1], [10, -1], [-10, 1], [-9, 1], [-8, 1], [-7, 1], [-6, 1], [-5, 1], [-4, 1], [-3, 1], [-2, 1], [-1, 1], [0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1], [7, 1], [8, 1], [9, 1], [10, 1], [-1, 10], [1, 10], [-2, -10], [2, -10], [-10, -2], [-9, -2], [-8, -2], [-7, -2], [-6, -2], [-5, -2], [-4, -2], [-3, -2], [-2, -2], [-1, -2], [0, -2], [1, -2], [2, -2], [3, -2], [4, -2], [5, -2], [6, -2], [7, -2], [8, -2], [9, -2], [10, -2], [-10, 2], [-9, 2], [-8, 2], [-7, 2], [-6, 2], [-5, 2], [-4, 2], [-3, 2], [-2, 2], [-1, 2], [0, 2], [1, 2], [2, 2], [3, 2], [4, 2], [5, 2], [6, 2], [7, 2], [8, 2], [9, 2], [10, 2], [-2, 10], [2, 10], [-3, -10], [3, -10], [-10, -3], [-9, -3], [-8, -3], [-7, -3], [-6, -3], [-5, -3], [-4, -3], [-3, -3], [-2, -3], [-1, -3], [0, -3], [1, -3], [2, -3], [3, -3], [4, -3], [5, -3], [6, -3], [7, -3], [8, -3], [9, -3], [10, -3], [-10, 3], [-9, 3], [-8, 3], [-7, 3], [-6, 3], [-5, 3], [-4, 3], [-3, 3], [-2, 3], [-1, 3], [0, 3], [1, 3], [2, 3], [3, 3], [4, 3], [5, 3], [6, 3], [7, 3], [8, 3], [9, 3], [10, 3], [-3, 10], [3, 10], [-4, -9], [-3, -9], [-2, -9], [-1, -9], [0, -9], [1, -9], [2, -9], [3, -9], [4, -9], [-9, -4], [-8, -4], [-7, -4], [-6, -4], [-5, -4], [-4, -4], [-3, -4], [-2, -4], [-1, -4], [0, -4], [1, -4], [2, -4], [3, -4], [4, -4], [5, -4], [6, -4], [7, -4], [8, -4], [9, -4], [-9, 4], [-8, 4], [-7, 4], [-6, 4], [-5, 4], [-4, 4], [-3, 4], [-2, 4], [-1, 4], [0, 4], [1, 4], [2, 4], [3, 4], [4, 4], [5, 4], [6, 4], [7, 4], [8, 4], [9, 4], [-4, 9], [-3, 9], [-2, 9], [-1, 9], [0, 9], [1, 9], [2, 9], [3, 9], [4, 9], [-5, -9], [5, -9], [-9, -5], [-8, -5], [-7, -5], [-6, -5], [-5, -5], [-4, -5], [-3, -5], [-2, -5], [-1, -5], [0, -5], [1, -5], [2, -5], [3, -5], [4, -5], [5, -5], [6, -5], [7, -5], [8, -5], [9, -5], [-9, 5], [-8, 5], [-7, 5], [-6, 5], [-5, 5], [-4, 5], [-3, 5], [-2, 5], [-1, 5], [0, 5], [1, 5], [2, 5], [3, 5], [4, 5], [5, 5], [6, 5], [7, 5], [8, 5], [9, 5], [-5, 9], [5, 9], [-6, -8], [-5, -8], [-4, -8], [-3, -8], [-2, -8], [-1, -8], [0, -8], [1, -8], [2, -8], [3, -8], [4, -8], [5, -8], [6, -8], [-8, -6], [-7, -6], [-6, -6], [-5, -6], [-4, -6], [-3, -6], [-2, -6], [-1, -6], [0, -6], [1, -6], [2, -6], [3, -6], [4, -6], [5, -6], [6, -6], [7, -6], [8, -6], [-8, 6], [-7, 6], [-6, 6], [-5, 6], [-4, 6], [-3, 6], [-2, 6], [-1, 6], [0, 6], [1, 6], [2, 6], [3, 6], [4, 6], [5, 6], [6, 6], [7, 6], [8, 6], [-6, 8], [-5, 8], [-4, 8], [-3, 8], [-2, 8], [-1, 8], [0, 8], [1, 8], [2, 8], [3, 8], [4, 8], [5, 8], [6, 8], [-7, -7], [-6, -7], [-5, -7], [-4, -7], [-3, -7], [-2, -7], [-1, -7], [0, -7], [1, -7], [2, -7], [3, -7], [4, -7], [5, -7], [6, -7], [7, -7], [-7, 7], [-6, 7], [-5, 7], [-4, 7], [-3, 7], [-2, 7], [-1, 7], [0, 7], [1, 7], [2, 7], [3, 7], [4, 7], [5, 7], [6, 7], [7, 7]]; + expected = [[0, 0], [1, -1], [-1, 1], [2, -2], [-2, 2], [3, -3], [-3, 3], [4, -4], [-4, 4], [5, -5], [-5, 5], [6, -6], [-6, 6], [7, -7], [-7, 7], [-5, 0], [5, 0], [-4, -1], [6, -1], [-6, 1], [4, 1], [-3, -2], [7, -2], [-7, 2], [3, 2], [-2, -3], [8, -3], [-8, 3], [2, 3], [-1, -4], [9, -4], [-9, 4], [1, 4], [0, -5], [0, 5], [1, -6], [-1, 6], [0, 10], [0, -10], [-10, 0], [10, 0], [-9, -1], [9, 1], [-8, -2], [8, 2], [-7, -3], [7, 3], [-1, -9], [-6, -4], [6, 4], [1, 9], [-5, -5], [5, 5], [-2, -8], [-4, -6], [4, 6], [2, 8], [-3, -7], [3, 7], [3, -9], [-3, 9], [1, -2], [-1, 2], [2, -3], [-2, 3], [3, -4], [-3, 4], [4, -5], [-4, 5], [5, -6], [-5, 6], [6, -7], [-6, 7], [-4, 0], [4, 0], [-3, -1], [5, -1], [-5, 1], [3, 1], [-2, -2], [6, -2], [-6, 2], [2, 2], [-1, -3], [7, -3], [-7, 3], [1, 3], [0, -4], [8, -4], [-8, 4], [0, 4], [1, -5], [9, -5], [-9, 5], [-1, 5], [-9, 0], [9, 0], [1, -10], [-8, -1], [10, -1], [-10, 1], [8, 1], [-1, 10], [-7, -2], [7, 2], [-6, -3], [6, 3], [0, -9], [-5, -4], [5, 4], [0, 9], [-4, -5], [4, 5], [-1, -8], [-3, -6], [3, 6], [1, 8], [-2, -7], [2, 7], [3, -10], [-3, 10], [-5, -9], [-9, -5], [9, 5], [5, 9], [-6, -8], [-8, -6], [8, 6], [6, 8], [-7, -7], [7, 7], [1, -3], [-1, 3], [2, -4], [-2, 4], [3, -5], [-3, 5], [6, -8], [4, -6], [-4, 6], [-6, 8], [5, -7], [-5, 7], [-3, 0], [3, 0], [-2, -1], [4, -1], [-4, 1], [2, 1], [-1, -2], [5, -2], [-5, 2], [1, 2], [0, -3], [6, -3], [-6, 3], [0, 3], [1, -4], [7, -4], [-7, 4], [-1, 4], [8, -5], [-8, 5], [-8, 0], [8, 0], [-7, -1], [9, -1], [-9, 1], [7, 1], [2, -10], [-6, -2], [10, -2], [-10, 2], [6, 2], [-2, 10], [-5, -3], [5, 3], [1, -9], [-4, -4], [4, 4], [-1, 9], [-3, -5], [3, 5], [0, -8], [-2, -6], [2, 6], [0, 8], [-1, -7], [1, 7], [-3, -10], [-10, -3], [10, 3], [3, 10], [-4, -9], [-9, -4], [9, 4], [4, 9], [-8, -5], [8, 5], [-5, -8], [-7, -6], [7, 6], [5, 8], [-6, -7], [6, 7], [2, -5], [-2, 5], [5, -8], [3, -6], [-3, 6], [-5, 8], [4, -7], [-4, 7], [-2, 0], [2, 0], [-1, -1], [3, -1], [-3, 1], [1, 1], [0, -2], [4, -2], [-4, 2], [0, 2], [5, -3], [-5, 3], [6, -4], [-6, 4], [7, -5], [-7, 5], [8, -6], [-8, 6], [-7, 0], [7, 0], [-6, -1], [8, -1], [-8, 1], [6, 1], [-5, -2], [9, -2], [-9, 2], [5, 2], [-4, -3], [10, -3], [-10, 3], [4, 3], [2, -9], [-3, -4], [3, 4], [-2, 9], [-2, -5], [2, 5], [1, -8], [-1, -6], [1, 6], [-1, 8], [0, -7], [0, 7], [-2, -10], [-10, -2], [10, 2], [2, 10], [-9, -3], [9, 3], [-3, -9], [-8, -4], [8, 4], [3, 9], [-7, -5], [7, 5], [-4, -8], [-6, -6], [6, 6], [4, 8], [-5, -7], [5, 7], [5, -9], [-5, 9], [4, -8], [2, -6], [-2, 6], [-4, 8], [3, -7], [-3, 7], [-1, 0], [1, 0], [0, -1], [2, -1], [-2, 1], [0, 1], [3, -2], [-3, 2], [4, -3], [-4, 3], [5, -4], [-5, 4], [6, -5], [-6, 5], [7, -6], [-7, 6], [-6, 0], [6, 0], [-5, -1], [7, -1], [-7, 1], [5, 1], [-4, -2], [8, -2], [-8, 2], [4, 2], [-3, -3], [9, -3], [-9, 3], [3, 3], [-2, -4], [2, 4], [-1, -5], [1, 5], [2, -8], [0, -6], [0, 6], [-2, 8], [1, -7], [-1, 7], [-1, -10], [-10, -1], [10, 1], [1, 10], [-9, -2], [9, 2], [-8, -3], [8, 3], [-2, -9], [-7, -4], [7, 4], [2, 9], [-6, -5], [6, 5], [-3, -8], [-5, -6], [5, 6], [3, 8], [-4, -7], [4, 7], [4, -9], [-4, 9], [3, -8], [-3, 8], [2, -7], [-2, 7]]; actual = vx_circle(10, true); - assertEqualPoints(expected, actual); + assert(expected == actual); } test_vx_circle(); \ No newline at end of file diff --git a/test/voxel/test_vx_cylinder.scad b/test/voxel/test_vx_cylinder.scad index 72f1c4ad..5453cd12 100644 --- a/test/voxel/test_vx_cylinder.scad +++ b/test/voxel/test_vx_cylinder.scad @@ -1,4 +1,3 @@ -use ; use ; module test_vx_cylinder() { @@ -11,12 +10,12 @@ module test_vx_cylinder() { expected = [[-4, -9, 0], [-3, -9, 0], [-2, -9, 0], [-1, -9, 0], [0, -9, 0], [1, -9, 0], [2, -9, 0], [3, -9, 0], [4, -9, 0], [-5, -8, 0], [-4, -8, 0], [-3, -8, 0], [-2, -8, 0], [-1, -8, 0], [0, -8, 0], [1, -8, 0], [2, -8, 0], [3, -8, 0], [4, -8, 0], [5, -8, 0], [-7, -7, 0], [-6, -7, 0], [-5, -7, 0], [-4, -7, 0], [-3, -7, 0], [-2, -7, 0], [-1, -7, 0], [0, -7, 0], [1, -7, 0], [2, -7, 0], [3, -7, 0], [4, -7, 0], [5, -7, 0], [6, -7, 0], [7, -7, 0], [-7, -6, 0], [-6, -6, 0], [-5, -6, 0], [-4, -6, 0], [-3, -6, 0], [-2, -6, 0], [-1, -6, 0], [0, -6, 0], [1, -6, 0], [2, -6, 0], [3, -6, 0], [4, -6, 0], [5, -6, 0], [6, -6, 0], [7, -6, 0], [-8, -5, 0], [-7, -5, 0], [-6, -5, 0], [-5, -5, 0], [-4, -5, 0], [-3, -5, 0], [-2, -5, 0], [-1, -5, 0], [0, -5, 0], [1, -5, 0], [2, -5, 0], [3, -5, 0], [4, -5, 0], [5, -5, 0], [6, -5, 0], [7, -5, 0], [8, -5, 0], [-9, -4, 0], [-8, -4, 0], [-7, -4, 0], [-6, -4, 0], [-5, -4, 0], [-4, -4, 0], [-3, -4, 0], [-2, -4, 0], [-1, -4, 0], [0, -4, 0], [1, -4, 0], [2, -4, 0], [3, -4, 0], [4, -4, 0], [5, -4, 0], [6, -4, 0], [7, -4, 0], [8, -4, 0], [9, -4, 0], [-9, -3, 0], [-8, -3, 0], [-7, -3, 0], [-6, -3, 0], [-5, -3, 0], [-4, -3, 0], [-3, -3, 0], [-2, -3, 0], [-1, -3, 0], [0, -3, 0], [1, -3, 0], [2, -3, 0], [3, -3, 0], [4, -3, 0], [5, -3, 0], [6, -3, 0], [7, -3, 0], [8, -3, 0], [9, -3, 0], [-9, -2, 0], [-8, -2, 0], [-7, -2, 0], [-6, -2, 0], [-5, -2, 0], [-4, -2, 0], [-3, -2, 0], [-2, -2, 0], [-1, -2, 0], [0, -2, 0], [1, -2, 0], [2, -2, 0], [3, -2, 0], [4, -2, 0], [5, -2, 0], [6, -2, 0], [7, -2, 0], [8, -2, 0], [9, -2, 0], [-9, -1, 0], [-8, -1, 0], [-7, -1, 0], [-6, -1, 0], [-5, -1, 0], [-4, -1, 0], [-3, -1, 0], [-2, -1, 0], [-1, -1, 0], [0, -1, 0], [1, -1, 0], [2, -1, 0], [3, -1, 0], [4, -1, 0], [5, -1, 0], [6, -1, 0], [7, -1, 0], [8, -1, 0], [9, -1, 0], [-9, 0, 0], [-8, 0, 0], [-7, 0, 0], [-6, 0, 0], [-5, 0, 0], [-4, 0, 0], [-3, 0, 0], [-2, 0, 0], [-1, 0, 0], [0, 0, 0], [1, 0, 0], [2, 0, 0], [3, 0, 0], [4, 0, 0], [5, 0, 0], [6, 0, 0], [7, 0, 0], [8, 0, 0], [9, 0, 0], [-9, 1, 0], [-8, 1, 0], [-7, 1, 0], [-6, 1, 0], [-5, 1, 0], [-4, 1, 0], [-3, 1, 0], [-2, 1, 0], [-1, 1, 0], [0, 1, 0], [1, 1, 0], [2, 1, 0], [3, 1, 0], [4, 1, 0], [5, 1, 0], [6, 1, 0], [7, 1, 0], [8, 1, 0], [9, 1, 0], [-9, 2, 0], [-8, 2, 0], [-7, 2, 0], [-6, 2, 0], [-5, 2, 0], [-4, 2, 0], [-3, 2, 0], [-2, 2, 0], [-1, 2, 0], [0, 2, 0], [1, 2, 0], [2, 2, 0], [3, 2, 0], [4, 2, 0], [5, 2, 0], [6, 2, 0], [7, 2, 0], [8, 2, 0], [9, 2, 0], [-9, 3, 0], [-8, 3, 0], [-7, 3, 0], [-6, 3, 0], [-5, 3, 0], [-4, 3, 0], [-3, 3, 0], [-2, 3, 0], [-1, 3, 0], [0, 3, 0], [1, 3, 0], [2, 3, 0], [3, 3, 0], [4, 3, 0], [5, 3, 0], [6, 3, 0], [7, 3, 0], [8, 3, 0], [9, 3, 0], [-9, 4, 0], [-8, 4, 0], [-7, 4, 0], [-6, 4, 0], [-5, 4, 0], [-4, 4, 0], [-3, 4, 0], [-2, 4, 0], [-1, 4, 0], [0, 4, 0], [1, 4, 0], [2, 4, 0], [3, 4, 0], [4, 4, 0], [5, 4, 0], [6, 4, 0], [7, 4, 0], [8, 4, 0], [9, 4, 0], [-8, 5, 0], [-7, 5, 0], [-6, 5, 0], [-5, 5, 0], [-4, 5, 0], [-3, 5, 0], [-2, 5, 0], [-1, 5, 0], [0, 5, 0], [1, 5, 0], [2, 5, 0], [3, 5, 0], [4, 5, 0], [5, 5, 0], [6, 5, 0], [7, 5, 0], [8, 5, 0], [-7, 6, 0], [-6, 6, 0], [-5, 6, 0], [-4, 6, 0], [-3, 6, 0], [-2, 6, 0], [-1, 6, 0], [0, 6, 0], [1, 6, 0], [2, 6, 0], [3, 6, 0], [4, 6, 0], [5, 6, 0], [6, 6, 0], [7, 6, 0], [-7, 7, 0], [-6, 7, 0], [-5, 7, 0], [-4, 7, 0], [-3, 7, 0], [-2, 7, 0], [-1, 7, 0], [0, 7, 0], [1, 7, 0], [2, 7, 0], [3, 7, 0], [4, 7, 0], [5, 7, 0], [6, 7, 0], [7, 7, 0], [-5, 8, 0], [-4, 8, 0], [-3, 8, 0], [-2, 8, 0], [-1, 8, 0], [0, 8, 0], [1, 8, 0], [2, 8, 0], [3, 8, 0], [4, 8, 0], [5, 8, 0], [-4, 9, 0], [-3, 9, 0], [-2, 9, 0], [-1, 9, 0], [0, 9, 0], [1, 9, 0], [2, 9, 0], [3, 9, 0], [4, 9, 0], [-3, -7, 1], [-2, -7, 1], [-1, -7, 1], [0, -7, 1], [1, -7, 1], [2, -7, 1], [3, -7, 1], [-5, -6, 1], [-4, -6, 1], [-3, -6, 1], [-2, -6, 1], [-1, -6, 1], [0, -6, 1], [1, -6, 1], [2, -6, 1], [3, -6, 1], [4, -6, 1], [5, -6, 1], [-6, -5, 1], [-5, -5, 1], [-4, -5, 1], [-3, -5, 1], [-2, -5, 1], [-1, -5, 1], [0, -5, 1], [1, -5, 1], [2, -5, 1], [3, -5, 1], [4, -5, 1], [5, -5, 1], [6, -5, 1], [-6, -4, 1], [-5, -4, 1], [-4, -4, 1], [-3, -4, 1], [-2, -4, 1], [-1, -4, 1], [0, -4, 1], [1, -4, 1], [2, -4, 1], [3, -4, 1], [4, -4, 1], [5, -4, 1], [6, -4, 1], [-7, -3, 1], [-6, -3, 1], [-5, -3, 1], [-4, -3, 1], [-3, -3, 1], [-2, -3, 1], [-1, -3, 1], [0, -3, 1], [1, -3, 1], [2, -3, 1], [3, -3, 1], [4, -3, 1], [5, -3, 1], [6, -3, 1], [7, -3, 1], [-7, -2, 1], [-6, -2, 1], [-5, -2, 1], [-4, -2, 1], [-3, -2, 1], [-2, -2, 1], [-1, -2, 1], [0, -2, 1], [1, -2, 1], [2, -2, 1], [3, -2, 1], [4, -2, 1], [5, -2, 1], [6, -2, 1], [7, -2, 1], [-7, -1, 1], [-6, -1, 1], [-5, -1, 1], [-4, -1, 1], [-3, -1, 1], [-2, -1, 1], [-1, -1, 1], [0, -1, 1], [1, -1, 1], [2, -1, 1], [3, -1, 1], [4, -1, 1], [5, -1, 1], [6, -1, 1], [7, -1, 1], [-7, 0, 1], [-6, 0, 1], [-5, 0, 1], [-4, 0, 1], [-3, 0, 1], [-2, 0, 1], [-1, 0, 1], [0, 0, 1], [1, 0, 1], [2, 0, 1], [3, 0, 1], [4, 0, 1], [5, 0, 1], [6, 0, 1], [7, 0, 1], [-7, 1, 1], [-6, 1, 1], [-5, 1, 1], [-4, 1, 1], [-3, 1, 1], [-2, 1, 1], [-1, 1, 1], [0, 1, 1], [1, 1, 1], [2, 1, 1], [3, 1, 1], [4, 1, 1], [5, 1, 1], [6, 1, 1], [7, 1, 1], [-7, 2, 1], [-6, 2, 1], [-5, 2, 1], [-4, 2, 1], [-3, 2, 1], [-2, 2, 1], [-1, 2, 1], [0, 2, 1], [1, 2, 1], [2, 2, 1], [3, 2, 1], [4, 2, 1], [5, 2, 1], [6, 2, 1], [7, 2, 1], [-7, 3, 1], [-6, 3, 1], [-5, 3, 1], [-4, 3, 1], [-3, 3, 1], [-2, 3, 1], [-1, 3, 1], [0, 3, 1], [1, 3, 1], [2, 3, 1], [3, 3, 1], [4, 3, 1], [5, 3, 1], [6, 3, 1], [7, 3, 1], [-6, 4, 1], [-5, 4, 1], [-4, 4, 1], [-3, 4, 1], [-2, 4, 1], [-1, 4, 1], [0, 4, 1], [1, 4, 1], [2, 4, 1], [3, 4, 1], [4, 4, 1], [5, 4, 1], [6, 4, 1], [-6, 5, 1], [-5, 5, 1], [-4, 5, 1], [-3, 5, 1], [-2, 5, 1], [-1, 5, 1], [0, 5, 1], [1, 5, 1], [2, 5, 1], [3, 5, 1], [4, 5, 1], [5, 5, 1], [6, 5, 1], [-5, 6, 1], [-4, 6, 1], [-3, 6, 1], [-2, 6, 1], [-1, 6, 1], [0, 6, 1], [1, 6, 1], [2, 6, 1], [3, 6, 1], [4, 6, 1], [5, 6, 1], [-3, 7, 1], [-2, 7, 1], [-1, 7, 1], [0, 7, 1], [1, 7, 1], [2, 7, 1], [3, 7, 1], [-2, -4, 2], [-1, -4, 2], [0, -4, 2], [1, -4, 2], [2, -4, 2], [-3, -3, 2], [-2, -3, 2], [-1, -3, 2], [0, -3, 2], [1, -3, 2], [2, -3, 2], [3, -3, 2], [-4, -2, 2], [-3, -2, 2], [-2, -2, 2], [-1, -2, 2], [0, -2, 2], [1, -2, 2], [2, -2, 2], [3, -2, 2], [4, -2, 2], [-4, -1, 2], [-3, -1, 2], [-2, -1, 2], [-1, -1, 2], [0, -1, 2], [1, -1, 2], [2, -1, 2], [3, -1, 2], [4, -1, 2], [-4, 0, 2], [-3, 0, 2], [-2, 0, 2], [-1, 0, 2], [0, 0, 2], [1, 0, 2], [2, 0, 2], [3, 0, 2], [4, 0, 2], [-4, 1, 2], [-3, 1, 2], [-2, 1, 2], [-1, 1, 2], [0, 1, 2], [1, 1, 2], [2, 1, 2], [3, 1, 2], [4, 1, 2], [-4, 2, 2], [-3, 2, 2], [-2, 2, 2], [-1, 2, 2], [0, 2, 2], [1, 2, 2], [2, 2, 2], [3, 2, 2], [4, 2, 2], [-3, 3, 2], [-2, 3, 2], [-1, 3, 2], [0, 3, 2], [1, 3, 2], [2, 3, 2], [3, 3, 2], [-2, 4, 2], [-1, 4, 2], [0, 4, 2], [1, 4, 2], [2, 4, 2]]; actual = vx_cylinder([r1, r2], h, true); - assertEqualPoints(expected, actual); + assert(expected == actual); expected2 = [[-4, -9, 0], [-3, -9, 0], [-2, -9, 0], [-1, -9, 0], [0, -9, 0], [1, -9, 0], [2, -9, 0], [3, -9, 0], [4, -9, 0], [-5, -8, 0], [-4, -8, 0], [-3, -8, 0], [-2, -8, 0], [-1, -8, 0], [0, -8, 0], [1, -8, 0], [2, -8, 0], [3, -8, 0], [4, -8, 0], [5, -8, 0], [-7, -7, 0], [-6, -7, 0], [-5, -7, 0], [-4, -7, 0], [-3, -7, 0], [-2, -7, 0], [-1, -7, 0], [0, -7, 0], [1, -7, 0], [2, -7, 0], [3, -7, 0], [4, -7, 0], [5, -7, 0], [6, -7, 0], [7, -7, 0], [-7, -6, 0], [-6, -6, 0], [-5, -6, 0], [-4, -6, 0], [-3, -6, 0], [-2, -6, 0], [-1, -6, 0], [0, -6, 0], [1, -6, 0], [2, -6, 0], [3, -6, 0], [4, -6, 0], [5, -6, 0], [6, -6, 0], [7, -6, 0], [-8, -5, 0], [-7, -5, 0], [-6, -5, 0], [-5, -5, 0], [-4, -5, 0], [-3, -5, 0], [-2, -5, 0], [-1, -5, 0], [0, -5, 0], [1, -5, 0], [2, -5, 0], [3, -5, 0], [4, -5, 0], [5, -5, 0], [6, -5, 0], [7, -5, 0], [8, -5, 0], [-9, -4, 0], [-8, -4, 0], [-7, -4, 0], [-6, -4, 0], [-5, -4, 0], [-4, -4, 0], [-3, -4, 0], [-2, -4, 0], [-1, -4, 0], [0, -4, 0], [1, -4, 0], [2, -4, 0], [3, -4, 0], [4, -4, 0], [5, -4, 0], [6, -4, 0], [7, -4, 0], [8, -4, 0], [9, -4, 0], [-9, -3, 0], [-8, -3, 0], [-7, -3, 0], [-6, -3, 0], [-5, -3, 0], [-4, -3, 0], [-3, -3, 0], [-2, -3, 0], [-1, -3, 0], [0, -3, 0], [1, -3, 0], [2, -3, 0], [3, -3, 0], [4, -3, 0], [5, -3, 0], [6, -3, 0], [7, -3, 0], [8, -3, 0], [9, -3, 0], [-9, -2, 0], [-8, -2, 0], [-7, -2, 0], [-6, -2, 0], [-5, -2, 0], [-4, -2, 0], [-3, -2, 0], [-2, -2, 0], [-1, -2, 0], [0, -2, 0], [1, -2, 0], [2, -2, 0], [3, -2, 0], [4, -2, 0], [5, -2, 0], [6, -2, 0], [7, -2, 0], [8, -2, 0], [9, -2, 0], [-9, -1, 0], [-8, -1, 0], [-7, -1, 0], [-6, -1, 0], [-5, -1, 0], [-4, -1, 0], [-3, -1, 0], [-2, -1, 0], [-1, -1, 0], [0, -1, 0], [1, -1, 0], [2, -1, 0], [3, -1, 0], [4, -1, 0], [5, -1, 0], [6, -1, 0], [7, -1, 0], [8, -1, 0], [9, -1, 0], [-9, 0, 0], [-8, 0, 0], [-7, 0, 0], [-6, 0, 0], [-5, 0, 0], [-4, 0, 0], [-3, 0, 0], [-2, 0, 0], [-1, 0, 0], [0, 0, 0], [1, 0, 0], [2, 0, 0], [3, 0, 0], [4, 0, 0], [5, 0, 0], [6, 0, 0], [7, 0, 0], [8, 0, 0], [9, 0, 0], [-9, 1, 0], [-8, 1, 0], [-7, 1, 0], [-6, 1, 0], [-5, 1, 0], [-4, 1, 0], [-3, 1, 0], [-2, 1, 0], [-1, 1, 0], [0, 1, 0], [1, 1, 0], [2, 1, 0], [3, 1, 0], [4, 1, 0], [5, 1, 0], [6, 1, 0], [7, 1, 0], [8, 1, 0], [9, 1, 0], [-9, 2, 0], [-8, 2, 0], [-7, 2, 0], [-6, 2, 0], [-5, 2, 0], [-4, 2, 0], [-3, 2, 0], [-2, 2, 0], [-1, 2, 0], [0, 2, 0], [1, 2, 0], [2, 2, 0], [3, 2, 0], [4, 2, 0], [5, 2, 0], [6, 2, 0], [7, 2, 0], [8, 2, 0], [9, 2, 0], [-9, 3, 0], [-8, 3, 0], [-7, 3, 0], [-6, 3, 0], [-5, 3, 0], [-4, 3, 0], [-3, 3, 0], [-2, 3, 0], [-1, 3, 0], [0, 3, 0], [1, 3, 0], [2, 3, 0], [3, 3, 0], [4, 3, 0], [5, 3, 0], [6, 3, 0], [7, 3, 0], [8, 3, 0], [9, 3, 0], [-9, 4, 0], [-8, 4, 0], [-7, 4, 0], [-6, 4, 0], [-5, 4, 0], [-4, 4, 0], [-3, 4, 0], [-2, 4, 0], [-1, 4, 0], [0, 4, 0], [1, 4, 0], [2, 4, 0], [3, 4, 0], [4, 4, 0], [5, 4, 0], [6, 4, 0], [7, 4, 0], [8, 4, 0], [9, 4, 0], [-8, 5, 0], [-7, 5, 0], [-6, 5, 0], [-5, 5, 0], [-4, 5, 0], [-3, 5, 0], [-2, 5, 0], [-1, 5, 0], [0, 5, 0], [1, 5, 0], [2, 5, 0], [3, 5, 0], [4, 5, 0], [5, 5, 0], [6, 5, 0], [7, 5, 0], [8, 5, 0], [-7, 6, 0], [-6, 6, 0], [-5, 6, 0], [-4, 6, 0], [-3, 6, 0], [-2, 6, 0], [-1, 6, 0], [0, 6, 0], [1, 6, 0], [2, 6, 0], [3, 6, 0], [4, 6, 0], [5, 6, 0], [6, 6, 0], [7, 6, 0], [-7, 7, 0], [-6, 7, 0], [-5, 7, 0], [-4, 7, 0], [-3, 7, 0], [-2, 7, 0], [-1, 7, 0], [0, 7, 0], [1, 7, 0], [2, 7, 0], [3, 7, 0], [4, 7, 0], [5, 7, 0], [6, 7, 0], [7, 7, 0], [-5, 8, 0], [-4, 8, 0], [-3, 8, 0], [-2, 8, 0], [-1, 8, 0], [0, 8, 0], [1, 8, 0], [2, 8, 0], [3, 8, 0], [4, 8, 0], [5, 8, 0], [-4, 9, 0], [-3, 9, 0], [-2, 9, 0], [-1, 9, 0], [0, 9, 0], [1, 9, 0], [2, 9, 0], [3, 9, 0], [4, 9, 0], [-4, -9, 1], [-3, -9, 1], [-2, -9, 1], [-1, -9, 1], [0, -9, 1], [1, -9, 1], [2, -9, 1], [3, -9, 1], [4, -9, 1], [-5, -8, 1], [-4, -8, 1], [-3, -8, 1], [-2, -8, 1], [-1, -8, 1], [0, -8, 1], [1, -8, 1], [2, -8, 1], [3, -8, 1], [4, -8, 1], [5, -8, 1], [-7, -7, 1], [-6, -7, 1], [-5, -7, 1], [-4, -7, 1], [-3, -7, 1], [-2, -7, 1], [-1, -7, 1], [0, -7, 1], [1, -7, 1], [2, -7, 1], [3, -7, 1], [4, -7, 1], [5, -7, 1], [6, -7, 1], [7, -7, 1], [-7, -6, 1], [-6, -6, 1], [-5, -6, 1], [-4, -6, 1], [-3, -6, 1], [-2, -6, 1], [-1, -6, 1], [0, -6, 1], [1, -6, 1], [2, -6, 1], [3, -6, 1], [4, -6, 1], [5, -6, 1], [6, -6, 1], [7, -6, 1], [-8, -5, 1], [-7, -5, 1], [-6, -5, 1], [-5, -5, 1], [-4, -5, 1], [-3, -5, 1], [-2, -5, 1], [-1, -5, 1], [0, -5, 1], [1, -5, 1], [2, -5, 1], [3, -5, 1], [4, -5, 1], [5, -5, 1], [6, -5, 1], [7, -5, 1], [8, -5, 1], [-9, -4, 1], [-8, -4, 1], [-7, -4, 1], [-6, -4, 1], [-5, -4, 1], [-4, -4, 1], [-3, -4, 1], [-2, -4, 1], [-1, -4, 1], [0, -4, 1], [1, -4, 1], [2, -4, 1], [3, -4, 1], [4, -4, 1], [5, -4, 1], [6, -4, 1], [7, -4, 1], [8, -4, 1], [9, -4, 1], [-9, -3, 1], [-8, -3, 1], [-7, -3, 1], [-6, -3, 1], [-5, -3, 1], [-4, -3, 1], [-3, -3, 1], [-2, -3, 1], [-1, -3, 1], [0, -3, 1], [1, -3, 1], [2, -3, 1], [3, -3, 1], [4, -3, 1], [5, -3, 1], [6, -3, 1], [7, -3, 1], [8, -3, 1], [9, -3, 1], [-9, -2, 1], [-8, -2, 1], [-7, -2, 1], [-6, -2, 1], [-5, -2, 1], [-4, -2, 1], [-3, -2, 1], [-2, -2, 1], [-1, -2, 1], [0, -2, 1], [1, -2, 1], [2, -2, 1], [3, -2, 1], [4, -2, 1], [5, -2, 1], [6, -2, 1], [7, -2, 1], [8, -2, 1], [9, -2, 1], [-9, -1, 1], [-8, -1, 1], [-7, -1, 1], [-6, -1, 1], [-5, -1, 1], [-4, -1, 1], [-3, -1, 1], [-2, -1, 1], [-1, -1, 1], [0, -1, 1], [1, -1, 1], [2, -1, 1], [3, -1, 1], [4, -1, 1], [5, -1, 1], [6, -1, 1], [7, -1, 1], [8, -1, 1], [9, -1, 1], [-9, 0, 1], [-8, 0, 1], [-7, 0, 1], [-6, 0, 1], [-5, 0, 1], [-4, 0, 1], [-3, 0, 1], [-2, 0, 1], [-1, 0, 1], [0, 0, 1], [1, 0, 1], [2, 0, 1], [3, 0, 1], [4, 0, 1], [5, 0, 1], [6, 0, 1], [7, 0, 1], [8, 0, 1], [9, 0, 1], [-9, 1, 1], [-8, 1, 1], [-7, 1, 1], [-6, 1, 1], [-5, 1, 1], [-4, 1, 1], [-3, 1, 1], [-2, 1, 1], [-1, 1, 1], [0, 1, 1], [1, 1, 1], [2, 1, 1], [3, 1, 1], [4, 1, 1], [5, 1, 1], [6, 1, 1], [7, 1, 1], [8, 1, 1], [9, 1, 1], [-9, 2, 1], [-8, 2, 1], [-7, 2, 1], [-6, 2, 1], [-5, 2, 1], [-4, 2, 1], [-3, 2, 1], [-2, 2, 1], [-1, 2, 1], [0, 2, 1], [1, 2, 1], [2, 2, 1], [3, 2, 1], [4, 2, 1], [5, 2, 1], [6, 2, 1], [7, 2, 1], [8, 2, 1], [9, 2, 1], [-9, 3, 1], [-8, 3, 1], [-7, 3, 1], [-6, 3, 1], [-5, 3, 1], [-4, 3, 1], [-3, 3, 1], [-2, 3, 1], [-1, 3, 1], [0, 3, 1], [1, 3, 1], [2, 3, 1], [3, 3, 1], [4, 3, 1], [5, 3, 1], [6, 3, 1], [7, 3, 1], [8, 3, 1], [9, 3, 1], [-9, 4, 1], [-8, 4, 1], [-7, 4, 1], [-6, 4, 1], [-5, 4, 1], [-4, 4, 1], [-3, 4, 1], [-2, 4, 1], [-1, 4, 1], [0, 4, 1], [1, 4, 1], [2, 4, 1], [3, 4, 1], [4, 4, 1], [5, 4, 1], [6, 4, 1], [7, 4, 1], [8, 4, 1], [9, 4, 1], [-8, 5, 1], [-7, 5, 1], [-6, 5, 1], [-5, 5, 1], [-4, 5, 1], [-3, 5, 1], [-2, 5, 1], [-1, 5, 1], [0, 5, 1], [1, 5, 1], [2, 5, 1], [3, 5, 1], [4, 5, 1], [5, 5, 1], [6, 5, 1], [7, 5, 1], [8, 5, 1], [-7, 6, 1], [-6, 6, 1], [-5, 6, 1], [-4, 6, 1], [-3, 6, 1], [-2, 6, 1], [-1, 6, 1], [0, 6, 1], [1, 6, 1], [2, 6, 1], [3, 6, 1], [4, 6, 1], [5, 6, 1], [6, 6, 1], [7, 6, 1], [-7, 7, 1], [-6, 7, 1], [-5, 7, 1], [-4, 7, 1], [-3, 7, 1], [-2, 7, 1], [-1, 7, 1], [0, 7, 1], [1, 7, 1], [2, 7, 1], [3, 7, 1], [4, 7, 1], [5, 7, 1], [6, 7, 1], [7, 7, 1], [-5, 8, 1], [-4, 8, 1], [-3, 8, 1], [-2, 8, 1], [-1, 8, 1], [0, 8, 1], [1, 8, 1], [2, 8, 1], [3, 8, 1], [4, 8, 1], [5, 8, 1], [-4, 9, 1], [-3, 9, 1], [-2, 9, 1], [-1, 9, 1], [0, 9, 1], [1, 9, 1], [2, 9, 1], [3, 9, 1], [4, 9, 1], [-4, -9, 2], [-3, -9, 2], [-2, -9, 2], [-1, -9, 2], [0, -9, 2], [1, -9, 2], [2, -9, 2], [3, -9, 2], [4, -9, 2], [-5, -8, 2], [-4, -8, 2], [-3, -8, 2], [-2, -8, 2], [-1, -8, 2], [0, -8, 2], [1, -8, 2], [2, -8, 2], [3, -8, 2], [4, -8, 2], [5, -8, 2], [-7, -7, 2], [-6, -7, 2], [-5, -7, 2], [-4, -7, 2], [-3, -7, 2], [-2, -7, 2], [-1, -7, 2], [0, -7, 2], [1, -7, 2], [2, -7, 2], [3, -7, 2], [4, -7, 2], [5, -7, 2], [6, -7, 2], [7, -7, 2], [-7, -6, 2], [-6, -6, 2], [-5, -6, 2], [-4, -6, 2], [-3, -6, 2], [-2, -6, 2], [-1, -6, 2], [0, -6, 2], [1, -6, 2], [2, -6, 2], [3, -6, 2], [4, -6, 2], [5, -6, 2], [6, -6, 2], [7, -6, 2], [-8, -5, 2], [-7, -5, 2], [-6, -5, 2], [-5, -5, 2], [-4, -5, 2], [-3, -5, 2], [-2, -5, 2], [-1, -5, 2], [0, -5, 2], [1, -5, 2], [2, -5, 2], [3, -5, 2], [4, -5, 2], [5, -5, 2], [6, -5, 2], [7, -5, 2], [8, -5, 2], [-9, -4, 2], [-8, -4, 2], [-7, -4, 2], [-6, -4, 2], [-5, -4, 2], [-4, -4, 2], [-3, -4, 2], [-2, -4, 2], [-1, -4, 2], [0, -4, 2], [1, -4, 2], [2, -4, 2], [3, -4, 2], [4, -4, 2], [5, -4, 2], [6, -4, 2], [7, -4, 2], [8, -4, 2], [9, -4, 2], [-9, -3, 2], [-8, -3, 2], [-7, -3, 2], [-6, -3, 2], [-5, -3, 2], [-4, -3, 2], [-3, -3, 2], [-2, -3, 2], [-1, -3, 2], [0, -3, 2], [1, -3, 2], [2, -3, 2], [3, -3, 2], [4, -3, 2], [5, -3, 2], [6, -3, 2], [7, -3, 2], [8, -3, 2], [9, -3, 2], [-9, -2, 2], [-8, -2, 2], [-7, -2, 2], [-6, -2, 2], [-5, -2, 2], [-4, -2, 2], [-3, -2, 2], [-2, -2, 2], [-1, -2, 2], [0, -2, 2], [1, -2, 2], [2, -2, 2], [3, -2, 2], [4, -2, 2], [5, -2, 2], [6, -2, 2], [7, -2, 2], [8, -2, 2], [9, -2, 2], [-9, -1, 2], [-8, -1, 2], [-7, -1, 2], [-6, -1, 2], [-5, -1, 2], [-4, -1, 2], [-3, -1, 2], [-2, -1, 2], [-1, -1, 2], [0, -1, 2], [1, -1, 2], [2, -1, 2], [3, -1, 2], [4, -1, 2], [5, -1, 2], [6, -1, 2], [7, -1, 2], [8, -1, 2], [9, -1, 2], [-9, 0, 2], [-8, 0, 2], [-7, 0, 2], [-6, 0, 2], [-5, 0, 2], [-4, 0, 2], [-3, 0, 2], [-2, 0, 2], [-1, 0, 2], [0, 0, 2], [1, 0, 2], [2, 0, 2], [3, 0, 2], [4, 0, 2], [5, 0, 2], [6, 0, 2], [7, 0, 2], [8, 0, 2], [9, 0, 2], [-9, 1, 2], [-8, 1, 2], [-7, 1, 2], [-6, 1, 2], [-5, 1, 2], [-4, 1, 2], [-3, 1, 2], [-2, 1, 2], [-1, 1, 2], [0, 1, 2], [1, 1, 2], [2, 1, 2], [3, 1, 2], [4, 1, 2], [5, 1, 2], [6, 1, 2], [7, 1, 2], [8, 1, 2], [9, 1, 2], [-9, 2, 2], [-8, 2, 2], [-7, 2, 2], [-6, 2, 2], [-5, 2, 2], [-4, 2, 2], [-3, 2, 2], [-2, 2, 2], [-1, 2, 2], [0, 2, 2], [1, 2, 2], [2, 2, 2], [3, 2, 2], [4, 2, 2], [5, 2, 2], [6, 2, 2], [7, 2, 2], [8, 2, 2], [9, 2, 2], [-9, 3, 2], [-8, 3, 2], [-7, 3, 2], [-6, 3, 2], [-5, 3, 2], [-4, 3, 2], [-3, 3, 2], [-2, 3, 2], [-1, 3, 2], [0, 3, 2], [1, 3, 2], [2, 3, 2], [3, 3, 2], [4, 3, 2], [5, 3, 2], [6, 3, 2], [7, 3, 2], [8, 3, 2], [9, 3, 2], [-9, 4, 2], [-8, 4, 2], [-7, 4, 2], [-6, 4, 2], [-5, 4, 2], [-4, 4, 2], [-3, 4, 2], [-2, 4, 2], [-1, 4, 2], [0, 4, 2], [1, 4, 2], [2, 4, 2], [3, 4, 2], [4, 4, 2], [5, 4, 2], [6, 4, 2], [7, 4, 2], [8, 4, 2], [9, 4, 2], [-8, 5, 2], [-7, 5, 2], [-6, 5, 2], [-5, 5, 2], [-4, 5, 2], [-3, 5, 2], [-2, 5, 2], [-1, 5, 2], [0, 5, 2], [1, 5, 2], [2, 5, 2], [3, 5, 2], [4, 5, 2], [5, 5, 2], [6, 5, 2], [7, 5, 2], [8, 5, 2], [-7, 6, 2], [-6, 6, 2], [-5, 6, 2], [-4, 6, 2], [-3, 6, 2], [-2, 6, 2], [-1, 6, 2], [0, 6, 2], [1, 6, 2], [2, 6, 2], [3, 6, 2], [4, 6, 2], [5, 6, 2], [6, 6, 2], [7, 6, 2], [-7, 7, 2], [-6, 7, 2], [-5, 7, 2], [-4, 7, 2], [-3, 7, 2], [-2, 7, 2], [-1, 7, 2], [0, 7, 2], [1, 7, 2], [2, 7, 2], [3, 7, 2], [4, 7, 2], [5, 7, 2], [6, 7, 2], [7, 7, 2], [-5, 8, 2], [-4, 8, 2], [-3, 8, 2], [-2, 8, 2], [-1, 8, 2], [0, 8, 2], [1, 8, 2], [2, 8, 2], [3, 8, 2], [4, 8, 2], [5, 8, 2], [-4, 9, 2], [-3, 9, 2], [-2, 9, 2], [-1, 9, 2], [0, 9, 2], [1, 9, 2], [2, 9, 2], [3, 9, 2], [4, 9, 2]]; actual2 = vx_cylinder(r1, h, true); - assertEqualPoints(expected2, actual2); + assert(expected2 == actual2); } test_vx_cylinder(); \ No newline at end of file diff --git a/test/voxel/test_vx_line.scad b/test/voxel/test_vx_line.scad index 19794f4b..492f5a32 100644 --- a/test/voxel/test_vx_line.scad +++ b/test/voxel/test_vx_line.scad @@ -1,4 +1,3 @@ -use ; use ; module test_vx_line() { @@ -7,7 +6,7 @@ module test_vx_line() { expected = [[-10, 0, -10], [-9, 1, -10], [-9, 2, -9], [-8, 3, -9], [-8, 4, -8], [-7, 5, -8], [-6, 6, -8], [-6, 7, -7], [-5, 8, -7], [-5, 9, -6], [-4, 10, -6], [-3, 11, -6], [-3, 12, -5], [-2, 13, -5], [-2, 14, -4], [-1, 15, -4], [0, 16, -4], [0, 17, -3], [1, 18, -3], [1, 19, -2], [2, 20, -2], [3, 21, -2], [3, 22, -1], [4, 23, -1], [4, 24, 0], [5, 25, 0], [6, 26, 0], [6, 27, 1], [7, 28, 1], [7, 29, 2], [8, 30, 2], [9, 31, 2], [9, 32, 3], [10, 33, 3], [10, 34, 4], [11, 35, 4], [12, 36, 4], [12, 37, 5], [13, 38, 5], [13, 39, 6], [14, 40, 6], [15, 41, 6], [15, 42, 7], [16, 43, 7], [16, 44, 8], [17, 45, 8], [18, 46, 8], [18, 47, 9], [19, 48, 9], [19, 49, 10]]; actual = vx_line([-10, 0, -10], [20, 50, 10]); - assertEqualPoints(expected, actual); + assert(expected == actual); } test_vx_line(); \ No newline at end of file diff --git a/test/voxel/test_vx_polygon.scad b/test/voxel/test_vx_polygon.scad index c1ba2a86..d666b0fe 100644 --- a/test/voxel/test_vx_polygon.scad +++ b/test/voxel/test_vx_polygon.scad @@ -1,16 +1,17 @@ -use ; use ; module test_vx_polygon() { echo("==== test_vx_polygon ===="); - expected = [[5, 10], [4, 10], [3, 9], [2, 9], [1, 9], [0, 8], [-1, 8], [-2, 8], [-3, 7], [-4, 7], [-5, 7], [-6, 6], [-7, 6], [-8, 6], [-9, 5], [-10, 5], [-10, 4], [-9, 3], [-9, 2], [-9, 1], [-8, 0], [-8, -1], [-8, -2], [-7, -3], [-7, -4], [-7, -5], [-6, -6], [-6, -7], [-6, -8], [-5, -9], [-5, -10], [-4, -9], [-4, -8], [-3, -7], [-3, -6], [-2, -5], [-2, -4], [-1, -3], [-1, -2], [0, -1], [0, 0], [1, 1], [1, 2], [2, 3], [2, 4], [3, 5], [3, 6], [4, 7], [4, 8], [5, 9]]; + expected = [[5, 10], [4, 10], [3, 9], [2, 9], [1, 9], [0, 8], [-1, 8], [-2, 8], [-3, 7], [-4, 7], [-5, 7], [-6, 6], [-7, 6], [-8, 6], [-9, 5], [-10, 5], [-10, 4], [-9, 3], [-9, 2], [-9, 1], [-8, 0], [-8, -1], [-8, -2], [-7, -3], [-7, -4], [-7, -5], [-6, -6], [-6, -7], [-6, -8], [-5, -9], [-5, -10], [-4, -9], [-4, -8], [-3, -7], [-3, -6], [-2, -5], [-2, -4], [-1, -3], [-1, -2], [0, -1], [0, 0], [1, 1], [1, 2], [2, 3], [2, 4], [3, 5], [3, 6], [4, 7], [4, 8], [5, 9]]; actual = vx_polygon([[5, 10], [-10, 5], [-5, -10]], false); - assertEqualPoints(expected, actual); - expected2 = [[-5, -10], [-5, -9], [-4, -9], [-6, -8], [-4, -8], [-6, -7], [-3, -7], [-6, -6], [-3, -6], [-7, -5], [-2, -5], [-7, -4], [-2, -4], [-7, -3], [-1, -3], [-8, -2], [-1, -2], [-8, -1], [0, -1], [-8, 0], [0, 0], [-9, 1], [1, 1], [-9, 2], [1, 2], [-9, 3], [2, 3], [-10, 4], [2, 4], [-10, 5], [-9, 5], [3, 5], [-8, 6], [-7, 6], [-6, 6], [3, 6], [-5, 7], [-4, 7], [-3, 7], [4, 7], [-2, 8], [-1, 8], [0, 8], [4, 8], [1, 9], [2, 9], [3, 9], [5, 9], [4, 10], [5, 10], [-5, -8], [-5, -7], [-4, -7], [-5, -6], [-4, -6], [-6, -5], [-5, -5], [-4, -5], [-3, -5], [-6, -4], [-5, -4], [-4, -4], [-3, -4], [-6, -3], [-5, -3], [-4, -3], [-3, -3], [-2, -3], [-7, -2], [-6, -2], [-5, -2], [-4, -2], [-3, -2], [-2, -2], [-7, -1], [-6, -1], [-5, -1], [-4, -1], [-3, -1], [-2, -1], [-1, -1], [-7, 0], [-6, 0], [-5, 0], [-4, 0], [-3, 0], [-2, 0], [-1, 0], [-8, 1], [-7, 1], [-6, 1], [-5, 1], [-4, 1], [-3, 1], [-2, 1], [-1, 1], [0, 1], [-8, 2], [-7, 2], [-6, 2], [-5, 2], [-4, 2], [-3, 2], [-2, 2], [-1, 2], [0, 2], [-8, 3], [-7, 3], [-6, 3], [-5, 3], [-4, 3], [-3, 3], [-2, 3], [-1, 3], [0, 3], [1, 3], [-9, 4], [-8, 4], [-7, 4], [-6, 4], [-5, 4], [-4, 4], [-3, 4], [-2, 4], [-1, 4], [0, 4], [1, 4], [-8, 5], [-7, 5], [-6, 5], [-5, 5], [-4, 5], [-3, 5], [-2, 5], [-1, 5], [0, 5], [1, 5], [2, 5], [-5, 6], [-4, 6], [-3, 6], [-2, 6], [-1, 6], [0, 6], [1, 6], [2, 6], [-2, 7], [-1, 7], [0, 7], [1, 7], [2, 7], [3, 7], [1, 8], [2, 8], [3, 8], [4, 9]]; + assert(expected == actual); + + expected2 = [[0, 0], [-9, 1], [3, 5], [-6, 6], [-3, -5], [-5, -3], [-7, -1], [-2, 2], [-4, 4], [1, 7], [-4, -9], [-6, -7], [-4, 7], [-3, -2], [-5, 0], [-7, 2], [-9, 4], [1, 4], [-2, 5], [-1, 6], [4, 9], [-8, -2], [1, 1], [-4, -6], [-6, -4], [-1, -1], [-3, 1], [-5, 3], [-7, 5], [2, 8], [-5, -10], [-2, -5], [5, 10], [-4, -3], [-6, -1], [-8, 1], [-1, 2], [-3, 4], [2, 5], [-5, 6], [0, 7], [-7, -5], [-3, 7], [3, 9], [-5, -7], [-2, -2], [-4, 0], [-6, 2], [-8, 4], [0, 4], [-3, -6], [0, -1], [3, 6], [-5, -4], [-7, -2], [-2, 1], [0, 1], [-4, 3], [-6, 5], [1, 8], [-6, -8], [-9, 3], [4, 10], [-3, -3], [-5, -1], [-7, 1], [-2, 4], [1, 5], [-4, 6], [-1, 7], [-1, -2], [1, 2], [4, 7], [2, 9], [-4, -7], [-6, -5], [-3, 0], [-5, 2], [-7, 4], [-1, 4], [-2, 7], [-8, 0], [0, 8], [-4, -4], [-6, -2], [-1, 1], [-3, 3], [-5, 5], [2, 6], [2, 3], [-10, 5], [-5, -8], [-2, -3], [-4, -1], [-6, 1], [-8, 3], [0, 5], [-3, 6], [-3, -7], [-7, -3], [-8, 6], [1, 9], [-5, -5], [-2, 0], [-4, 2], [0, 2], [-6, 4], [3, 7], [-9, 2], [-1, 8], [-3, -4], [-5, -2], [-7, 0], [-2, 3], [-4, 5], [1, 6], [-4, -8], [-6, -6], [-1, -3], [-9, 5], [4, 8], [-3, -1], [-5, 1], [-7, 3], [1, 3], [-1, 5], [-2, 6], [-8, -1], [-7, 6], [-4, -5], [-6, -3], [-1, 0], [-3, 2], [-5, 4], [2, 7], [-5, -9], [-2, -4], [-10, 4], [2, 4], [-5, 7], [-2, 8], [5, 9], [-4, -2], [-6, 0], [-8, 2], [-1, 3], [-3, 5], [0, 6], [-7, -4], [-5, -6], [-2, -1], [-4, 1], [-6, 3], [0, 3], [-8, 5], [3, 8]]; actual2 = vx_polygon([[5, 10], [-10, 5], [-5, -10]], true); - assertEqualPoints(expected2, actual2); + + assert(expected2 == actual2); } test_vx_polygon(); \ No newline at end of file diff --git a/test/voxel/test_vx_polyline.scad b/test/voxel/test_vx_polyline.scad index 11a4c288..64977520 100644 --- a/test/voxel/test_vx_polyline.scad +++ b/test/voxel/test_vx_polyline.scad @@ -1,4 +1,3 @@ -use ; use ; module test_vx_polyline() { @@ -7,7 +6,7 @@ module test_vx_polyline() { expected = [[5, 10, 5], [4, 9, 5], [3, 8, 5], [2, 7, 6], [1, 6, 6], [0, 5, 6], [-1, 4, 6], [-2, 3, 6], [-3, 2, 6], [-4, 1, 7], [-5, 0, 7], [-6, -1, 7], [-7, -2, 7], [-8, -3, 7], [-9, -4, 7], [-10, -5, 8], [-11, -6, 8], [-12, -7, 8], [-13, -8, 8], [-14, -9, 8], [-15, -10, 8], [-16, -11, 9], [-17, -12, 9], [-18, -13, 9], [-19, -14, 9], [-20, -15, 9], [-21, -16, 9], [-22, -17, 10], [-23, -18, 10], [-24, -19, 10], [-25, -20, 10], [-25, -19, 10], [-25, -18, 10], [-25, -17, 10], [-25, -16, 11], [-25, -15, 11], [-25, -14, 11], [-25, -13, 11], [-25, -12, 11], [-25, -11, 11], [-25, -10, 11], [-25, -9, 12], [-25, -8, 12], [-25, -7, 12], [-25, -6, 12], [-25, -5, 12], [-25, -4, 12], [-25, -3, 12], [-25, -2, 13], [-25, -1, 13], [-25, 0, 13], [-25, 1, 13], [-25, 2, 13], [-25, 3, 13], [-25, 4, 13], [-25, 5, 14], [-25, 6, 14], [-25, 7, 14], [-25, 8, 14], [-25, 9, 14], [-25, 10, 14], [-25, 11, 14], [-25, 12, 15], [-25, 13, 15], [-25, 14, 15], [-25, 15, 15], [-24, 15, 15], [-23, 15, 15], [-22, 16, 15], [-21, 16, 15], [-20, 16, 16], [-19, 16, 16], [-18, 16, 16], [-17, 17, 16], [-16, 17, 16], [-15, 17, 16], [-14, 17, 16], [-13, 17, 16], [-12, 18, 16], [-11, 18, 16], [-10, 18, 17], [-9, 18, 17], [-8, 18, 17], [-7, 19, 17], [-6, 19, 17], [-5, 19, 17], [-4, 19, 17], [-3, 19, 17], [-2, 20, 17], [-1, 20, 17], [0, 20, 18], [1, 20, 18], [2, 20, 18], [3, 21, 18], [4, 21, 18], [5, 21, 18], [6, 21, 18], [7, 21, 18], [8, 22, 18], [9, 22, 18], [10, 22, 19], [11, 22, 19], [12, 22, 19], [13, 23, 19], [14, 23, 19], [15, 23, 19], [16, 23, 19], [17, 23, 19], [18, 24, 19], [19, 24, 19], [20, 24, 20], [21, 24, 20], [22, 24, 20], [23, 25, 20], [24, 25, 20]]; actual = vx_polyline([[5, 10, 5], [-25, -20, 10], [-25, 15, 15], [25, 25, 20]]); - assertEqualPoints(expected, actual); + assert(expected == actual); } test_vx_polyline(); \ No newline at end of file diff --git a/test/voxel/test_vx_sphere.scad b/test/voxel/test_vx_sphere.scad index 0771350d..1df131fc 100644 --- a/test/voxel/test_vx_sphere.scad +++ b/test/voxel/test_vx_sphere.scad @@ -1,4 +1,3 @@ -use ; use ; module test_vx_sphere() { @@ -7,7 +6,7 @@ module test_vx_sphere() { expected = [[-2, -2, -4], [-1, -2, -4], [0, -2, -4], [1, -2, -4], [2, -2, -4], [-2, -1, -4], [-1, -1, -4], [0, -1, -4], [1, -1, -4], [2, -1, -4], [-2, 0, -4], [-1, 0, -4], [0, 0, -4], [1, 0, -4], [2, 0, -4], [-2, 1, -4], [-1, 1, -4], [0, 1, -4], [1, 1, -4], [2, 1, -4], [-2, 2, -4], [-1, 2, -4], [0, 2, -4], [1, 2, -4], [2, 2, -4], [-2, -3, -3], [-1, -3, -3], [0, -3, -3], [1, -3, -3], [2, -3, -3], [-3, -2, -3], [-2, -2, -3], [2, -2, -3], [3, -2, -3], [-3, -1, -3], [3, -1, -3], [-3, 0, -3], [3, 0, -3], [-3, 1, -3], [3, 1, -3], [-3, 2, -3], [-2, 2, -3], [2, 2, -3], [3, 2, -3], [-2, 3, -3], [-1, 3, -3], [0, 3, -3], [1, 3, -3], [2, 3, -3], [-2, -4, -2], [-1, -4, -2], [0, -4, -2], [1, -4, -2], [2, -4, -2], [-3, -3, -2], [-2, -3, -2], [2, -3, -2], [3, -3, -2], [-4, -2, -2], [-3, -2, -2], [3, -2, -2], [4, -2, -2], [-4, -1, -2], [4, -1, -2], [-4, 0, -2], [4, 0, -2], [-4, 1, -2], [4, 1, -2], [-4, 2, -2], [-3, 2, -2], [3, 2, -2], [4, 2, -2], [-3, 3, -2], [-2, 3, -2], [2, 3, -2], [3, 3, -2], [-2, 4, -2], [-1, 4, -2], [0, 4, -2], [1, 4, -2], [2, 4, -2], [-2, -4, -1], [-1, -4, -1], [0, -4, -1], [1, -4, -1], [2, -4, -1], [-3, -3, -1], [3, -3, -1], [-4, -2, -1], [4, -2, -1], [-4, -1, -1], [4, -1, -1], [-4, 0, -1], [4, 0, -1], [-4, 1, -1], [4, 1, -1], [-4, 2, -1], [4, 2, -1], [-3, 3, -1], [3, 3, -1], [-2, 4, -1], [-1, 4, -1], [0, 4, -1], [1, 4, -1], [2, 4, -1], [-2, -4, 0], [-1, -4, 0], [0, -4, 0], [1, -4, 0], [2, -4, 0], [-3, -3, 0], [3, -3, 0], [-4, -2, 0], [4, -2, 0], [-4, -1, 0], [4, -1, 0], [-4, 0, 0], [4, 0, 0], [-4, 1, 0], [4, 1, 0], [-4, 2, 0], [4, 2, 0], [-3, 3, 0], [3, 3, 0], [-2, 4, 0], [-1, 4, 0], [0, 4, 0], [1, 4, 0], [2, 4, 0], [-2, -4, 1], [-1, -4, 1], [0, -4, 1], [1, -4, 1], [2, -4, 1], [-3, -3, 1], [3, -3, 1], [-4, -2, 1], [4, -2, 1], [-4, -1, 1], [4, -1, 1], [-4, 0, 1], [4, 0, 1], [-4, 1, 1], [4, 1, 1], [-4, 2, 1], [4, 2, 1], [-3, 3, 1], [3, 3, 1], [-2, 4, 1], [-1, 4, 1], [0, 4, 1], [1, 4, 1], [2, 4, 1], [-2, -4, 2], [-1, -4, 2], [0, -4, 2], [1, -4, 2], [2, -4, 2], [-3, -3, 2], [-2, -3, 2], [2, -3, 2], [3, -3, 2], [-4, -2, 2], [-3, -2, 2], [3, -2, 2], [4, -2, 2], [-4, -1, 2], [4, -1, 2], [-4, 0, 2], [4, 0, 2], [-4, 1, 2], [4, 1, 2], [-4, 2, 2], [-3, 2, 2], [3, 2, 2], [4, 2, 2], [-3, 3, 2], [-2, 3, 2], [2, 3, 2], [3, 3, 2], [-2, 4, 2], [-1, 4, 2], [0, 4, 2], [1, 4, 2], [2, 4, 2], [-2, -3, 3], [-1, -3, 3], [0, -3, 3], [1, -3, 3], [2, -3, 3], [-3, -2, 3], [-2, -2, 3], [2, -2, 3], [3, -2, 3], [-3, -1, 3], [3, -1, 3], [-3, 0, 3], [3, 0, 3], [-3, 1, 3], [3, 1, 3], [-3, 2, 3], [-2, 2, 3], [2, 2, 3], [3, 2, 3], [-2, 3, 3], [-1, 3, 3], [0, 3, 3], [1, 3, 3], [2, 3, 3], [-2, -2, 4], [-1, -2, 4], [0, -2, 4], [1, -2, 4], [2, -2, 4], [-2, -1, 4], [-1, -1, 4], [0, -1, 4], [1, -1, 4], [2, -1, 4], [-2, 0, 4], [-1, 0, 4], [0, 0, 4], [1, 0, 4], [2, 0, 4], [-2, 1, 4], [-1, 1, 4], [0, 1, 4], [1, 1, 4], [2, 1, 4], [-2, 2, 4], [-1, 2, 4], [0, 2, 4], [1, 2, 4], [2, 2, 4]]; actual = vx_sphere(5, false); - assertEqualPoints(expected, actual); + assert(expected == actual); } test_vx_sphere(); \ No newline at end of file