Skip to content

Commit

Permalink
add default args for transform
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanhhughes committed Aug 20, 2024
1 parent 12178ee commit 8d2e068
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions python/bindings/src/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,17 @@ void addBindings(pybind11::module_& module) {
})
.def("set_faces",
[](Mesh& mesh, const Eigen::MatrixXi& faces) { setEigenFaces(mesh, faces); })
.def("transform",
[](Mesh& mesh,
const Eigen::Matrix3d& rotation,
const Eigen::Vector3d& translation) {
const Eigen::Isometry3d transform =
Eigen::Translation3d(translation) * Eigen::Quaterniond(rotation);
mesh.transform(transform.cast<float>());
})
.def(
"transform",
[](Mesh& mesh,
const Eigen::Matrix3d& rotation,
const Eigen::Vector3d& translation) {
const Eigen::Isometry3d transform =
Eigen::Translation3d(translation) * Eigen::Quaterniond(rotation);
mesh.transform(transform.cast<float>());
},
"rotation"_a = Eigen::Matrix3d::Identity(),
"translation"_a = Eigen::Vector3d::Zero())
.def("append", &Mesh::append)
.def(py::self += py::self);
}
Expand Down

0 comments on commit 8d2e068

Please sign in to comment.