|
| 1 | +#include "default_types.h" |
| 2 | +#include <igl/compute_frame_field_bisectors.h> |
| 3 | +#include <nanobind/nanobind.h> |
| 4 | +#include <nanobind/ndarray.h> |
| 5 | +#include <nanobind/eigen/dense.h> |
| 6 | +#include <nanobind/stl/tuple.h> |
| 7 | + |
| 8 | +namespace nb = nanobind; |
| 9 | +using namespace nb::literals; |
| 10 | + |
| 11 | +void bind_compute_frame_field_bisectors(nb::module_ &m) |
| 12 | +{ |
| 13 | + m.def("compute_frame_field_bisectors", |
| 14 | + []( |
| 15 | + const Eigen::MatrixXN& V, |
| 16 | + const Eigen::MatrixXI& F, |
| 17 | + const Eigen::MatrixXN& B1, |
| 18 | + const Eigen::MatrixXN& B2, |
| 19 | + const Eigen::MatrixXN& PD1, |
| 20 | + const Eigen::MatrixXN& PD2 |
| 21 | + ) { |
| 22 | + Eigen::MatrixXN BIS1, BIS2; |
| 23 | + igl::compute_frame_field_bisectors(V, F, B1, B2, PD1, PD2, BIS1, BIS2); |
| 24 | + return std::make_tuple(BIS1, BIS2); |
| 25 | + }, |
| 26 | + "V"_a, |
| 27 | + "F"_a, |
| 28 | + "B1"_a, |
| 29 | + "B2"_a, |
| 30 | + "PD1"_a, |
| 31 | + "PD2"_a, |
| 32 | + R"(Compute bisectors of a frame field defined on mesh faces. |
| 33 | +
|
| 34 | + @param[in] V #V by 3 eigen Matrix of mesh vertex 3D positions |
| 35 | + @param[in] F #F by 3 eigen Matrix of face (triangle) indices |
| 36 | + @param[in] B1 #F by 3 eigen Matrix of face (triangle) base vector 1 |
| 37 | + @param[in] B2 #F by 3 eigen Matrix of face (triangle) base vector 2 |
| 38 | + @param[in] PD1 #F by 3 eigen Matrix of the first per face frame field vector |
| 39 | + @param[in] PD2 #F by 3 eigen Matrix of the second per face frame field vector |
| 40 | + @param[out] BIS1 #F by 3 eigen Matrix of the first per face frame field bisector |
| 41 | + @param[out] BIS2 #F by 3 eigen Matrix of the second per face frame field bisector |
| 42 | + )" |
| 43 | + ); |
| 44 | + |
| 45 | + // Overload |
| 46 | + m.def("compute_frame_field_bisectors", |
| 47 | + []( |
| 48 | + const Eigen::MatrixXN& V, |
| 49 | + const Eigen::MatrixXI& F, |
| 50 | + const Eigen::MatrixXN& PD1, |
| 51 | + const Eigen::MatrixXN& PD2 |
| 52 | + ) { |
| 53 | + Eigen::MatrixXN BIS1, BIS2; |
| 54 | + igl::compute_frame_field_bisectors(V, F, PD1, PD2, BIS1, BIS2); |
| 55 | + return std::make_tuple(BIS1, BIS2); |
| 56 | + }, |
| 57 | + "V"_a, |
| 58 | + "F"_a, |
| 59 | + "PD1"_a, |
| 60 | + "PD2"_a, |
| 61 | + R"(Compute bisectors of a frame field defined on mesh faces. |
| 62 | +
|
| 63 | + @param[in] V #V by 3 eigen Matrix of mesh vertex 3D positions |
| 64 | + @param[in] F #F by 3 eigen Matrix of face (triangle) indices |
| 65 | + @param[in] PD1 #F by 3 eigen Matrix of the first per face frame field vector |
| 66 | + @param[in] PD2 #F by 3 eigen Matrix of the second per face frame field vector |
| 67 | + @param[out] BIS1 #F by 3 eigen Matrix of the first per face frame field bisector |
| 68 | + @param[out] BIS2 #F by 3 eigen Matrix of the second per face frame field bisector |
| 69 | + )" |
| 70 | + ); |
| 71 | +} |
0 commit comments