Skip to content

Commit 808b032

Browse files
committed
2 parents 64a17fe + 5ba1b5d commit 808b032

37 files changed

+1287
-1463
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def build_extension(self, ext):
7070

7171
setup(
7272
name="igl",
73-
version="0.5",
73+
version="2.2.0",
7474
author="libigl",
7575
author_email="",
7676
description="libigl Python Bindings",

src/cotmatrix_intrinsic.cpp

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#include <npe.h>
2+
#include <common.h>
3+
#include <typedefs.h>
4+
#include <igl/cotmatrix_intrinsic.h>
5+
6+
const char *ds_cotmatrix_intrinsic = R"igl_Qu8mg5v7(
7+
8+
Constructs the cotangent stiffness matrix (discrete laplacian) for a given
9+
mesh with faces F and edge lengths l.
10+
11+
Parameters
12+
----------
13+
14+
l #F by 3 list of (half-)edge lengths
15+
F #F by 3 list of face indices into some (not necessarily
16+
determined/embedable) list of vertex positions V. It is assumed #V ==
17+
F.maxCoeff()+1
18+
19+
Returns
20+
-------
21+
22+
L #V by #V sparse Laplacian matrix
23+
24+
See also
25+
--------
26+
27+
cotmatrix, intrinsic_delaunay_cotmatrix
28+
29+
Notes
30+
-----
31+
32+
Examples
33+
--------
34+
35+
)igl_Qu8mg5v7";
36+
37+
npe_function(cotmatrix_intrinsic)
38+
npe_doc(ds_cotmatrix_intrinsic)
39+
40+
npe_arg(l, dense_float, dense_double)
41+
npe_arg(f, dense_int, dense_long, dense_longlong)
42+
43+
44+
npe_begin_code()
45+
assert_rows_match(l, f, "l", "f");
46+
assert_cols_equals(l, 3, "l");
47+
assert_valid_tri_mesh_faces(f);
48+
49+
Eigen::SparseMatrix<npe_Scalar_l> mat;
50+
igl::cotmatrix_intrinsic(l, f, mat);
51+
return npe::move(mat);
52+
53+
npe_end_code()
54+
55+

src/cut_to_disk.cpp

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#include <npe.h>
2+
#include <common.h>
3+
#include <typedefs.h>
4+
#include <igl/cut_to_disk.h>
5+
6+
const char *ds_cut_to_disk = R"igl_Qu8mg5v7(
7+
8+
Given a triangle mesh, computes a set of edge cuts sufficient to carve the
9+
mesh into a topological disk, without disconnecting any connected components.
10+
Nothing else about the cuts (including number, total length, or smoothness)
11+
is guaranteed to be optimal.
12+
13+
Simply-connected components without boundary (topological spheres) are left
14+
untouched (delete any edge if you really want a disk).
15+
All other connected components are cut into disks. Meshes with boundary are
16+
supported; boundary edges will be included as cuts.
17+
18+
The cut mesh itself can be materialized using cut_mesh().
19+
20+
Implements the triangle-deletion approach described by Gu et al's
21+
"Geometry Images."
22+
23+
Parameters
24+
----------
25+
26+
F #F by 3 list of the faces (must be triangles)
27+
28+
Returns
29+
-------
30+
31+
cuts List of cuts. Each cut is a sequence of vertex indices (where
32+
pairs of consecutive vertices share a face), is simple, and is either
33+
a closed loop (in which the first and last indices are identical) or
34+
an open curve. Cuts are edge-disjoint.
35+
36+
See also
37+
--------
38+
39+
40+
Notes
41+
-----
42+
None
43+
44+
Examples
45+
--------
46+
47+
48+
)igl_Qu8mg5v7";
49+
50+
npe_function(cut_to_disk)
51+
npe_doc(ds_cut_to_disk)
52+
53+
npe_arg(f, dense_int, dense_long, dense_longlong)
54+
55+
56+
npe_begin_code()
57+
assert_valid_tri_mesh_faces(f);
58+
59+
std::vector<std::vector<int> > cuts;
60+
igl::cut_to_disk(f, cuts);
61+
return cuts;
62+
63+
npe_end_code()

src/grad_intrinsic.cpp

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#include <common.h>
2+
#include <npe.h>
3+
#include <typedefs.h>
4+
5+
6+
7+
8+
9+
10+
#include <igl/grad_intrinsic.h>
11+
12+
const char *ds_grad_intrinsic = R"igl_Qu8mg5v7(
13+
14+
GRAD_INTRINSIC Construct an intrinsic gradient operator.
15+
16+
17+
Parameters
18+
----------
19+
20+
l #F by 3 list of edge lengths
21+
F #F by 3 list of triangle indices into some vertex list V
22+
23+
Returns
24+
-------
25+
G #F*2 by #V gradient matrix: G=[Gx;Gy] where x runs along the 23 edge and
26+
y runs in the counter-clockwise 90° rotation.
27+
28+
See also
29+
--------
30+
31+
32+
Notes
33+
-----
34+
None
35+
36+
Examples
37+
--------
38+
39+
)igl_Qu8mg5v7";
40+
41+
npe_function(grad_intrinsic)
42+
npe_doc(ds_grad_intrinsic)
43+
44+
npe_arg(l, dense_float, dense_double)
45+
npe_arg(f, dense_int, dense_long, dense_longlong)
46+
47+
48+
npe_begin_code()
49+
assert_rows_match(l, f, "l", "f");
50+
assert_cols_equals(l, 3, "l");
51+
assert_valid_tri_mesh_faces(f);
52+
53+
EigenDense<npe_Scalar_f> f_copy = f;
54+
55+
Eigen::SparseMatrix<npe_Scalar_l> g;
56+
igl::grad_intrinsic(l, f_copy, g);
57+
return npe::move(g);
58+
59+
npe_end_code()
60+
61+

