From 4bdf6fc991e916af293d19bd96687a156001c3ab Mon Sep 17 00:00:00 2001 From: Alec Jacobson Date: Mon, 6 Feb 2023 09:28:18 -0500 Subject: [PATCH 1/4] use vector --- src/exact_geodesic.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/exact_geodesic.cpp b/src/exact_geodesic.cpp index 113c4685..1727285c 100644 --- a/src/exact_geodesic.cpp +++ b/src/exact_geodesic.cpp @@ -48,7 +48,7 @@ npe_begin_code() //assert_cols_equals(fs, 1, "fs"); //assert_cols_equals(vt, 1, "vt"); //assert_cols_equals(ft, 1, "ft"); - EigenDenseLike d; + Eigen::Matrix d; igl::exact_geodesic(v, f, vs, fs, vt, ft, d); return npe::move(d); From 1dd23121e71ff22fbd12337e356bdffd1c94d7cf Mon Sep 17 00:00:00 2001 From: Alec Jacobson Date: Mon, 6 Feb 2023 09:34:15 -0500 Subject: [PATCH 2/4] =?UTF-8?q?float=20output=20=F0=9F=99=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/vector_area_matrix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vector_area_matrix.cpp b/src/vector_area_matrix.cpp index ff7a30b1..562629af 100644 --- a/src/vector_area_matrix.cpp +++ b/src/vector_area_matrix.cpp @@ -33,7 +33,7 @@ npe_arg(f, dense_int, dense_long, dense_longlong) npe_begin_code() assert_valid_tri_mesh_faces(f); - EigenSparseLike a; + Eigen::SparseMatrix a; igl::vector_area_matrix(f, a); return npe::move(a); From 34f820598684888dccf497c3ae131db8b6e49dd6 Mon Sep 17 00:00:00 2001 From: Alec Jacobson Date: Mon, 6 Feb 2023 09:38:45 -0500 Subject: [PATCH 3/4] augh fix incorrect test --- tests/test_basic.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/test_basic.py b/tests/test_basic.py index 5cfcb4b1..a3cbc441 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -3,6 +3,7 @@ import platform import igl +import igl.copyleft.cgal import numpy as np import scipy as sp import scipy.sparse as csc @@ -490,7 +491,7 @@ def test_read_dmat(self): # sparse matrix, no flag attribute def test_vector_area_matrix(self): a = igl.vector_area_matrix(self.f) - self.assertEqual(a.dtype, self.f.dtype) + self.assertEqual(a.dtype, "float64") self.assertEqual(a.shape[0], a.shape[1]) self.assertEqual(a.shape[0], self.v.shape[0]*2) @@ -2463,8 +2464,16 @@ def test_flip_edge(self): emap.dtype == self.f1.dtype) self.assertTrue(np.array(ue2e).dtype == self.f1.dtype) + # copyleft.cgal + def test_convex_hull(self): + V = np.array([[0,0,0],[1,0,0],[0,1,0],[0,0,1]],dtype="float64") + F = igl.copyleft.cgal.convex_hull(V) + F = np.sort(F) + F = F[np.lexsort(F.T[::-1],axis=0)] + F_gt = np.array([[0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3]],dtype="int64") + self.assertTrue((F == F_gt).all()) if __name__ == '__main__': - if len(sys.argv) > 1: - TestBasic.test_data_path = os.path.join(sys.argv.pop(),'') + if 'TEST_DATA_PATH' in os.environ: + TestBasic.test_data_path = os.path.join(os.environ['TEST_DATA_PATH'],'') unittest.main() From 484e9fb229f7eceff7617213927b3787ee4086b0 Mon Sep 17 00:00:00 2001 From: Alec Jacobson Date: Mon, 6 Feb 2023 12:32:15 -0500 Subject: [PATCH 4/4] rm igl.copyleft.cgal from test --- tests/test_basic.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tests/test_basic.py b/tests/test_basic.py index a3cbc441..aec03a90 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -3,7 +3,6 @@ import platform import igl -import igl.copyleft.cgal import numpy as np import scipy as sp import scipy.sparse as csc @@ -2464,14 +2463,6 @@ def test_flip_edge(self): emap.dtype == self.f1.dtype) self.assertTrue(np.array(ue2e).dtype == self.f1.dtype) - # copyleft.cgal - def test_convex_hull(self): - V = np.array([[0,0,0],[1,0,0],[0,1,0],[0,0,1]],dtype="float64") - F = igl.copyleft.cgal.convex_hull(V) - F = np.sort(F) - F = F[np.lexsort(F.T[::-1],axis=0)] - F_gt = np.array([[0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3]],dtype="int64") - self.assertTrue((F == F_gt).all()) if __name__ == '__main__': if 'TEST_DATA_PATH' in os.environ: