Skip to content

Commit 20e9671

Browse files
committed
small changes for v2.5.0
1 parent 64b61ff commit 20e9671

7 files changed

Lines changed: 76 additions & 56 deletions

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 7e5512ce71d7394ba965964f66e9a9d91597e767
22+
GIT_TAG d7954041d1f21501e3d4776464a59d0251dde184
2323
)
2424
FetchContent_GetProperties(libigl)
2525
FetchContent_MakeAvailable(libigl)

src/boundary_conditions.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ C #C by dim list of handle positions
2323
P #P by 1 list of point handle indices into C
2424
BE #BE by 2 list of bone edge indices into C
2525
CE #CE by 2 list of cage edge indices into *P*
26+
CF #CF by 3 list of cage edge indices into *P*
2627
2728
Returns
2829
-------
@@ -59,6 +60,7 @@ npe_arg(c, npe_matches(v))
5960
npe_arg(p, npe_matches(ele))
6061
npe_arg(be, npe_matches(ele))
6162
npe_arg(ce, npe_matches(ele))
63+
npe_arg(cf, npe_matches(ele))
6264

6365
npe_begin_code()
6466
assert_valid_tet_or_tri_mesh(v, ele);
@@ -74,6 +76,10 @@ npe_begin_code()
7476
{
7577
assert_cols_equals(ce, 2, "ce");
7678
}
79+
if(cf.size() > 0)
80+
{
81+
assert_cols_equals(cf, 3, "cf");
82+
}
7783

7884
//TODO: remove __copy
7985
Eigen::MatrixXd v_copy = v.template cast<double>();
@@ -86,9 +92,12 @@ npe_begin_code()
8692
Eigen::MatrixXi ce_copy;
8793
if (ce.size() > 0)
8894
ce_copy = ce.template cast<int>();
95+
Eigen::MatrixXi cf_copy;
96+
if (cf.size() > 0)
97+
cf_copy = cf.template cast<int>();
8998
Eigen::VectorXi b_copy;
9099
Eigen::MatrixXd bc_copy;
91-
bool success = igl::boundary_conditions(v_copy, ele_copy, c_copy, p_copy, be_copy, ce_copy, b_copy, bc_copy);
100+
bool success = igl::boundary_conditions(v_copy, ele_copy, c_copy, p_copy, be_copy, ce_copy, cf_copy, b_copy, bc_copy);
92101
EigenDenseLike<npe_Matrix_ele> b = b_copy.template cast<npe_Scalar_ele>();
93102
EigenDenseLike<npe_Matrix_v> bc = bc_copy.template cast<npe_Scalar_v>();
94103
return std::make_tuple(success, npe::move(b), npe::move(bc));

src/euler_characteristic.cpp

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -45,41 +45,3 @@ npe_end_code()
4545

4646

4747

48-
const char* ds_euler_characteristic_complete = R"igl_Qu8mg5v7(
49-
50-
Parameters
51-
----------
52-
V #V by dim list of mesh vertex positions
53-
54-
Returns
55-
-------
56-
57-
58-
See also
59-
--------
60-
61-
62-
Notes
63-
-----
64-
None
65-
66-
Examples
67-
--------
68-
69-
)igl_Qu8mg5v7";
70-
71-
npe_function(euler_characteristic_complete)
72-
npe_doc(ds_euler_characteristic_complete)
73-
74-
npe_arg(v, dense_float, dense_double)
75-
npe_arg(f, dense_int, dense_long, dense_longlong)
76-
77-
78-
npe_begin_code()
79-
80-
assert_valid_3d_tri_mesh(v, f);
81-
return igl::euler_characteristic(v, f);
82-
83-
npe_end_code()
84-
85-

src/massmatrix.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ npe_default_arg(type, int, 3)
3939
npe_begin_code()
4040

4141
assert_valid_tet_or_tri_mesh_23d(v, f);
42-
static_assert(int(igl::MASSMATRIX_TYPE_BARYCENTRIC) == 0, "ARAPEnergyType enum changed!");
43-
static_assert(int(igl::MASSMATRIX_TYPE_VORONOI) == 1, "ARAPEnergyType enum changed!");
44-
static_assert(int(igl::MASSMATRIX_TYPE_FULL) == 2, "ARAPEnergyType enum changed!");
45-
static_assert(int(igl::MASSMATRIX_TYPE_DEFAULT) == 3, "ARAPEnergyType enum changed!");
46-
static_assert(int(igl::NUM_MASSMATRIX_TYPE) == 4, "ARAPEnergyType enum changed!");
42+
static_assert(int(igl::MASSMATRIX_TYPE_BARYCENTRIC) == 0, "MASSMATRIX enum changed!");
43+
static_assert(int(igl::MASSMATRIX_TYPE_VORONOI) == 1, "MASSMATRIX enum changed!");
44+
static_assert(int(igl::MASSMATRIX_TYPE_FULL) == 2, "MASSMATRIX enum changed!");
45+
static_assert(int(igl::MASSMATRIX_TYPE_DEFAULT) == 3, "MASSMATRIX enum changed!");
46+
static_assert(int(igl::NUM_MASSMATRIX_TYPES) == 4, "MASSMATRIX enum changed!");
4747