src/heat_geodesic.cpp

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#include <common.h>
2+
#include <npe.h>
3+
#include <typedefs.h>
4+
#include <igl/heat_geodesics.h>
5+
6+
const char *ds_heat_geodesic = R"igl_Qu8mg5v7xxx(
7+
Compute fast approximate geodesic distances using precomputed data from a set of selected source vertices (gamma)
8+
9+
Parameters
10+
----------
11+
V #V by dim list of mesh vertex positions
12+
F #F by 3 list of mesh face indices into V
13+
t "heat" parameter (smaller --> more accurate, less stable)
14+
gamma #gamma list of indices into V of source vertices
15+
16+
Returns
17+
-------
18+
D #V list of distances to gamma
19+
20+
See also
21+
--------
22+
23+
24+
Notes
25+
-----
26+
27+
Examples
28+
--------
29+
30+
)igl_Qu8mg5v7xxx";
31+
32+
npe_function(heat_geodesic)
33+
npe_doc(ds_heat_geodesic)
34+
npe_arg(v, dense_float, dense_double)
35+
npe_arg(f, dense_int, dense_long, dense_longlong)
36+
npe_arg(t, double)
37+
npe_arg(gamma, npe_matches(f))
38+
39+
npe_begin_code()
40+
assert_valid_3d_tri_mesh(v, f);
41+
42+
EigenDenseLike<npe_Matrix_v> v_copy = v;
43+
EigenDenseLike<npe_Matrix_f> f_copy = f;
44+
EigenDenseLike<npe_Matrix_f> gamma_copy = gamma;
45+
46+
Eigen::Matrix<npe_Scalar_v, Eigen::Dynamic, 1> d_copy;
47+
igl::HeatGeodesicsData<npe_Scalar_v> data;
48+
igl::heat_geodesics_precompute(v_copy, f_copy, npe_Scalar_v(t), data);
49+
igl::heat_geodesics_solve(data, gamma_copy, d_copy);
50+
EigenDenseLike<npe_Matrix_v> d = d_copy;
51+
52+
return npe::move(d);
53+
54+
npe_end_code()
55+
56+
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#include <common.h>
2+
#include <npe.h>
3+
#include <typedefs.h>
4+
#include <igl/intrinsic_delaunay_cotmatrix.h>
5+
6+
const char *ds_intrinsic_delaunay_cotmatrix = R"igl_Qu8mg5v7(
7+
8+
INTRINSIC_DELAUNAY_COTMATRIX Computes the discrete cotangent Laplacian of a
9+
mesh after converting it into its intrinsic Delaunay triangulation (see,
10+
e.g., [Fisher et al. 2007].
11+
12+
Parameters
13+
----------
14+
15+
V #V by dim list of mesh vertex positions
16+
F #F by 3 list of mesh elements (triangles or tetrahedra)
17+
18+
Returns
19+
-------
20+
21+
L #V by #V cotangent matrix, each row i corresponding to V(i,:)
22+
l_intrinsic #F by 3 list of intrinsic edge-lengths used to compute L
23+
F_intrinsic #F by 3 list of intrinsic face indices used to compute L
24+
25+
See also
26+
--------
27+
intrinsic_delaunay_triangulation, cotmatrix, cotmatrix_intrinsic
28+
29+
Notes
30+
-----
31+
32+
Examples
33+
--------
34+
35+
)igl_Qu8mg5v7";
36+
37+
npe_function(intrinsic_delaunay_cotmatrix)
38+
npe_doc(ds_intrinsic_delaunay_cotmatrix)
39+
40+
npe_arg(v, dense_float, dense_double)
41+
npe_arg(f, dense_int, dense_long, dense_longlong)
42+
43+
44+
npe_begin_code()
45+
assert_valid_3d_tri_mesh(v, f);
46+
47+
Eigen::SparseMatrix<npe_Scalar_v> l;
48+
EigenDense<npe_Scalar_v> l_intrinsic;
49+
EigenDense<npe_Scalar_f> f_intrinsic;
50+
igl::intrinsic_delaunay_cotmatrix(v, f, l, l_intrinsic, f_intrinsic);
51+
return std::make_tuple(npe::move(l), npe::move(l_intrinsic), npe::move(f_intrinsic));
52+
53+
npe_end_code()
54+

0 commit comments

Comments
 (0)