Add built-in supertoroid mesh.

PiperOrigin-RevId: 791180080
Change-Id: I3a70f50ff4a52a1bd4b88fc30334a574895145b4
This commit is contained in:
Yuval Tassa
2025-08-05 06:05:44 -07:00
committed by Copybara-Service
parent e543ba95c5
commit a5d4d1000e
13 changed files with 189 additions and 41 deletions
+10
View File
@@ -1041,6 +1041,16 @@ PYBIND11_MODULE(_specs, m) {
}
},
py::arg("nedge"), py::arg("radius"));
mjsMesh.def(
"make_supertorus",
[](raw::MjsMesh* self, int resolution, double radius, double s,
double t) {
double params[4] = {static_cast<double>(resolution), radius, s, t};
if (mjs_makeMesh(self, mjMESH_BUILTIN_SUPERTORUS, params, 4)) {
throw pybind11::value_error(mjs_getError(mjs_getSpec(self->element)));
}
},
py::arg("resolution"), py::arg("radius"), py::arg("s"), py::arg("t"));
mjsMesh.def(
"make_plate",
[](raw::MjsMesh* self, std::array<int, 2>& resolution) {