Skip to content

Commit 1e160ab

Browse files
authored
Merge pull request #206 from libigl/alecjacobson/warnings [ci skip]
touch up changed prototypes; bump libigl
2 parents ce1fc67 + d0965e4 commit 1e160ab

6 files changed

Lines changed: 39 additions & 29 deletions

File tree

cmake/PyiglDependencies.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ include(FetchContent)
1919
FetchContent_Declare(
2020
libigl
2121
GIT_REPOSITORY https://github.com/libigl/libigl.git
22-
GIT_TAG d7954041d1f21501e3d4776464a59d0251dde184
22+
GIT_TAG 5779714a5bdd62e105a96edfa73d0d3755e33bc8
2323
)
2424
FetchContent_GetProperties(libigl)
2525
FetchContent_MakeAvailable(libigl)

setup.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,16 @@ def build_extension(self, ext):
111111
os.makedirs(self.build_temp)
112112
subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
113113

114+
# print build_args
115+
print("********************************************************************")
116+
print("********************************************************************")
117+
print("********************************************************************")
118+
print("********************************************************************")
119+
print("build_args:", build_args)
120+
print("********************************************************************")
121+
print("********************************************************************")
122+
print("********************************************************************")
123+
print("********************************************************************")
114124
subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
115125

116126
print() # Add an empty line for cleaner output

