Skip to content
2 changes: 1 addition & 1 deletion src/adjacency_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Examples

npe_function(adjacency_list)
npe_doc(ds_adjacency_list)
npe_arg(f, dense_int, dense_long)
npe_arg(f, dense_int, dense_long, dense_longlong)
npe_begin_code()
assert_valid_tet_or_tri_mesh_faces(f, "f");
std::vector<std::vector<npe_Scalar_f>> a;
Expand Down
2 changes: 1 addition & 1 deletion src/adjacency_matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Examples

npe_function(adjacency_matrix)
npe_doc(ds_adjacency_matrix)
npe_arg(f, dense_int, dense_long)
npe_arg(f, dense_int, dense_long, dense_longlong)
npe_begin_code()

assert_valid_tet_or_tri_mesh_faces(f, "f");
Expand Down
7 changes: 6 additions & 1 deletion src/ambient_occlusion.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// TODO: __missing miss the rest two functions with AABB and shoot_ray. __example

#include <common.h>
#include <npe.h>
#include <typedefs.h>
Expand Down Expand Up @@ -34,15 +35,19 @@ npe_function(ambient_occlusion)
npe_doc(ds_ambient_occlusion)

npe_arg(v, dense_float, dense_double)
npe_arg(f, dense_int, dense_long)
npe_arg(f, dense_int, dense_long, dense_longlong)
npe_arg(p, dense_float, dense_double)
npe_arg(n, npe_matches(p))
npe_arg(num_samples, int)
npe_begin_code()

assert_valid_3d_tri_mesh(v, f);
assert_cols_equals(p, 3, "p");
assert_cols_equals(n, 3, "n");
assert_nonzero_rows(p, "p");
assert_nonzero_rows(n, "n");
assert_shapes_match(p, n, "p", "n");

npe_Matrix_p s;
igl::ambient_occlusion(v, f, p, n, num_samples, s);
return npe::move(s);
Expand Down
9 changes: 5 additions & 4 deletions src/arap_linear_block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ Examples
npe_function(arap_linear_block)
npe_doc(ds_arap_linear_block)
npe_arg(v, dense_float, dense_double)
npe_arg(f, dense_int, dense_long)
npe_arg(f, dense_int, dense_long, dense_longlong)
npe_arg(d, int)
npe_arg(energy, int)
npe_begin_code()

assert_valid_tet_or_tri_mesh(v, f);
static_assert(int(igl::ARAPEnergyType::ARAP_ENERGY_TYPE_SPOKES) == 0, "ARAPEnergyType enum changed!");
static_assert(int(igl::ARAPEnergyType::ARAP_ENERGY_TYPE_SPOKES_AND_RIMS) == 1, "ARAPEnergyType enum changed!");
static_assert(int(igl::ARAPEnergyType::ARAP_ENERGY_TYPE_ELEMENTS) == 2, "ARAPEnergyType enum changed!");
Expand Down Expand Up @@ -82,7 +83,7 @@ npe_end_code()
npe_function(arap_linear_block_spokes)
npe_doc(ds_arap_linear_block)
npe_arg(v, dense_float, dense_double)
npe_arg(f, dense_int, dense_long)
npe_arg(f, dense_int, dense_long, dense_longlong)
npe_arg(d, int)
npe_begin_code()

Expand All @@ -100,7 +101,7 @@ npe_end_code()
npe_function(arap_linear_block_spokes_and_rims)
npe_doc(ds_arap_linear_block)
npe_arg(v, dense_float, dense_double)
npe_arg(f, dense_int, dense_long)
npe_arg(f, dense_int, dense_long, dense_longlong)
npe_arg(d, int)
npe_begin_code()

Expand All @@ -119,7 +120,7 @@ npe_end_code()
npe_function(arap_linear_block_elements)
npe_doc(ds_arap_linear_block)
npe_arg(v, dense_float, dense_double)
npe_arg(f, dense_int, dense_long)
npe_arg(f, dense_int, dense_long, dense_longlong)
npe_arg(d, int)
npe_begin_code()

