Skip to content

Commit b8d775e

Browse files
committed
Added sample_to_mesh to Python bindings
1 parent bc6a5cb commit b8d775e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

python/generate-python-bindings.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ PYBIND11_MODULE(eos, eos_module)
145145
* - draw_sample()
146146
* - load_model(), save_model()
147147
* - load_pca_model(), save_pca_model()
148+
* - sample_to_mesh()
148149
*/
149150
py::class_<morphablemodel::PcaModel>(morphablemodel_module, "PcaModel", "Class representing a PcaModel with a mean, eigenvectors and eigenvalues, as well as a list of triangles to build a mesh.")
150151
.def(py::init<>(), "Creates an empty model.")
@@ -190,6 +191,13 @@ PYBIND11_MODULE(eos, eos_module)
190191
morphablemodel_module.def("load_pca_model", &morphablemodel::load_pca_model, "Load a PCA model from a cereal::BinaryInputArchive (.bin) from the harddisk.", py::arg("filename"));
191192
morphablemodel_module.def("save_pca_model", &morphablemodel::save_pca_model, "Save a PCA model as cereal::BinaryOutputArchive.", py::arg("model"), py::arg("filename"));
192193

194+
morphablemodel_module.def(
195+
"sample_to_mesh", &morphablemodel::sample_to_mesh,
196+
"Helper function that creates a Mesh from given shape and (optional) colour PCA instances.",
197+
py::arg("shape_instance"), py::arg("color_instance"), py::arg("tvi"), py::arg("tci"),
198+
py::arg("texture_coordinates") = std::vector<std::array<double, 2>>(),
199+
py::arg("texture_triangle_indices") = std::vector<std::array<int, 3>>());
200+
193201
/**
194202
* - EdgeTopology
195203
* - load_edge_topology()

0 commit comments

Comments
 (0)