48-
if (type >= igl::NUM_MASSMATRIX_TYPE) {
48+
if (type >= igl::NUM_MASSMATRIX_TYPES ) {
4949
std::string errmsg =
5050
std::string("Invalid enum for type should be in the range 0 to ") +
51-
std::to_string(igl::NUM_MASSMATRIX_TYPE-1);
51+
std::to_string(igl::NUM_MASSMATRIX_TYPES-1);
5252
throw pybind11::value_error(errmsg);
5353
}
5454

src/massmatrix_intrinsic.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,17 @@ npe_begin_code()
5353
assert_cols_equals(l, 3, "l");
5454
assert_valid_tri_mesh_faces(f);
5555

56-
static_assert(int(igl::MASSMATRIX_TYPE_BARYCENTRIC) == 0, "ARAPEnergyType enum changed!");
57-
static_assert(int(igl::MASSMATRIX_TYPE_VORONOI) == 1, "ARAPEnergyType enum changed!");
58-
static_assert(int(igl::MASSMATRIX_TYPE_FULL) == 2, "ARAPEnergyType enum changed!");
59-
static_assert(int(igl::MASSMATRIX_TYPE_DEFAULT) == 3, "ARAPEnergyType enum changed!");
60-
static_assert(int(igl::NUM_MASSMATRIX_TYPE) == 4, "ARAPEnergyType enum changed!");
56+
static_assert(int(igl::MASSMATRIX_TYPE_BARYCENTRIC) == 0, "MASSMATRIX enum changed!");
57+
static_assert(int(igl::MASSMATRIX_TYPE_VORONOI) == 1, "MASSMATRIX enum changed!");
58+
static_assert(int(igl::MASSMATRIX_TYPE_FULL) == 2, "MASSMATRIX enum changed!");
59+
static_assert(int(igl::MASSMATRIX_TYPE_DEFAULT) == 3, "MASSMATRIX enum changed!");
60+
static_assert(int(igl::NUM_MASSMATRIX_TYPES) == 4, "MASSMATRIX enum changed!");
6161

62-
if (type >= igl::NUM_MASSMATRIX_TYPE)
62+
if (type >= igl::NUM_MASSMATRIX_TYPES )
6363
{
6464
std::string errmsg =
6565
std::string("Invalid enum for type should be in the range 0 to ") +
66-
std::to_string(igl::NUM_MASSMATRIX_TYPE - 1);
66+
std::to_string(igl::NUM_MASSMATRIX_TYPES - 1);
6767
throw pybind11::value_error(errmsg);
6868
}
6969

src/random_points_on_mesh.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Returns
1717
B n by 3 list of barycentric coordinates, ith row are coordinates of
1818
ith sampled point in face FI(i)
1919
FI n list of indices into F
20+
X n by dim list of sampled points
2021
2122
See also
2223
--------
@@ -44,7 +45,8 @@ npe_begin_code()
4445
assert_valid_23d_tri_mesh(v, f);
4546
EigenDenseLike<npe_Matrix_v> b;
4647
EigenDenseLike<npe_Matrix_f> fi;
47-
igl::random_points_on_mesh(n, v, f, b, fi);
48-
return std::make_tuple(npe::move(b), npe::move(fi));
48+
EigenDenseLike<npe_Matrix_v> x;
49+
igl::random_points_on_mesh(n, v, f, b, fi, x);
50+
return std::make_tuple(npe::move(b), npe::move(fi), npe::move(x));
4951

5052
npe_end_code()
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#include <common.h>
2+
#include <npe.h>
3+
#include <typedefs.h>
4+
#include <igl/random_points_on_mesh_intrinsic.h>
5+
6+
const char* ds_random_points_on_mesh_intrinsic = R"igl_Qu8mg5v7(
7+
RANDOM_POINTS_ON_MESH Randomly sample a mesh (V,F) n times.
8+
Parameters
9+
----------
10+
n number of samples
11+
dblA #F list of double areas of triangles
12+
13+
Returns
14+
-------
15+
B n by 3 list of barycentric coordinates, ith row are coordinates of
16+
ith sampled point in face FI(i)
17+
FI n list of indices into F
18+
19+
See also
20+
--------
21+
22+
23+
Notes
24+
-----
25+
None
26+
27+
Examples
28+
--------
29+
30+
)igl_Qu8mg5v7";
31+
32+
npe_function(random_points_on_mesh_intrinsic)
33+
npe_doc(ds_random_points_on_mesh_intrinsic)
34+
35+
npe_arg(n, int)
36+
npe_arg(dblA, dense_float, dense_double)
37+
38+
39+
npe_begin_code()
40+
41+
EigenDenseLike<npe_Matrix_dblA> b;
42+
EigenDenseInt fi;
43+
igl::random_points_on_mesh_intrinsic(n, dblA, b, fi);
44+
return std::make_tuple(npe::move(b), npe::move(fi));
45+
46+
npe_end_code()
47+

0 commit comments

Comments
 (0)