Add built-in sphere mesh.

PiperOrigin-RevId: 791162850
Change-Id: I573a414727e79f1a495e0f2282b2faff48ab3443
This commit is contained in:
Yuval Tassa
2025-08-05 05:04:11 -07:00
committed by Copybara-Service
parent 5220767457
commit 996f0040fd
8 changed files with 165 additions and 8 deletions
+9
View File
@@ -1014,6 +1014,15 @@ PYBIND11_MODULE(_specs, m) {
},
py::arg("resolution") = std::array<int, 2>{0, 0},
py::arg("fov") = std::array<double, 2>{0, 0}, py::arg("gamma") = 0);
mjsMesh.def(
"make_sphere",
[](raw::MjsMesh* self, int subdivision) {
double params[1] = {static_cast<double>(subdivision)};
if (mjs_makeMesh(self, mjMESH_BUILTIN_SPHERE, params, 1)) {
throw pybind11::value_error(mjs_getError(mjs_getSpec(self->element)));
}
},
py::arg("subdivision"));
mjsMesh.def(
"make_hemisphere",
[](raw::MjsMesh* self, int subdivision) {