@@ -12,7 +12,8 @@ namespace py = pybind11;
1212PYBIND11_MODULE (pyigl_classes, m)
1313{
1414 py::class_<igl::ARAPData>(m, " ARAP" )
15- .def (py::init ([](Eigen::MatrixXd &v, Eigen::MatrixXi &f, int dim, Eigen::MatrixXi &b, const int energy_type) {
15+ .def (py::init ([](Eigen::MatrixXd &v, Eigen::MatrixXi &f, int dim, Eigen::MatrixXi &b,
16+ const int energy_type, const bool with_dynamics, const double h, const double ym, const int max_iter) {
1617 if (dim == 3 )
1718 {
1819 assert_valid_tet_or_tri_mesh (v, f);
@@ -27,11 +28,15 @@ PYBIND11_MODULE(pyigl_classes, m)
2728 }
2829 if (energy_type >= igl::NUM_ARAP_ENERGY_TYPES)
2930 {
30- throw pybind11::value_error (" Invalid Energy Type. Must be one of igl.ARAP_ENERGY_TYPE_*" );
31+ throw pybind11::value_error (" Invalid Energy Type. Must be one of igl.ARAP_ENERGY_TYPE_*" );
3132 }
3233
3334 std::unique_ptr<igl::ARAPData> adata = std::make_unique<igl::ARAPData>();
3435 adata->energy = static_cast <igl::ARAPEnergyType>(energy_type);
36+ adata->with_dynamics = with_dynamics;
37+ adata->h = h;
38+ adata->ym = ym;
39+ adata->max_iter = max_iter;
3540
3641 if (b.cols () == 1 )
3742 igl::arap_precomputation (v, f, dim, b, *adata);
@@ -41,7 +46,7 @@ PYBIND11_MODULE(pyigl_classes, m)
4146 throw pybind11::value_error (" Invalid dimension for b, must be a vector, got " + std::to_string (b.rows ()) + " x" + std::to_string (b.cols ()));
4247 return adata;
4348 }),
44- py::arg (" v" ), py::arg (" f" ), py::arg (" dim" ), py::arg (" b" ), py::arg (" energy_type" ) = 3 )
49+ py::arg (" v" ), py::arg (" f" ), py::arg (" dim" ), py::arg (" b" ), py::arg (" energy_type" ) = 3 , py::arg ( " with_dynamics " ) = false , py::arg ( " h " ) = 1 , py::arg ( " ym " ) = 1 , py::arg ( " max_iter " ) = 10 )
4550 .def (
4651 " solve" , [](igl::ARAPData &self, Eigen::MatrixXd &bc, Eigen::MatrixXd &initial_guess) {
4752 if (bc.size () > 0 )
0 commit comments