Expand Down
2 changes: 2 additions & 0 deletions src/arap_rhs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ npe_arg(f, dense_int)
npe_arg(d, int)
npe_arg(energy, int)
npe_begin_code()

assert_valid_3d_tri_mesh(v, f);

static_assert(int(igl::ARAPEnergyType::ARAP_ENERGY_TYPE_SPOKES) == 0, "ARAPEnergyType enum changed!");
static_assert(int(igl::ARAPEnergyType::ARAP_ENERGY_TYPE_SPOKES_AND_RIMS) == 1, "ARAPEnergyType enum changed!");
Expand Down
5 changes: 2 additions & 3 deletions src/average_onto_vertices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ s : #f by dim scalar field defined on simplices

Returns
-------
#v by dim scalar field defined on vertices
sv: #v by dim scalar field defined on vertices

See also
--------
Expand All @@ -31,13 +31,12 @@ Examples
npe_function(average_onto_vertices)
npe_doc(ds_average_onto_vertices)
npe_arg(v, dense_float, dense_double)
npe_arg(f, dense_int, dense_long)
npe_arg(f, dense_int, dense_long, dense_longlong)
npe_arg(s, dense_float, dense_double) // TODO: Maybe do a matches here
npe_begin_code()

assert_valid_tet_or_tri_mesh(v, f);
assert_shape_equals(s, f.rows(), v.cols(), "s");

npe_Matrix_s sv;
igl::average_onto_vertices(v, f, s, sv);
return npe::move(sv);
Expand Down
3 changes: 2 additions & 1 deletion src/avg_edge_length.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ Examples
npe_function(avg_edge_length)
npe_doc(ds_avg_edge_length)
npe_arg(v, dense_double, dense_float)
npe_arg(f, dense_int, dense_long)
npe_arg(f, dense_int, dense_long, dense_longlong)
npe_begin_code()

assert_valid_3d_tri_mesh(v, f);
return igl::avg_edge_length(v, f);

Expand Down
5 changes: 3 additions & 2 deletions src/barycenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ npe_function(barycenter)
npe_doc(ds_barycenter)

npe_arg(v, dense_float, dense_double)
npe_arg(f, dense_int, dense_long)
npe_arg(f, dense_int, dense_long, dense_longlong)
npe_begin_code()
assert_valid_3d_tri_mesh(v, f);

assert_valid_tet_or_tri_mesh(v, f);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also tet?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is by simplex

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are indeed correct

npe_Matrix_v bc;
igl::barycenter(v, f, bc);
return npe::move(bc);
Expand Down
9 changes: 9 additions & 0 deletions src/barycentric_coordinates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ npe_arg(c, npe_matches(p))
npe_arg(d, npe_matches(p))
npe_begin_code()

assert_rows_match(p, a, "p", "a");
assert_rows_match(p, b, "p", "b");
assert_rows_match(p, c, "p", "c");
assert_rows_match(p, d, "p", "d");
assert_cols_equals(p, 3, "p");
assert_cols_equals(a, 3, "a");
assert_cols_equals(b, 3, "b");
assert_cols_equals(c, 3, "c");
assert_cols_equals(d, 3, "d");
npe_Matrix_p l;
igl::barycentric_coordinates(p, a, b, c, d, l);
return npe::move(l);
Expand Down
3 changes: 2 additions & 1 deletion src/bfs_orient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ Examples

npe_function(bfs_orient)
npe_doc(ds_bfs_orient)
npe_arg(f, dense_int, dense_long)
npe_arg(f, dense_int, dense_long, dense_longlong)
npe_begin_code()

//assert_valid_tet_or_tri_mesh_faces(f, "f");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why commented?

npe_Matrix_f ff, c;
igl::bfs_orient(f, ff, c);
return std::make_tuple(npe::move(ff), npe::move(c));
Expand Down
4 changes: 3 additions & 1 deletion src/bone_parents.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <common.h>
#include <npe.h>
#include <typedefs.h>
#include <igl/bone_parents.h>
Expand Down Expand Up @@ -28,10 +29,11 @@ Examples
npe_function(bone_parents)
npe_doc(ds_bone_parents)

