-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bunch more bindings; embree; enums; no mqwf class
- Loading branch information
1 parent
4c13728
commit 62183ed
Showing
51 changed files
with
1,904 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "default_types.h" | ||
#include <igl/FileEncoding.h> | ||
#include <nanobind/nanobind.h> | ||
#include <nanobind/ndarray.h> | ||
|
||
namespace nb = nanobind; | ||
using namespace nb::literals; | ||
|
||
void bind_FileEncoding(nb::module_ &m) | ||
{ | ||
nb::enum_<igl::FileEncoding>(m,"FileEncoding") | ||
.value("Ascii", igl::FileEncoding::Ascii) | ||
.value("Binary", igl::FileEncoding::Binary) | ||
.export_values(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include "default_types.h" | ||
#include <igl/MappingEnergyType.h> | ||
#include <nanobind/nanobind.h> | ||
#include <nanobind/ndarray.h> | ||
|
||
namespace nb = nanobind; | ||
using namespace nb::literals; | ||
|
||
void bind_MappingEnergyType(nb::module_ &m) | ||
{ | ||
nb::enum_<igl::MappingEnergyType>(m, "MappingEnergyType") | ||
.value("ARAP", igl::MappingEnergyType::ARAP) | ||
.value("LOG_ARAP", igl::MappingEnergyType::LOG_ARAP) | ||
.value("SYMMETRIC_DIRICHLET", igl::MappingEnergyType::SYMMETRIC_DIRICHLET) | ||
.value("CONFORMAL", igl::MappingEnergyType::CONFORMAL) | ||
.value("EXP_CONFORMAL", igl::MappingEnergyType::EXP_CONFORMAL) | ||
.value("EXP_SYMMETRIC_DIRICHLET", igl::MappingEnergyType::EXP_SYMMETRIC_DIRICHLET) | ||
.export_values() | ||
; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include "default_types.h" | ||
#include <igl/average_onto_faces.h> | ||
#include <nanobind/nanobind.h> | ||
#include <nanobind/ndarray.h> | ||
#include <nanobind/eigen/dense.h> | ||
|
||
namespace nb = nanobind; | ||
using namespace nb::literals; | ||
|
||
namespace pyigl | ||
{ | ||
auto average_onto_faces( | ||
const nb::DRef<const Eigen::MatrixXI> &F, | ||
const nb::DRef<const Eigen::VectorXN> &S) | ||
{ | ||
Eigen::VectorXN SF; | ||
igl::average_onto_faces(F,S,SF); | ||
return SF; | ||
} | ||
} | ||
|
||
// Bind the wrapper to the Python module | ||
void bind_average_onto_faces(nb::module_ &m) | ||
{ | ||
m.def( | ||
"average_onto_faces", | ||
&pyigl::average_onto_faces, | ||
"F"_a, | ||
"S"_a, | ||
R"(Move a scalar field defined on faces to faces by averaging | ||
@param[in] F #F by 3 triangle mesh connectivity | ||
@param[in] S #F by 1 scalar field defined on faces | ||
@param[out] SF #F by 1 scalar field defined on faces | ||
)" | ||
); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include "default_types.h" | ||
#include <igl/average_onto_vertices.h> | ||
#include <nanobind/nanobind.h> | ||
#include <nanobind/ndarray.h> | ||
#include <nanobind/eigen/dense.h> | ||
|
||
namespace nb = nanobind; | ||
using namespace nb::literals; | ||
|
||
namespace pyigl | ||
{ | ||
auto average_onto_vertices( | ||
const nb::DRef<const Eigen::MatrixXN> &V, | ||
const nb::DRef<const Eigen::MatrixXI> &F, | ||
const nb::DRef<const Eigen::VectorXN> &S) | ||
{ | ||
Eigen::VectorXN SV; | ||
igl::average_onto_vertices(V,F,S,SV); | ||
return SV; | ||
} | ||
} | ||
|
||
// Bind the wrapper to the Python module | ||
void bind_average_onto_vertices(nb::module_ &m) | ||
{ | ||
m.def( | ||
"average_onto_vertices", | ||
&pyigl::average_onto_vertices, | ||
"V"_a, | ||
"F"_a, | ||
"S"_a, | ||
R"(Move a scalar field defined on faces to vertices by averaging | ||
@param[in] S #V by dim triangle mesh connectivity | ||
@param[in] F #F by 3 triangle mesh connectivity | ||
@param[in] S #F by 1 scalar field defined on faces | ||
@param[out] SV #V by 1 scalar field defined on vertices | ||
)" | ||
); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include "default_types.h" | ||
#include <igl/avg_edge_length.h> | ||
#include <nanobind/nanobind.h> | ||
#include <nanobind/ndarray.h> | ||
#include <nanobind/eigen/dense.h> | ||
#include <nanobind/eigen/sparse.h> | ||
#include <nanobind/stl/tuple.h> | ||
|
||
namespace nb = nanobind; | ||
using namespace nb::literals; | ||
|
||
namespace pyigl | ||
{ | ||
auto avg_edge_length( | ||
const nb::DRef<const Eigen::MatrixXN> &V, | ||
const nb::DRef<const Eigen::MatrixXI> &F) | ||
{ | ||
return (Numeric)igl::avg_edge_length(V,F); | ||
} | ||
} | ||
|
||
void bind_avg_edge_length(nb::module_ &m) | ||
{ | ||
m.def( | ||
"avg_edge_length", | ||
&pyigl::avg_edge_length, | ||
"V"_a, | ||
"F"_a, | ||
R"(Constructs the cotangent stiffness matrix (discrete laplacian) for a given | ||
mesh (V,F). | ||
@tparam DerivedV derived type of eigen matrix for V (e.g. derived from | ||
MatrixXd) | ||
@tparam DerivedF derived type of eigen matrix for F (e.g. derived from | ||
MatrixXi) | ||
@tparam Scalar scalar type for eigen sparse matrix (e.g. double) | ||
@param[in] V #V by dim list of mesh vertex positions | ||
@param[in] F #F by simplex_size list of mesh elements (triangles or tetrahedra) | ||
@param[out] L #V by #V cotangent matrix, each row i corresponding to V(i,:))"); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.