Move mesh inertia specification from global <compiler> to <asset/mesh>.

Three options:
- Convex: Use convex hull
- Exact: Use exact geometry (requires watertight mesh)
- Legacy: Legacy approximation (deprecated)

Fixes #2152

PiperOrigin-RevId: 688949900
Change-Id: I4537f343db917195c6fd58d517b189d5ee3be1cd
This commit is contained in:
Alessio Quaglino
2024-10-23 07:05:32 -07:00
committed by Copybara-Service
parent 0c97dcf1fd
commit b598d79b3f
19 changed files with 170 additions and 87 deletions
+20 -6
View File
@@ -815,12 +815,6 @@ has any effect. The settings here are global and apply to the entire model.
to the mass. This results in equivalent inertia boxes which extend far beyond the geometric boundaries of the model.
Note that the built-in OpenGL visualizer can render equivalent inertia boxes.
.. _compiler-exactmeshinertia:
:at:`exactmeshinertia`: :at-val:`[false, true], "false"`
If this attribute is set to false, computes mesh inertia with the legacy algorithm, which is exact only for convex
meshes. If set to true, it is exact for any closed mesh geometry.
.. _compiler-alignfree:
:at:`alignfree`: :at-val:`[false, true], "false"`
@@ -1249,6 +1243,24 @@ The full list of processing steps applied by the compiler to each mesh is as fol
This attribute specifies the scaling that will be applied to the vertex data along each coordinate axis. Negative
values are allowed, resulting in flipping the mesh along the corresponding axis.
.. _asset-mesh-inertia:
:at:`inertia`: :at-val:`[convex, exact, legacy], "legacy"`
This attribute controls how the mesh is used when mass and inertia are
:ref:`inferred from geometry<_compiler-inertiafromgeom>`. The current default value :at-val:`legacy` will be changed
to :at-val:`convex` in a future release.
:at-val:`convex`
Use the mesh's convex hull to compute volume and inertia.
:at-val:`exact`
Use an exact algorithm to compute volume and inertia. This algorithm requires a well-oriented, watertight mesh and
will error otherwise.
:at-val:`legacy`
Use the legacy algorithm, which is similar to :at-val:`convex`, but leads to volume overcounting for non-convex
meshes.
.. _asset-mesh-smoothnormal:
:at:`smoothnormal`: :at-val:`[false, true], "false"`
@@ -8016,6 +8028,8 @@ if omitted.
.. _default-mesh-maxhullvert:
.. _default-mesh-inertia:
:el-prefix:`default/` |-| **mesh** (?)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^