From ffbb7c5db42087ca3ecb55ba388ecc233a1a9a86 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Fri, 11 Mar 2022 15:29:11 +0800 Subject: [PATCH] add test --- test/test_all.scad | 3 ++- test/util/test_spherical_coordinate.scad | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 test/util/test_spherical_coordinate.scad diff --git a/test/test_all.scad b/test/test_all.scad index 42d46ebd..4e6f742b 100644 --- a/test/test_all.scad +++ b/test/test_all.scad @@ -72,9 +72,10 @@ include ; include ; include ; include ; +include ; +include ; include ; include ; -include ; // Voxel include ; diff --git a/test/util/test_spherical_coordinate.scad b/test/util/test_spherical_coordinate.scad new file mode 100644 index 00000000..4334a805 --- /dev/null +++ b/test/util/test_spherical_coordinate.scad @@ -0,0 +1,13 @@ +use ; +use ; + +module test_spherical_coordinate() { + echo("==== test_spherical_coordinate ===="); + coord = spherical_coordinate([100, 100, 100]); + r = round(coord[0]); + theta = round(coord[1]); + phi = round(coord[2]); + assert([r, theta, phi] == [173, 45, 55]); +} + +test_spherical_coordinate(); \ No newline at end of file