|
| 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 | + |
0 commit comments