Finalize built-in mesh example model and documentation

PiperOrigin-RevId: 791227350
Change-Id: Ibdcdb8a4ee5b3f78c9ae93e1db2a9a2f9d55a80c
This commit is contained in:
Yuval Tassa
2025-08-05 08:31:46 -07:00
committed by Copybara-Service
parent 2f4375dda3
commit fde479736e
11 changed files with 283 additions and 55 deletions
+13
View File
@@ -590,6 +590,8 @@ attaching. However, it is possible to override the default behavior by setting `
worldframe_in_site = parent.attach(child, site=site, prefix='child-')
worldframe_in_frame = parent.attach(child, frame=frame, prefix='child-')
.. _PyEditConvenience:
Convenience methods
-------------------
@@ -641,6 +643,17 @@ The ``MjSpec`` object can be serialized with all of its assets using the functio
can be either a path to a file or a file object. In order to load the spec from a zip file, use ``spec =
MjSpec.from_zip(file)``, where ``file`` is a path to a zip file or a zip file object.
Mesh creation
^^^^^^^^^^^^^
The :ref:`mjsMesh` object includes convenience methods for model creation with named attributes, corresponding to the
:ref:`mesh/builtin<asset-mesh-builtin>` semantics. See `specs_test.py
<https://github.com/google-deepmind/mujoco/blob/main/python/mujoco/specs_test.py>`__.
.. code-block:: python
mesh = spec.add_mesh(name='prism')
mesh.make_cone(nedge=5, radius=1)
.. _PyMJCF:
Relationship to ``PyMJCF`` and ``bind``