npe_arg(be, dense_int, dense_long)
npe_arg(be, dense_int, dense_long, dense_longlong)


npe_begin_code()
assert_cols_equals(be, 2, "be");
npe_Matrix_be p;
igl::bone_parents(be, p);
return npe::move(p);
Expand Down
4 changes: 3 additions & 1 deletion src/boundary_facets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ Examples

npe_function(boundary_facets)
npe_doc(ds_boundary_facets)
npe_arg(t, dense_int, dense_long)
npe_arg(t, dense_int, dense_long, dense_longlong)
npe_begin_code()

// TODO: need an option for multiple shapes
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you elaborate?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here t can be either #t by 3 or #t by 4, and currently I think we cannot check this

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert_valid_tet_or_tri_mesh_faces

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh right

assert_cols_equals(t, 3, "t");
EigenDense<npe_Scalar_t> f;
igl::boundary_facets(t, f);
return npe::move(f);
Expand Down
3 changes: 2 additions & 1 deletion src/boundary_loop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ Examples

npe_function(boundary_loop)
npe_doc(ds_boundary_loop)
npe_arg(f, dense_int, dense_long)
npe_arg(f, dense_int, dense_long, dense_longlong)
npe_begin_code()

//assert_valid_tet_or_tri_mesh_faces(f, "f");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

EigenDenseLike<npe_Matrix_f> l;
igl::boundary_loop(f, l);
return npe::move(l);
Expand Down
4 changes: 3 additions & 1 deletion src/bounding_box.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <common.h>
#include <npe.h>
#include <typedefs.h>
#include <igl/bounding_box.h>
Expand Down Expand Up @@ -35,6 +36,7 @@ npe_arg(v, dense_float, dense_double)

npe_begin_code()

assert_nonzero_rows(v, "v");
npe_Matrix_v bv;
Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor, Eigen::Dynamic, Eigen::Dynamic> bf;
igl::bounding_box(v, bv, bf);
Expand All @@ -47,7 +49,6 @@ npe_end_code()



#include <igl/bounding_box.h>

const char* ds_bounding_box_pad = R"igl_Qu8mg5v7(
See bounding_box for the documentation.
Expand All @@ -62,6 +63,7 @@ npe_arg(pad, double)

npe_begin_code()

assert_nonzero_rows(v, "v");
npe_Matrix_v bv;
Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor, Eigen::Dynamic, Eigen::Dynamic> bf;
igl::bounding_box(v, pad, bv, bf);
Expand Down
3 changes: 3 additions & 0 deletions src/bounding_box_diagonal.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// TODO: __example

#include <common.h>
#include <npe.h>
#include <typedefs.h>

Expand Down Expand Up @@ -41,6 +42,8 @@ npe_arg(v, dense_float, dense_double)


npe_begin_code()
assert_nonzero_rows(v, "v");
assert_cols_equals(v, 3, "v");
// TODO: remove __copy
Eigen::MatrixXd v_copy = v.template cast<double>();
return igl::bounding_box_diagonal(v_copy);
Expand Down
4 changes: 3 additions & 1 deletion src/circumradius.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <common.h>
#include <npe.h>
#include <typedefs.h>
#include <igl/circumradius.h>
Expand Down Expand Up @@ -34,11 +35,12 @@ npe_function(circumradius)
npe_doc(ds_circumradius)

npe_arg(v, dense_float, dense_double)
npe_arg(f, dense_int, dense_long)
npe_arg(f, dense_int, dense_long, dense_longlong)


npe_begin_code()

assert_valid_tet_or_tri_mesh(v, f);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it is by 3 it is tri_mesh3d not tets

EigenDense<npe_Scalar_v> r;
igl::circumradius(v, f, r);
return npe::move(r);
Expand Down
5 changes: 3 additions & 2 deletions src/collapse_small_triangles.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// TODO: __example

