From 9f1aa6a653e143c9a4e1409c4a7217bdf3b96d75 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Thu, 20 Jun 2019 20:22:49 +0800 Subject: [PATCH] add test case --- test/pixel/test_px_cylinder.scad | 24 ++++++++++++++++++++++++ test/test_all.scad | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 test/pixel/test_px_cylinder.scad diff --git a/test/pixel/test_px_cylinder.scad b/test/pixel/test_px_cylinder.scad new file mode 100644 index 00000000..febd0c62 --- /dev/null +++ b/test/pixel/test_px_cylinder.scad @@ -0,0 +1,24 @@ + +module test_px_cylinder() { + echo("==== test_px_cylinder ===="); + + include ; + include ; + include ; + + r1 = 10; + r2 = 5; + h = 10; + + expected = [[-0.5, 9.5, 0], [-0.5, -10.5, 0], [9.5, -0.5, 0], [-10.5, -0.5, 0], [-1.5, 9.5, 0], [0.5, 9.5, 0], [-10.5, 0.5, 0], [9.5, 0.5, 0], [-10.5, -1.5, 0], [9.5, -1.5, 0], [-1.5, -10.5, 0], [0.5, -10.5, 0], [-2.5, 9.5, 0], [1.5, 9.5, 0], [-10.5, 1.5, 0], [9.5, 1.5, 0], [-10.5, -2.5, 0], [9.5, -2.5, 0], [-2.5, -10.5, 0], [1.5, -10.5, 0], [-3.5, 9.5, 0], [2.5, 9.5, 0], [-10.5, 2.5, 0], [9.5, 2.5, 0], [-10.5, -3.5, 0], [9.5, -3.5, 0], [-3.5, -10.5, 0], [2.5, -10.5, 0], [-4.5, 8.5, 0], [3.5, 8.5, 0], [-9.5, 3.5, 0], [8.5, 3.5, 0], [-9.5, -4.5, 0], [8.5, -4.5, 0], [-4.5, -9.5, 0], [3.5, -9.5, 0], [-5.5, 8.5, 0], [4.5, 8.5, 0], [-9.5, 4.5, 0], [8.5, 4.5, 0], [-9.5, -5.5, 0], [8.5, -5.5, 0], [-5.5, -9.5, 0], [4.5, -9.5, 0], [-6.5, 7.5, 0], [5.5, 7.5, 0], [-8.5, 5.5, 0], [7.5, 5.5, 0], [-8.5, -6.5, 0], [7.5, -6.5, 0], [-6.5, -8.5, 0], [5.5, -8.5, 0], [-7.5, 6.5, 0], [6.5, 6.5, 0], [-7.5, 6.5, 0], [6.5, 6.5, 0], [-7.5, -7.5, 0], [6.5, -7.5, 0], [-7.5, -7.5, 0], [6.5, -7.5, 0], [-0.5, 8.5, 1], [-0.5, -9.5, 1], [8.5, -0.5, 1], [-9.5, -0.5, 1], [-1.5, 8.5, 1], [0.5, 8.5, 1], [-9.5, 0.5, 1], [8.5, 0.5, 1], [-9.5, -1.5, 1], [8.5, -1.5, 1], [-1.5, -9.5, 1], [0.5, -9.5, 1], [-2.5, 8.5, 1], [1.5, 8.5, 1], [-9.5, 1.5, 1], [8.5, 1.5, 1], [-9.5, -2.5, 1], [8.5, -2.5, 1], [-2.5, -9.5, 1], [1.5, -9.5, 1], [-3.5, 7.5, 1], [2.5, 7.5, 1], [-8.5, 2.5, 1], [7.5, 2.5, 1], [-8.5, -3.5, 1], [7.5, -3.5, 1], [-3.5, -8.5, 1], [2.5, -8.5, 1], [-4.5, 7.5, 1], [3.5, 7.5, 1], [-8.5, 3.5, 1], [7.5, 3.5, 1], [-8.5, -4.5, 1], [7.5, -4.5, 1], [-4.5, -8.5, 1], [3.5, -8.5, 1], [-5.5, 7.5, 1], [4.5, 7.5, 1], [-8.5, 4.5, 1], [7.5, 4.5, 1], [-8.5, -5.5, 1], [7.5, -5.5, 1], [-5.5, -8.5, 1], [4.5, -8.5, 1], [-6.5, 6.5, 1], [5.5, 6.5, 1], [-7.5, 5.5, 1], [6.5, 5.5, 1], [-7.5, -6.5, 1], [6.5, -6.5, 1], [-6.5, -7.5, 1], [5.5, -7.5, 1], [-7.5, 5.5, 1], [6.5, 5.5, 1], [-6.5, 6.5, 1], [5.5, 6.5, 1], [-6.5, -7.5, 1], [5.5, -7.5, 1], [-7.5, -6.5, 1], [6.5, -6.5, 1], [-0.5, 8.5, 2], [-0.5, -9.5, 2], [8.5, -0.5, 2], [-9.5, -0.5, 2], [-1.5, 8.5, 2], [0.5, 8.5, 2], [-9.5, 0.5, 2], [8.5, 0.5, 2], [-9.5, -1.5, 2], [8.5, -1.5, 2], [-1.5, -9.5, 2], [0.5, -9.5, 2], [-2.5, 8.5, 2], [1.5, 8.5, 2], [-9.5, 1.5, 2], [8.5, 1.5, 2], [-9.5, -2.5, 2], [8.5, -2.5, 2], [-2.5, -9.5, 2], [1.5, -9.5, 2], [-3.5, 7.5, 2], [2.5, 7.5, 2], [-8.5, 2.5, 2], [7.5, 2.5, 2], [-8.5, -3.5, 2], [7.5, -3.5, 2], [-3.5, -8.5, 2], [2.5, -8.5, 2], [-4.5, 7.5, 2], [3.5, 7.5, 2], [-8.5, 3.5, 2], [7.5, 3.5, 2], [-8.5, -4.5, 2], [7.5, -4.5, 2], [-4.5, -8.5, 2], [3.5, -8.5, 2], [-5.5, 7.5, 2], [4.5, 7.5, 2], [-8.5, 4.5, 2], [7.5, 4.5, 2], [-8.5, -5.5, 2], [7.5, -5.5, 2], [-5.5, -8.5, 2], [4.5, -8.5, 2], [-6.5, 6.5, 2], [5.5, 6.5, 2], [-7.5, 5.5, 2], [6.5, 5.5, 2], [-7.5, -6.5, 2], [6.5, -6.5, 2], [-6.5, -7.5, 2], [5.5, -7.5, 2], [-7.5, 5.5, 2], [6.5, 5.5, 2], [-6.5, 6.5, 2], [5.5, 6.5, 2], [-6.5, -7.5, 2], [5.5, -7.5, 2], [-7.5, -6.5, 2], [6.5, -6.5, 2], [-0.5, 7.5, 3], [-0.5, -8.5, 3], [7.5, -0.5, 3], [-8.5, -0.5, 3], [-1.5, 7.5, 3], [0.5, 7.5, 3], [-8.5, 0.5, 3], [7.5, 0.5, 3], [-8.5, -1.5, 3], [7.5, -1.5, 3], [-1.5, -8.5, 3], [0.5, -8.5, 3], [-2.5, 7.5, 3], [1.5, 7.5, 3], [-8.5, 1.5, 3], [7.5, 1.5, 3], [-8.5, -2.5, 3], [7.5, -2.5, 3], [-2.5, -8.5, 3], [1.5, -8.5, 3], [-3.5, 6.5, 3], [2.5, 6.5, 3], [-7.5, 2.5, 3], [6.5, 2.5, 3], [-7.5, -3.5, 3], [6.5, -3.5, 3], [-3.5, -7.5, 3], [2.5, -7.5, 3], [-4.5, 6.5, 3], [3.5, 6.5, 3], [-7.5, 3.5, 3], [6.5, 3.5, 3], [-7.5, -4.5, 3], [6.5, -4.5, 3], [-4.5, -7.5, 3], [3.5, -7.5, 3], [-5.5, 5.5, 3], [4.5, 5.5, 3], [-6.5, 4.5, 3], [5.5, 4.5, 3], [-6.5, -5.5, 3], [5.5, -5.5, 3], [-5.5, -6.5, 3], [4.5, -6.5, 3], [-6.5, 5.5, 3], [5.5, 5.5, 3], [-6.5, 5.5, 3], [5.5, 5.5, 3], [-6.5, -6.5, 3], [5.5, -6.5, 3], [-6.5, -6.5, 3], [5.5, -6.5, 3], [-0.5, 7.5, 4], [-0.5, -8.5, 4], [7.5, -0.5, 4], [-8.5, -0.5, 4], [-1.5, 7.5, 4], [0.5, 7.5, 4], [-8.5, 0.5, 4], [7.5, 0.5, 4], [-8.5, -1.5, 4], [7.5, -1.5, 4], [-1.5, -8.5, 4], [0.5, -8.5, 4], [-2.5, 7.5, 4], [1.5, 7.5, 4], [-8.5, 1.5, 4], [7.5, 1.5, 4], [-8.5, -2.5, 4], [7.5, -2.5, 4], [-2.5, -8.5, 4], [1.5, -8.5, 4], [-3.5, 6.5, 4], [2.5, 6.5, 4], [-7.5, 2.5, 4], [6.5, 2.5, 4], [-7.5, -3.5, 4], [6.5, -3.5, 4], [-3.5, -7.5, 4], [2.5, -7.5, 4], [-4.5, 6.5, 4], [3.5, 6.5, 4], [-7.5, 3.5, 4], [6.5, 3.5, 4], [-7.5, -4.5, 4], [6.5, -4.5, 4], [-4.5, -7.5, 4], [3.5, -7.5, 4], [-5.5, 5.5, 4], [4.5, 5.5, 4], [-6.5, 4.5, 4], [5.5, 4.5, 4], [-6.5, -5.5, 4], [5.5, -5.5, 4], [-5.5, -6.5, 4], [4.5, -6.5, 4], [-6.5, 5.5, 4], [5.5, 5.5, 4], [-6.5, 5.5, 4], [5.5, 5.5, 4], [-6.5, -6.5, 4], [5.5, -6.5, 4], [-6.5, -6.5, 4], [5.5, -6.5, 4], [-0.5, 6.5, 5], [-0.5, -7.5, 5], [6.5, -0.5, 5], [-7.5, -0.5, 5], [-1.5, 6.5, 5], [0.5, 6.5, 5], [-7.5, 0.5, 5], [6.5, 0.5, 5], [-7.5, -1.5, 5], [6.5, -1.5, 5], [-1.5, -7.5, 5], [0.5, -7.5, 5], [-2.5, 6.5, 5], [1.5, 6.5, 5], [-7.5, 1.5, 5], [6.5, 1.5, 5], [-7.5, -2.5, 5], [6.5, -2.5, 5], [-2.5, -7.5, 5], [1.5, -7.5, 5], [-3.5, 5.5, 5], [2.5, 5.5, 5], [-6.5, 2.5, 5], [5.5, 2.5, 5], [-6.5, -3.5, 5], [5.5, -3.5, 5], [-3.5, -6.5, 5], [2.5, -6.5, 5], [-4.5, 5.5, 5], [3.5, 5.5, 5], [-6.5, 3.5, 5], [5.5, 3.5, 5], [-6.5, -4.5, 5], [5.5, -4.5, 5], [-4.5, -6.5, 5], [3.5, -6.5, 5], [-5.5, 4.5, 5], [4.5, 4.5, 5], [-5.5, 4.5, 5], [4.5, 4.5, 5], [-5.5, -5.5, 5], [4.5, -5.5, 5], [-5.5, -5.5, 5], [4.5, -5.5, 5], [-0.5, 6.5, 6], [-0.5, -7.5, 6], [6.5, -0.5, 6], [-7.5, -0.5, 6], [-1.5, 6.5, 6], [0.5, 6.5, 6], [-7.5, 0.5, 6], [6.5, 0.5, 6], [-7.5, -1.5, 6], [6.5, -1.5, 6], [-1.5, -7.5, 6], [0.5, -7.5, 6], [-2.5, 6.5, 6], [1.5, 6.5, 6], [-7.5, 1.5, 6], [6.5, 1.5, 6], [-7.5, -2.5, 6], [6.5, -2.5, 6], [-2.5, -7.5, 6], [1.5, -7.5, 6], [-3.5, 5.5, 6], [2.5, 5.5, 6], [-6.5, 2.5, 6], [5.5, 2.5, 6], [-6.5, -3.5, 6], [5.5, -3.5, 6], [-3.5, -6.5, 6], [2.5, -6.5, 6], [-4.5, 5.5, 6], [3.5, 5.5, 6], [-6.5, 3.5, 6], [5.5, 3.5, 6], [-6.5, -4.5, 6], [5.5, -4.5, 6], [-4.5, -6.5, 6], [3.5, -6.5, 6], [-5.5, 4.5, 6], [4.5, 4.5, 6], [-5.5, 4.5, 6], [4.5, 4.5, 6], [-5.5, -5.5, 6], [4.5, -5.5, 6], [-5.5, -5.5, 6], [4.5, -5.5, 6], [-0.5, 5.5, 7], [-0.5, -6.5, 7], [5.5, -0.5, 7], [-6.5, -0.5, 7], [-1.5, 5.5, 7], [0.5, 5.5, 7], [-6.5, 0.5, 7], [5.5, 0.5, 7], [-6.5, -1.5, 7], [5.5, -1.5, 7], [-1.5, -6.5, 7], [0.5, -6.5, 7], [-2.5, 5.5, 7], [1.5, 5.5, 7], [-6.5, 1.5, 7], [5.5, 1.5, 7], [-6.5, -2.5, 7], [5.5, -2.5, 7], [-2.5, -6.5, 7], [1.5, -6.5, 7], [-3.5, 4.5, 7], [2.5, 4.5, 7], [-5.5, 2.5, 7], [4.5, 2.5, 7], [-5.5, -3.5, 7], [4.5, -3.5, 7], [-3.5, -5.5, 7], [2.5, -5.5, 7], [-4.5, 4.5, 7], [3.5, 4.5, 7], [-5.5, 3.5, 7], [4.5, 3.5, 7], [-5.5, -4.5, 7], [4.5, -4.5, 7], [-4.5, -5.5, 7], [3.5, -5.5, 7], [-5.5, 3.5, 7], [4.5, 3.5, 7], [-4.5, 4.5, 7], [3.5, 4.5, 7], [-4.5, -5.5, 7], [3.5, -5.5, 7], [-5.5, -4.5, 7], [4.5, -4.5, 7], [-0.5, 5.5, 8], [-0.5, -6.5, 8], [5.5, -0.5, 8], [-6.5, -0.5, 8], [-1.5, 5.5, 8], [0.5, 5.5, 8], [-6.5, 0.5, 8], [5.5, 0.5, 8], [-6.5, -1.5, 8], [5.5, -1.5, 8], [-1.5, -6.5, 8], [0.5, -6.5, 8], [-2.5, 5.5, 8], [1.5, 5.5, 8], [-6.5, 1.5, 8], [5.5, 1.5, 8], [-6.5, -2.5, 8], [5.5, -2.5, 8], [-2.5, -6.5, 8], [1.5, -6.5, 8], [-3.5, 4.5, 8], [2.5, 4.5, 8], [-5.5, 2.5, 8], [4.5, 2.5, 8], [-5.5, -3.5, 8], [4.5, -3.5, 8], [-3.5, -5.5, 8], [2.5, -5.5, 8], [-4.5, 4.5, 8], [3.5, 4.5, 8], [-5.5, 3.5, 8], [4.5, 3.5, 8], [-5.5, -4.5, 8], [4.5, -4.5, 8], [-4.5, -5.5, 8], [3.5, -5.5, 8], [-5.5, 3.5, 8], [4.5, 3.5, 8], [-4.5, 4.5, 8], [3.5, 4.5, 8], [-4.5, -5.5, 8], [3.5, -5.5, 8], [-5.5, -4.5, 8], [4.5, -4.5, 8], [-0.5, 4.5, 9], [-0.5, -5.5, 9], [4.5, -0.5, 9], [-5.5, -0.5, 9], [-1.5, 4.5, 9], [0.5, 4.5, 9], [-5.5, 0.5, 9], [4.5, 0.5, 9], [-5.5, -1.5, 9], [4.5, -1.5, 9], [-1.5, -5.5, 9], [0.5, -5.5, 9], [-2.5, 4.5, 9], [1.5, 4.5, 9], [-5.5, 1.5, 9], [4.5, 1.5, 9], [-5.5, -2.5, 9], [4.5, -2.5, 9], [-2.5, -5.5, 9], [1.5, -5.5, 9], [-3.5, 3.5, 9], [2.5, 3.5, 9], [-4.5, 2.5, 9], [3.5, 2.5, 9], [-4.5, -3.5, 9], [3.5, -3.5, 9], [-3.5, -4.5, 9], [2.5, -4.5, 9], [-4.5, 2.5, 9], [3.5, 2.5, 9], [-3.5, 3.5, 9], [2.5, 3.5, 9], [-3.5, -4.5, 9], [2.5, -4.5, 9], [-4.5, -3.5, 9], [3.5, -3.5, 9]]; + actual = px_cylinder([r1, r2], h, [-0.5, -0.5], false); + + assertEqualPoints(expected, actual); + + expected2 = [[-0.5, 9.5, 0], [-0.5, -10.5, 0], [9.5, -0.5, 0], [-10.5, -0.5, 0], [-1.5, 9.5, 0], [0.5, 9.5, 0], [-10.5, 0.5, 0], [9.5, 0.5, 0], [-10.5, -1.5, 0], [9.5, -1.5, 0], [-1.5, -10.5, 0], [0.5, -10.5, 0], [-2.5, 9.5, 0], [1.5, 9.5, 0], [-10.5, 1.5, 0], [9.5, 1.5, 0], [-10.5, -2.5, 0], [9.5, -2.5, 0], [-2.5, -10.5, 0], [1.5, -10.5, 0], [-3.5, 9.5, 0], [2.5, 9.5, 0], [-10.5, 2.5, 0], [9.5, 2.5, 0], [-10.5, -3.5, 0], [9.5, -3.5, 0], [-3.5, -10.5, 0], [2.5, -10.5, 0], [-4.5, 8.5, 0], [3.5, 8.5, 0], [-9.5, 3.5, 0], [8.5, 3.5, 0], [-9.5, -4.5, 0], [8.5, -4.5, 0], [-4.5, -9.5, 0], [3.5, -9.5, 0], [-5.5, 8.5, 0], [4.5, 8.5, 0], [-9.5, 4.5, 0], [8.5, 4.5, 0], [-9.5, -5.5, 0], [8.5, -5.5, 0], [-5.5, -9.5, 0], [4.5, -9.5, 0], [-6.5, 7.5, 0], [5.5, 7.5, 0], [-8.5, 5.5, 0], [7.5, 5.5, 0], [-8.5, -6.5, 0], [7.5, -6.5, 0], [-6.5, -8.5, 0], [5.5, -8.5, 0], [-7.5, 6.5, 0], [6.5, 6.5, 0], [-7.5, 6.5, 0], [6.5, 6.5, 0], [-7.5, -7.5, 0], [6.5, -7.5, 0], [-7.5, -7.5, 0], [6.5, -7.5, 0], [-0.5, 9.5, 1], [-0.5, -10.5, 1], [9.5, -0.5, 1], [-10.5, -0.5, 1], [-1.5, 9.5, 1], [0.5, 9.5, 1], [-10.5, 0.5, 1], [9.5, 0.5, 1], [-10.5, -1.5, 1], [9.5, -1.5, 1], [-1.5, -10.5, 1], [0.5, -10.5, 1], [-2.5, 9.5, 1], [1.5, 9.5, 1], [-10.5, 1.5, 1], [9.5, 1.5, 1], [-10.5, -2.5, 1], [9.5, -2.5, 1], [-2.5, -10.5, 1], [1.5, -10.5, 1], [-3.5, 9.5, 1], [2.5, 9.5, 1], [-10.5, 2.5, 1], [9.5, 2.5, 1], [-10.5, -3.5, 1], [9.5, -3.5, 1], [-3.5, -10.5, 1], [2.5, -10.5, 1], [-4.5, 8.5, 1], [3.5, 8.5, 1], [-9.5, 3.5, 1], [8.5, 3.5, 1], [-9.5, -4.5, 1], [8.5, -4.5, 1], [-4.5, -9.5, 1], [3.5, -9.5, 1], [-5.5, 8.5, 1], [4.5, 8.5, 1], [-9.5, 4.5, 1], [8.5, 4.5, 1], [-9.5, -5.5, 1], [8.5, -5.5, 1], [-5.5, -9.5, 1], [4.5, -9.5, 1], [-6.5, 7.5, 1], [5.5, 7.5, 1], [-8.5, 5.5, 1], [7.5, 5.5, 1], [-8.5, -6.5, 1], [7.5, -6.5, 1], [-6.5, -8.5, 1], [5.5, -8.5, 1], [-7.5, 6.5, 1], [6.5, 6.5, 1], [-7.5, 6.5, 1], [6.5, 6.5, 1], [-7.5, -7.5, 1], [6.5, -7.5, 1], [-7.5, -7.5, 1], [6.5, -7.5, 1], [-0.5, 9.5, 2], [-0.5, -10.5, 2], [9.5, -0.5, 2], [-10.5, -0.5, 2], [-1.5, 9.5, 2], [0.5, 9.5, 2], [-10.5, 0.5, 2], [9.5, 0.5, 2], [-10.5, -1.5, 2], [9.5, -1.5, 2], [-1.5, -10.5, 2], [0.5, -10.5, 2], [-2.5, 9.5, 2], [1.5, 9.5, 2], [-10.5, 1.5, 2], [9.5, 1.5, 2], [-10.5, -2.5, 2], [9.5, -2.5, 2], [-2.5, -10.5, 2], [1.5, -10.5, 2], [-3.5, 9.5, 2], [2.5, 9.5, 2], [-10.5, 2.5, 2], [9.5, 2.5, 2], [-10.5, -3.5, 2], [9.5, -3.5, 2], [-3.5, -10.5, 2], [2.5, -10.5, 2], [-4.5, 8.5, 2], [3.5, 8.5, 2], [-9.5, 3.5, 2], [8.5, 3.5, 2], [-9.5, -4.5, 2], [8.5, -4.5, 2], [-4.5, -9.5, 2], [3.5, -9.5, 2], [-5.5, 8.5, 2], [4.5, 8.5, 2], [-9.5, 4.5, 2], [8.5, 4.5, 2], [-9.5, -5.5, 2], [8.5, -5.5, 2], [-5.5, -9.5, 2], [4.5, -9.5, 2], [-6.5, 7.5, 2], [5.5, 7.5, 2], [-8.5, 5.5, 2], [7.5, 5.5, 2], [-8.5, -6.5, 2], [7.5, -6.5, 2], [-6.5, -8.5, 2], [5.5, -8.5, 2], [-7.5, 6.5, 2], [6.5, 6.5, 2], [-7.5, 6.5, 2], [6.5, 6.5, 2], [-7.5, -7.5, 2], [6.5, -7.5, 2], [-7.5, -7.5, 2], [6.5, -7.5, 2], [-0.5, 9.5, 3], [-0.5, -10.5, 3], [9.5, -0.5, 3], [-10.5, -0.5, 3], [-1.5, 9.5, 3], [0.5, 9.5, 3], [-10.5, 0.5, 3], [9.5, 0.5, 3], [-10.5, -1.5, 3], [9.5, -1.5, 3], [-1.5, -10.5, 3], [0.5, -10.5, 3], [-2.5, 9.5, 3], [1.5, 9.5, 3], [-10.5, 1.5, 3], [9.5, 1.5, 3], [-10.5, -2.5, 3], [9.5, -2.5, 3], [-2.5, -10.5, 3], [1.5, -10.5, 3], [-3.5, 9.5, 3], [2.5, 9.5, 3], [-10.5, 2.5, 3], [9.5, 2.5, 3], [-10.5, -3.5, 3], [9.5, -3.5, 3], [-3.5, -10.5, 3], [2.5, -10.5, 3], [-4.5, 8.5, 3], [3.5, 8.5, 3], [-9.5, 3.5, 3], [8.5, 3.5, 3], [-9.5, -4.5, 3], [8.5, -4.5, 3], [-4.5, -9.5, 3], [3.5, -9.5, 3], [-5.5, 8.5, 3], [4.5, 8.5, 3], [-9.5, 4.5, 3], [8.5, 4.5, 3], [-9.5, -5.5, 3], [8.5, -5.5, 3], [-5.5, -9.5, 3], [4.5, -9.5, 3], [-6.5, 7.5, 3], [5.5, 7.5, 3], [-8.5, 5.5, 3], [7.5, 5.5, 3], [-8.5, -6.5, 3], [7.5, -6.5, 3], [-6.5, -8.5, 3], [5.5, -8.5, 3], [-7.5, 6.5, 3], [6.5, 6.5, 3], [-7.5, 6.5, 3], [6.5, 6.5, 3], [-7.5, -7.5, 3], [6.5, -7.5, 3], [-7.5, -7.5, 3], [6.5, -7.5, 3], [-0.5, 9.5, 4], [-0.5, -10.5, 4], [9.5, -0.5, 4], [-10.5, -0.5, 4], [-1.5, 9.5, 4], [0.5, 9.5, 4], [-10.5, 0.5, 4], [9.5, 0.5, 4], [-10.5, -1.5, 4], [9.5, -1.5, 4], [-1.5, -10.5, 4], [0.5, -10.5, 4], [-2.5, 9.5, 4], [1.5, 9.5, 4], [-10.5, 1.5, 4], [9.5, 1.5, 4], [-10.5, -2.5, 4], [9.5, -2.5, 4], [-2.5, -10.5, 4], [1.5, -10.5, 4], [-3.5, 9.5, 4], [2.5, 9.5, 4], [-10.5, 2.5, 4], [9.5, 2.5, 4], [-10.5, -3.5, 4], [9.5, -3.5, 4], [-3.5, -10.5, 4], [2.5, -10.5, 4], [-4.5, 8.5, 4], [3.5, 8.5, 4], [-9.5, 3.5, 4], [8.5, 3.5, 4], [-9.5, -4.5, 4], [8.5, -4.5, 4], [-4.5, -9.5, 4], [3.5, -9.5, 4], [-5.5, 8.5, 4], [4.5, 8.5, 4], [-9.5, 4.5, 4], [8.5, 4.5, 4], [-9.5, -5.5, 4], [8.5, -5.5, 4], [-5.5, -9.5, 4], [4.5, -9.5, 4], [-6.5, 7.5, 4], [5.5, 7.5, 4], [-8.5, 5.5, 4], [7.5, 5.5, 4], [-8.5, -6.5, 4], [7.5, -6.5, 4], [-6.5, -8.5, 4], [5.5, -8.5, 4], [-7.5, 6.5, 4], [6.5, 6.5, 4], [-7.5, 6.5, 4], [6.5, 6.5, 4], [-7.5, -7.5, 4], [6.5, -7.5, 4], [-7.5, -7.5, 4], [6.5, -7.5, 4], [-0.5, 9.5, 5], [-0.5, -10.5, 5], [9.5, -0.5, 5], [-10.5, -0.5, 5], [-1.5, 9.5, 5], [0.5, 9.5, 5], [-10.5, 0.5, 5], [9.5, 0.5, 5], [-10.5, -1.5, 5], [9.5, -1.5, 5], [-1.5, -10.5, 5], [0.5, -10.5, 5], [-2.5, 9.5, 5], [1.5, 9.5, 5], [-10.5, 1.5, 5], [9.5, 1.5, 5], [-10.5, -2.5, 5], [9.5, -2.5, 5], [-2.5, -10.5, 5], [1.5, -10.5, 5], [-3.5, 9.5, 5], [2.5, 9.5, 5], [-10.5, 2.5, 5], [9.5, 2.5, 5], [-10.5, -3.5, 5], [9.5, -3.5, 5], [-3.5, -10.5, 5], [2.5, -10.5, 5], [-4.5, 8.5, 5], [3.5, 8.5, 5], [-9.5, 3.5, 5], [8.5, 3.5, 5], [-9.5, -4.5, 5], [8.5, -4.5, 5], [-4.5, -9.5, 5], [3.5, -9.5, 5], [-5.5, 8.5, 5], [4.5, 8.5, 5], [-9.5, 4.5, 5], [8.5, 4.5, 5], [-9.5, -5.5, 5], [8.5, -5.5, 5], [-5.5, -9.5, 5], [4.5, -9.5, 5], [-6.5, 7.5, 5], [5.5, 7.5, 5], [-8.5, 5.5, 5], [7.5, 5.5, 5], [-8.5, -6.5, 5], [7.5, -6.5, 5], [-6.5, -8.5, 5], [5.5, -8.5, 5], [-7.5, 6.5, 5], [6.5, 6.5, 5], [-7.5, 6.5, 5], [6.5, 6.5, 5], [-7.5, -7.5, 5], [6.5, -7.5, 5], [-7.5, -7.5, 5], [6.5, -7.5, 5], [-0.5, 9.5, 6], [-0.5, -10.5, 6], [9.5, -0.5, 6], [-10.5, -0.5, 6], [-1.5, 9.5, 6], [0.5, 9.5, 6], [-10.5, 0.5, 6], [9.5, 0.5, 6], [-10.5, -1.5, 6], [9.5, -1.5, 6], [-1.5, -10.5, 6], [0.5, -10.5, 6], [-2.5, 9.5, 6], [1.5, 9.5, 6], [-10.5, 1.5, 6], [9.5, 1.5, 6], [-10.5, -2.5, 6], [9.5, -2.5, 6], [-2.5, -10.5, 6], [1.5, -10.5, 6], [-3.5, 9.5, 6], [2.5, 9.5, 6], [-10.5, 2.5, 6], [9.5, 2.5, 6], [-10.5, -3.5, 6], [9.5, -3.5, 6], [-3.5, -10.5, 6], [2.5, -10.5, 6], [-4.5, 8.5, 6], [3.5, 8.5, 6], [-9.5, 3.5, 6], [8.5, 3.5, 6], [-9.5, -4.5, 6], [8.5, -4.5, 6], [-4.5, -9.5, 6], [3.5, -9.5, 6], [-5.5, 8.5, 6], [4.5, 8.5, 6], [-9.5, 4.5, 6], [8.5, 4.5, 6], [-9.5, -5.5, 6], [8.5, -5.5, 6], [-5.5, -9.5, 6], [4.5, -9.5, 6], [-6.5, 7.5, 6], [5.5, 7.5, 6], [-8.5, 5.5, 6], [7.5, 5.5, 6], [-8.5, -6.5, 6], [7.5, -6.5, 6], [-6.5, -8.5, 6], [5.5, -8.5, 6], [-7.5, 6.5, 6], [6.5, 6.5, 6], [-7.5, 6.5, 6], [6.5, 6.5, 6], [-7.5, -7.5, 6], [6.5, -7.5, 6], [-7.5, -7.5, 6], [6.5, -7.5, 6], [-0.5, 9.5, 7], [-0.5, -10.5, 7], [9.5, -0.5, 7], [-10.5, -0.5, 7], [-1.5, 9.5, 7], [0.5, 9.5, 7], [-10.5, 0.5, 7], [9.5, 0.5, 7], [-10.5, -1.5, 7], [9.5, -1.5, 7], [-1.5, -10.5, 7], [0.5, -10.5, 7], [-2.5, 9.5, 7], [1.5, 9.5, 7], [-10.5, 1.5, 7], [9.5, 1.5, 7], [-10.5, -2.5, 7], [9.5, -2.5, 7], [-2.5, -10.5, 7], [1.5, -10.5, 7], [-3.5, 9.5, 7], [2.5, 9.5, 7], [-10.5, 2.5, 7], [9.5, 2.5, 7], [-10.5, -3.5, 7], [9.5, -3.5, 7], [-3.5, -10.5, 7], [2.5, -10.5, 7], [-4.5, 8.5, 7], [3.5, 8.5, 7], [-9.5, 3.5, 7], [8.5, 3.5, 7], [-9.5, -4.5, 7], [8.5, -4.5, 7], [-4.5, -9.5, 7], [3.5, -9.5, 7], [-5.5, 8.5, 7], [4.5, 8.5, 7], [-9.5, 4.5, 7], [8.5, 4.5, 7], [-9.5, -5.5, 7], [8.5, -5.5, 7], [-5.5, -9.5, 7], [4.5, -9.5, 7], [-6.5, 7.5, 7], [5.5, 7.5, 7], [-8.5, 5.5, 7], [7.5, 5.5, 7], [-8.5, -6.5, 7], [7.5, -6.5, 7], [-6.5, -8.5, 7], [5.5, -8.5, 7], [-7.5, 6.5, 7], [6.5, 6.5, 7], [-7.5, 6.5, 7], [6.5, 6.5, 7], [-7.5, -7.5, 7], [6.5, -7.5, 7], [-7.5, -7.5, 7], [6.5, -7.5, 7], [-0.5, 9.5, 8], [-0.5, -10.5, 8], [9.5, -0.5, 8], [-10.5, -0.5, 8], [-1.5, 9.5, 8], [0.5, 9.5, 8], [-10.5, 0.5, 8], [9.5, 0.5, 8], [-10.5, -1.5, 8], [9.5, -1.5, 8], [-1.5, -10.5, 8], [0.5, -10.5, 8], [-2.5, 9.5, 8], [1.5, 9.5, 8], [-10.5, 1.5, 8], [9.5, 1.5, 8], [-10.5, -2.5, 8], [9.5, -2.5, 8], [-2.5, -10.5, 8], [1.5, -10.5, 8], [-3.5, 9.5, 8], [2.5, 9.5, 8], [-10.5, 2.5, 8], [9.5, 2.5, 8], [-10.5, -3.5, 8], [9.5, -3.5, 8], [-3.5, -10.5, 8], [2.5, -10.5, 8], [-4.5, 8.5, 8], [3.5, 8.5, 8], [-9.5, 3.5, 8], [8.5, 3.5, 8], [-9.5, -4.5, 8], [8.5, -4.5, 8], [-4.5, -9.5, 8], [3.5, -9.5, 8], [-5.5, 8.5, 8], [4.5, 8.5, 8], [-9.5, 4.5, 8], [8.5, 4.5, 8], [-9.5, -5.5, 8], [8.5, -5.5, 8], [-5.5, -9.5, 8], [4.5, -9.5, 8], [-6.5, 7.5, 8], [5.5, 7.5, 8], [-8.5, 5.5, 8], [7.5, 5.5, 8], [-8.5, -6.5, 8], [7.5, -6.5, 8], [-6.5, -8.5, 8], [5.5, -8.5, 8], [-7.5, 6.5, 8], [6.5, 6.5, 8], [-7.5, 6.5, 8], [6.5, 6.5, 8], [-7.5, -7.5, 8], [6.5, -7.5, 8], [-7.5, -7.5, 8], [6.5, -7.5, 8], [-0.5, 9.5, 9], [-0.5, -10.5, 9], [9.5, -0.5, 9], [-10.5, -0.5, 9], [-1.5, 9.5, 9], [0.5, 9.5, 9], [-10.5, 0.5, 9], [9.5, 0.5, 9], [-10.5, -1.5, 9], [9.5, -1.5, 9], [-1.5, -10.5, 9], [0.5, -10.5, 9], [-2.5, 9.5, 9], [1.5, 9.5, 9], [-10.5, 1.5, 9], [9.5, 1.5, 9], [-10.5, -2.5, 9], [9.5, -2.5, 9], [-2.5, -10.5, 9], [1.5, -10.5, 9], [-3.5, 9.5, 9], [2.5, 9.5, 9], [-10.5, 2.5, 9], [9.5, 2.5, 9], [-10.5, -3.5, 9], [9.5, -3.5, 9], [-3.5, -10.5, 9], [2.5, -10.5, 9], [-4.5, 8.5, 9], [3.5, 8.5, 9], [-9.5, 3.5, 9], [8.5, 3.5, 9], [-9.5, -4.5, 9], [8.5, -4.5, 9], [-4.5, -9.5, 9], [3.5, -9.5, 9], [-5.5, 8.5, 9], [4.5, 8.5, 9], [-9.5, 4.5, 9], [8.5, 4.5, 9], [-9.5, -5.5, 9], [8.5, -5.5, 9], [-5.5, -9.5, 9], [4.5, -9.5, 9], [-6.5, 7.5, 9], [5.5, 7.5, 9], [-8.5, 5.5, 9], [7.5, 5.5, 9], [-8.5, -6.5, 9], [7.5, -6.5, 9], [-6.5, -8.5, 9], [5.5, -8.5, 9], [-7.5, 6.5, 9], [6.5, 6.5, 9], [-7.5, 6.5, 9], [6.5, 6.5, 9], [-7.5, -7.5, 9], [6.5, -7.5, 9], [-7.5, -7.5, 9], [6.5, -7.5, 9]]; + actual2 = px_cylinder(r1, h, [-0.5, -0.5], false); + + assertEqualPoints(expected2, actual2); +} + +test_px_cylinder(); \ No newline at end of file diff --git a/test/test_all.scad b/test/test_all.scad index 947b9faf..8a15bb02 100644 --- a/test/test_all.scad +++ b/test/test_all.scad @@ -69,4 +69,5 @@ include ; // Pixel include ; include ; -include ; \ No newline at end of file +include ; +include ; \ No newline at end of file