diff --git a/cmake/PyiglDependencies.cmake b/cmake/PyiglDependencies.cmake index 9490c323..c644a1ac 100644 --- a/cmake/PyiglDependencies.cmake +++ b/cmake/PyiglDependencies.cmake @@ -19,7 +19,7 @@ include(FetchContent) FetchContent_Declare( libigl GIT_REPOSITORY https://github.com/libigl/libigl.git - GIT_TAG d7954041d1f21501e3d4776464a59d0251dde184 + GIT_TAG 5779714a5bdd62e105a96edfa73d0d3755e33bc8 ) FetchContent_GetProperties(libigl) FetchContent_MakeAvailable(libigl) diff --git a/setup.py b/setup.py index 8b2884da..6799e6e2 100644 --- a/setup.py +++ b/setup.py @@ -111,6 +111,16 @@ def build_extension(self, ext): os.makedirs(self.build_temp) subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env) + # print build_args + print("********************************************************************") + print("********************************************************************") + print("********************************************************************") + print("********************************************************************") + print("build_args:", build_args) + print("********************************************************************") + print("********************************************************************") + print("********************************************************************") + print("********************************************************************") subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp) print() # Add an empty line for cleaner output diff --git a/src/is_irregular_vertex.cpp b/src/is_irregular_vertex.cpp index 1850dc1f..c7aa28e6 100644 --- a/src/is_irregular_vertex.cpp +++ b/src/is_irregular_vertex.cpp @@ -16,7 +16,6 @@ Determine if a vertex is irregular, i.e. it has more than 6 (triangles) or 4 (qu Parameters ---------- -v : #v by dim array of vertex positions f : #f by 3[4] array of triangle[quads] indices Returns @@ -39,12 +38,10 @@ Examples npe_function(is_irregular_vertex) npe_doc(ds_is_irregular_vertex) -npe_arg(v, dense_float, dense_double) npe_arg(f, dense_int, dense_long, dense_longlong) npe_begin_code() - assert_valid_tet_or_tri_mesh_23d(v, f); - const std::vector res = igl::is_irregular_vertex(v, f); + const std::vector res = igl::is_irregular_vertex(f); return res; npe_end_code() diff --git a/src/isolines.cpp b/src/isolines.cpp index 49bbc18d..1fa56b23 100644 --- a/src/isolines.cpp +++ b/src/isolines.cpp @@ -17,15 +17,16 @@ const char *ds_isolines = R"igl_Qu8mg5v7( Parameters ---------- - V #V by dim list of mesh vertex positions - F #F by 3 list of mesh faces (must be triangles) - z #V by 1 list of function values evaluated at vertices - n the number of desired isolines + V #V by dim list of mesh vertex positions + F #F by 3 list of mesh triangle indices into V + S #S by 1 list of per-vertex scalar values + vals #vals by 1 list of values to compute isolines for Returns ------- - isoV #isoV by dim list of isoline vertex positions - isoE #isoE by 2 list of isoline edge positions + iV #iV by dim list of isoline vertex positions + iE #iE by 2 list of edge indices into iV + I #iE by 1 list of indices into vals indicating which value See also -------- @@ -44,21 +45,23 @@ Examples npe_function(isolines) npe_doc(ds_isolines) -npe_arg(v, dense_float, dense_double) -npe_arg(f, dense_int, dense_long, dense_longlong) -npe_arg(z, dense_float, dense_double) -npe_arg(n, int) +npe_arg(V, dense_float, dense_double) +npe_arg(F, dense_int, dense_long, dense_longlong) +npe_arg(S, npe_matches(V)) +npe_arg(vals, npe_matches(S)) npe_begin_code() - assert_valid_23d_tri_mesh(v, f); - assert_rows_match(v, z, "v", "z"); - assert_cols_equals(z, 1, "z"); - EigenDenseLike iso_v; - EigenDenseLike iso_e; - igl::isolines(v, f, z, n, iso_v, iso_e); - return std::make_tuple(npe::move(iso_v), npe::move(iso_e)); + assert_valid_23d_tri_mesh(V, F); + assert_rows_match(V, S, "V", "S"); + assert_cols_equals(S, 1, "S"); + EigenDenseLike iV; + EigenDenseLike iE; + Eigen::Matrix I; + Eigen::Matrix vals_copy = vals; + igl::isolines(V, F, S.col(0), vals_copy, iV, iE, I); + return std::make_tuple(npe::move(iV), npe::move(iE), npe::move(I)); npe_end_code() diff --git a/src/topological_hole_fill.cpp b/src/topological_hole_fill.cpp index 6e8275df..63b6fa76 100644 --- a/src/topological_hole_fill.cpp +++ b/src/topological_hole_fill.cpp @@ -22,7 +22,6 @@ Parameters ---------- F #F by simplex-size list of element indices -b #b boundary indices to preserve holes vector of hole loops to fill Returns @@ -47,14 +46,13 @@ npe_function(topological_hole_fill) npe_doc(ds_topological_hole_fill) npe_arg(f, dense_int, dense_long, dense_longlong) -npe_arg(b, dense_int, dense_long, dense_longlong) npe_arg(holes, std::vector>) npe_begin_code() EigenDense f_filled; - igl::topological_hole_fill(f, b, holes, f_filled); + igl::topological_hole_fill(f, holes, f_filled); return npe::move(f_filled); npe_end_code() diff --git a/tests/test_basic.py b/tests/test_basic.py index 78ba8893..5bc524fa 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -522,13 +522,16 @@ def test_hausdorff(self): def test_isolines(self): func = np.random.rand(self.v1.shape[0], 1) - iso_v, iso_e = igl.isolines(self.v1, self.f1, func, 10) + vals = np.linspace(0,1, 10) + iso_v, iso_e, I = igl.isolines(self.v1, self.f1, func, vals) self.assertEqual(iso_v.dtype, func.dtype) self.assertEqual(iso_e.dtype, self.f1.dtype) self.assertEqual(iso_e.shape[1], 2) + self.assertEqual(iso_e.shape[0], I.shape[0]) self.assertTrue(iso_v.flags.c_contiguous) self.assertTrue(iso_e.flags.c_contiguous) + self.assertTrue(I.flags.c_contiguous) def test_unproject_ray(self): pos = np.random.rand(2, 1) @@ -1112,7 +1115,7 @@ def test_lscm(self): self.assertTrue(uv.flags.c_contiguous) def test_is_irregular_vertex(self): - is_i = igl.is_irregular_vertex(self.v1, self.f1) + is_i = igl.is_irregular_vertex(self.f1) self.assertEqual(type(is_i[0]), bool) def test_harmonic(self): @@ -2356,9 +2359,8 @@ def sphere1(point): def test_topological_hole_fill(self): f = self.f1 - b = np.array(range(10)) h = [range(10, 20)] - ff = igl.topological_hole_fill(f, b, h) + ff = igl.topological_hole_fill(f, h) self.assertTrue(ff.flags.c_contiguous) self.assertTrue(ff.shape[1] == 3) self.assertTrue(ff.dtype == f.dtype)