Adds built-in superellipsoid mesh.

PiperOrigin-RevId: 791196831
Change-Id: I1d864f6e620870f016377a4d9e2e26d1a23fd77e
This commit is contained in:
Yuval Tassa
2025-08-05 07:01:52 -07:00
committed by Copybara-Service
parent e74cee652f
commit 705ec6d7fb
12 changed files with 253 additions and 137 deletions
+9
View File
@@ -1041,6 +1041,15 @@ PYBIND11_MODULE(_specs, m) {
}
},
py::arg("nedge"), py::arg("radius"));
mjsMesh.def(
"make_supersphere",
[](raw::MjsMesh* self, int resolution, double e, double n) {
double params[3] = {static_cast<double>(resolution), e, n};
if (mjs_makeMesh(self, mjMESH_BUILTIN_SUPERSPHERE, params, 3)) {
throw pybind11::value_error(mjs_getError(mjs_getSpec(self->element)));
}
},
py::arg("resolution"), py::arg("e"), py::arg("n"));
mjsMesh.def(
"make_supertorus",
[](raw::MjsMesh* self, int resolution, double radius, double s,