Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/PyiglDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions src/is_irregular_vertex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<bool> res = igl::is_irregular_vertex(v, f);
const std::vector<bool> res = igl::is_irregular_vertex(f);
return res;

npe_end_code()
Expand Down
37 changes: 20 additions & 17 deletions src/isolines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------
Expand All @@ -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<npe_Matrix_v> iso_v;
EigenDenseLike<npe_Matrix_f> 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<npe_Matrix_V> iV;
EigenDenseLike<npe_Matrix_F> iE;
Eigen::Matrix<typename npe_Matrix_F::Scalar, Eigen::Dynamic, 1> I;
Eigen::Matrix<typename npe_Matrix_vals::Scalar, Eigen::Dynamic, 1> 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()

Expand Down
4 changes: 1 addition & 3 deletions src/topological_hole_fill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<std::vector<int>>)


npe_begin_code()

EigenDense<npe_Scalar_f> 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()
10 changes: 6 additions & 4 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down