#include <common.h>
#include <npe.h>
#include <typedefs.h>






#include <igl/collapse_small_triangles.h>

const char* ds_collapse_small_triangles = R"igl_Qu8mg5v7(
Expand Down Expand Up @@ -48,12 +48,13 @@ npe_function(collapse_small_triangles)
npe_doc(ds_collapse_small_triangles)

npe_arg(v, dense_float, dense_double)
npe_arg(f, dense_int, dense_long)
npe_arg(f, dense_int, dense_long, dense_longlong)
npe_arg(eps, double)


npe_begin_code()

assert_valid_3d_tri_mesh(v, f);
// TODO: remove __copy
Eigen::MatrixXd v_copy = v.template cast<double>();
Eigen::MatrixXi f_copy = f.template cast<int>();
Expand Down
10 changes: 7 additions & 3 deletions src/connect_boundary_to_infinity.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// TODO: __example

#include <common.h>
#include <npe.h>
#include <typedefs.h>
#include <igl/connect_boundary_to_infinity.h>
Expand Down Expand Up @@ -34,11 +35,12 @@ Examples
npe_function(connect_boundary_to_infinity)
npe_doc(ds_connect_boundary_to_infinity)

npe_arg(f, dense_int, dense_long)
npe_arg(f, dense_int, dense_long, dense_longlong)


npe_begin_code()

//assert_valid_3d_tri_mesh_faces(f, "f");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

npe_Matrix_f fo;
igl::connect_boundary_to_infinity(f, fo);
return npe::move(fo);
Expand Down Expand Up @@ -74,11 +76,12 @@ npe_function(connect_boundary_to_infinity_face)
npe_doc(ds_connect_boundary_to_infinity_face)

npe_arg(v, dense_float, dense_double)
npe_arg(f, dense_int, dense_long)
npe_arg(f, dense_int, dense_long, dense_longlong)


npe_begin_code()

//assert_valid_3d_tri_mesh_faces(f, "f");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

npe_Matrix_v vo;
npe_Matrix_f fo;
igl::connect_boundary_to_infinity(v, f, vo, fo);
Expand Down Expand Up @@ -118,12 +121,13 @@ Examples
npe_function(connect_boundary_to_infinity_index)
npe_doc(ds_connect_boundary_to_infinity_index)

npe_arg(f, dense_int, dense_long)
npe_arg(f, dense_int, dense_long, dense_longlong)
npe_arg(inf_index, int)


npe_begin_code()

//assert_valid_3d_tri_mesh_faces(f, "f");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

npe_Matrix_f fo;
igl::connect_boundary_to_infinity(f, inf_index, fo);
return npe::move(fo);
Expand Down
3 changes: 2 additions & 1 deletion src/cotmatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ Examples
npe_function(cotmatrix)
npe_doc(ds_cotmatrix)
npe_arg(v, dense_double, dense_float)
npe_arg(f, dense_int, dense_long)
npe_arg(f, dense_int, dense_long, dense_longlong)
npe_begin_code()

assert_valid_tet_or_tri_mesh(v, f);
EigenSparseLike<npe_Matrix_v> l;
igl::cotmatrix(v, f, l);
return npe::move(l);
Expand Down
4 changes: 3 additions & 1 deletion src/cotmatrix_entries.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <common.h>
#include <npe.h>
#include <typedefs.h>
#include <igl/cotmatrix_entries.h>
Expand Down Expand Up @@ -39,11 +40,12 @@ npe_function(cotmatrix_entries)
npe_doc(ds_cotmatrix_entries)

npe_arg(v, dense_float, dense_double)
npe_arg(f, dense_int, dense_long)
npe_arg(f, dense_int, dense_long, dense_longlong)


npe_begin_code()

assert_valid_tet_or_tri_mesh(v, f);
npe_Matrix_v c;
igl::cotmatrix_entries(v, f, c);
return npe::move(c);
Expand Down
Loading