Skip to content

Commit

Permalink
touch up changed prototypes; bump libigl
Browse files Browse the repository at this point in the history
  • Loading branch information
alecjacobson committed Aug 27, 2023
1 parent e030039 commit 0a6d82d
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 25 deletions.
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()

0 comments on commit 0a6d82d

Please sign in to comment.