src/is_irregular_vertex.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Determine if a vertex is irregular, i.e. it has more than 6 (triangles) or 4 (qu
1616
1717
Parameters
1818
----------
19-
v : #v by dim array of vertex positions
2019
f : #f by 3[4] array of triangle[quads] indices
2120
2221
Returns
@@ -39,12 +38,10 @@ Examples
3938
npe_function(is_irregular_vertex)
4039
npe_doc(ds_is_irregular_vertex)
4140

42-
npe_arg(v, dense_float, dense_double)
4341
npe_arg(f, dense_int, dense_long, dense_longlong)
4442

4543
npe_begin_code()
46-
assert_valid_tet_or_tri_mesh_23d(v, f);
47-
const std::vector<bool> res = igl::is_irregular_vertex(v, f);
44+
const std::vector<bool> res = igl::is_irregular_vertex(f);
4845
return res;
4946

5047
npe_end_code()

src/isolines.cpp

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ const char *ds_isolines = R"igl_Qu8mg5v7(
1717
1818
Parameters
1919
----------
20-
V #V by dim list of mesh vertex positions
21-
F #F by 3 list of mesh faces (must be triangles)
22-
z #V by 1 list of function values evaluated at vertices
23-
n the number of desired isolines
20+
V #V by dim list of mesh vertex positions
21+
F #F by 3 list of mesh triangle indices into V
22+
S #S by 1 list of per-vertex scalar values
23+
vals #vals by 1 list of values to compute isolines for
2424
2525
Returns
2626
-------
27-
isoV #isoV by dim list of isoline vertex positions
28-
isoE #isoE by 2 list of isoline edge positions
27+
iV #iV by dim list of isoline vertex positions
28+
iE #iE by 2 list of edge indices into iV
29+
I #iE by 1 list of indices into vals indicating which value
2930
3031
See also
3132
--------
@@ -44,21 +45,23 @@ Examples
4445
npe_function(isolines)
4546
npe_doc(ds_isolines)
4647

47-
npe_arg(v, dense_float, dense_double)
48-
npe_arg(f, dense_int, dense_long, dense_longlong)
49-
npe_arg(z, dense_float, dense_double)
50-
npe_arg(n, int)
48+
npe_arg(V, dense_float, dense_double)
49+
npe_arg(F, dense_int, dense_long, dense_longlong)
50+
npe_arg(S, npe_matches(V))
51+
npe_arg(vals, npe_matches(S))
5152

5253

5354
npe_begin_code()
5455

55-
assert_valid_23d_tri_mesh(v, f);
56-
assert_rows_match(v, z, "v", "z");
57-
assert_cols_equals(z, 1, "z");
58-
EigenDenseLike<npe_Matrix_v> iso_v;
59-
EigenDenseLike<npe_Matrix_f> iso_e;
60-
igl::isolines(v, f, z, n, iso_v, iso_e);
61-
return std::make_tuple(npe::move(iso_v), npe::move(iso_e));
56+
assert_valid_23d_tri_mesh(V, F);
57+
assert_rows_match(V, S, "V", "S");
58+
assert_cols_equals(S, 1, "S");
59+
EigenDenseLike<npe_Matrix_V> iV;
60+
EigenDenseLike<npe_Matrix_F> iE;
61+
Eigen::Matrix<typename npe_Matrix_F::Scalar, Eigen::Dynamic, 1> I;
62+
Eigen::Matrix<typename npe_Matrix_vals::Scalar, Eigen::Dynamic, 1> vals_copy = vals;
63+
igl::isolines(V, F, S.col(0), vals_copy, iV, iE, I);
64+
return std::make_tuple(npe::move(iV), npe::move(iE), npe::move(I));
6265

6366
npe_end_code()
6467

src/topological_hole_fill.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ Parameters
2222
----------
2323
2424
F #F by simplex-size list of element indices
25-
b #b boundary indices to preserve
2625
holes vector of hole loops to fill
2726
2827
Returns
@@ -47,14 +46,13 @@ npe_function(topological_hole_fill)
4746
npe_doc(ds_topological_hole_fill)
4847

4948
npe_arg(f, dense_int, dense_long, dense_longlong)
50-
npe_arg(b, dense_int, dense_long, dense_longlong)
5149
npe_arg(holes, std::vector<std::vector<int>>)
5250

5351

5452
npe_begin_code()
5553

5654
EigenDense<npe_Scalar_f> f_filled;
57-
igl::topological_hole_fill(f, b, holes, f_filled);
55+
igl::topological_hole_fill(f, holes, f_filled);
5856
return npe::move(f_filled);
5957

6058
npe_end_code()

tests/test_basic.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -522,13 +522,16 @@ def test_hausdorff(self):
522522

523523
def test_isolines(self):
524524
func = np.random.rand(self.v1.shape[0], 1)
525-
iso_v, iso_e = igl.isolines(self.v1, self.f1, func, 10)
525+
vals = np.linspace(0,1, 10)
526+
iso_v, iso_e, I = igl.isolines(self.v1, self.f1, func, vals)
526527

527528
self.assertEqual(iso_v.dtype, func.dtype)
528529
self.assertEqual(iso_e.dtype, self.f1.dtype)
529530
self.assertEqual(iso_e.shape[1], 2)
531+
self.assertEqual(iso_e.shape[0], I.shape[0])
530532
self.assertTrue(iso_v.flags.c_contiguous)
531533
self.assertTrue(iso_e.flags.c_contiguous)
534+
self.assertTrue(I.flags.c_contiguous)
532535

533536
def test_unproject_ray(self):
534537
pos = np.random.rand(2, 1)
@@ -1112,7 +1115,7 @@ def test_lscm(self):
11121115
self.assertTrue(uv.flags.c_contiguous)
11131116

11141117
def test_is_irregular_vertex(self):
1115-
is_i = igl.is_irregular_vertex(self.v1, self.f1)
1118+
is_i = igl.is_irregular_vertex(self.f1)
11161119
self.assertEqual(type(is_i[0]), bool)
11171120

11181121
def test_harmonic(self):
@@ -2356,9 +2359,8 @@ def sphere1(point):
23562359

23572360
def test_topological_hole_fill(self):
23582361
f = self.f1
2359-
b = np.array(range(10))
23602362
h = [range(10, 20)]
2361-
ff = igl.topological_hole_fill(f, b, h)
2363+
ff = igl.topological_hole_fill(f, h)
23622364
self.assertTrue(ff.flags.c_contiguous)
23632365
self.assertTrue(ff.shape[1] == 3)
23642366
self.assertTrue(ff.dtype == f.dtype)

0 commit comments

Comments
 (0)