File size: 11,667 Bytes
d6b3397
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
.. _migrating-deformables:

Migration of Deformables
========================

.. currentmodule:: isaaclab

In the newer versions of Omni Physics (107.0 and later), the old deformable body functionality has become deprecated.
The following sections describe the changes to migrate to the new Omni Physics API, specifically moving away from
Soft Bodies and towards Surface and Volume Deformables. The deformable object asset classes remain in
``isaaclab.assets``. Schema define/modify functions remain unified in ``isaaclab.sim.schemas``, and deformable
material spawning remains unified in ``isaaclab.sim.spawners.materials``. Deformable property and material
configuration classes are backend-specific: PhysX configurations live in ``isaaclab_physx.sim`` and Newton
configurations live in ``isaaclab_newton.sim``.

.. note::

  The following changes are with respect to Isaac Lab v3.0.0 and Omni Physics v110.0. Please refer to the
  `release notes`_ for any changes in the future releases.


Surface and Volume Deformables
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

With the new Omni Physics API, deformable bodies are split into two distinct types, as described in the
`Omni Physics documentation`_:

- **Volume deformables**: 3D objects simulated with a tetrahedral FEM mesh (e.g., soft cubes, spheres, capsules).
  These support kinematic targets on individual vertices. The simulation operates on a tetrahedral mesh internally,
  while a separate triangle surface mesh handles rendering.
- **Surface deformables**: 2D surfaces simulated directly on a triangle mesh (e.g., cloth, fabric, membranes).
  These have additional material properties for controlling stretch, shear, and bend stiffness, but do not support
  kinematic vertex targets.

The type of deformable is determined by the **physics material** assigned to the object:

- :class:`~isaaclab_physx.sim.PhysxDeformableBodyMaterialCfg` creates a PhysX **volume** deformable.
- :class:`~isaaclab_physx.sim.PhysxSurfaceDeformableBodyMaterialCfg` creates a PhysX **surface** deformable.
- :class:`~isaaclab_newton.sim.spawners.materials.NewtonDeformableBodyMaterialCfg` creates a Newton
  **volume** deformable.
- :class:`~isaaclab_newton.sim.spawners.materials.NewtonSurfaceDeformableBodyMaterialCfg` creates a Newton
  **surface** deformable.


Migration from the Old API
~~~~~~~~~~~~~~~~~~~~~~~~~~

Import Changes
^^^^^^^^^^^^^^

Deformable object cfgs remain in ``isaaclab.assets``. Deformable schema and material cfgs should be imported
from the physics backend package:

.. list-table::
   :header-rows: 1
   :widths: 50 50

   * - Old Import
     - New Import
   * - ``from isaaclab.sim import DeformableBodyPropertiesCfg``
     - ``from isaaclab_physx.sim import PhysxDeformableBodyPropertiesCfg``
   * - ``from isaaclab.sim import DeformableBodyMaterialCfg``
     - ``from isaaclab_physx.sim import PhysxDeformableBodyMaterialCfg``
   * - ``from isaaclab.sim import SurfaceDeformableBodyMaterialCfg``
     - ``from isaaclab_physx.sim import PhysxSurfaceDeformableBodyMaterialCfg``
   * - ``from isaaclab.sim import DeformableBodyPropertiesCfg``
     - ``from isaaclab_newton.sim.schemas import NewtonDeformableBodyPropertiesCfg``
   * - ``from isaaclab.sim import DeformableBodyMaterialCfg``
     - ``from isaaclab_newton.sim.spawners.materials import NewtonDeformableBodyMaterialCfg``
   * - ``from isaaclab.sim import SurfaceDeformableBodyMaterialCfg``
     - ``from isaaclab_newton.sim.spawners.materials import NewtonSurfaceDeformableBodyMaterialCfg``
   * - ``from isaaclab_physx.assets import DeformableObjectCfg``
     - ``from isaaclab.assets import DeformableObjectCfg``


Removed Properties
^^^^^^^^^^^^^^^^^^

The following properties have been **removed** from
:class:`~isaaclab_physx.sim.PhysxDeformableBodyPropertiesCfg`:

- ``collision_simplification`` and related parameters (``collision_simplification_remeshing``,
  ``collision_simplification_target_triangle_count``, ``collision_simplification_force_conforming``,
  ``collision_simplification_remove_open_edges``) β€” collision mesh generation is now handled automatically by
  PhysX through ``deformableUtils.create_auto_volume_deformable_hierarchy()`` and
  ``deformableUtils.create_auto_surface_deformable_hierarchy()``.
- ``simulation_hexahedral_resolution`` β€” the simulation mesh resolution is no longer user-configurable;
  PhysX determines it automatically.
- ``vertex_velocity_damping`` β€” replaced by the more general ``linear_damping`` property from the
  `PhysX deformable schema`_.
- ``sleep_damping`` β€” replaced by ``settling_damping`` in the `PhysX deformable schema`_.

Added Properties
^^^^^^^^^^^^^^^^

The following properties have been **added** to
:class:`~isaaclab_physx.sim.PhysxDeformableBodyPropertiesCfg`:

- ``deformable_body_enabled``, ``kinematic_enabled``, and ``mass`` β€” OmniPhysics
  deformable body properties owned by the PhysX backend cfg.
- ``linear_damping`` β€” linear damping coefficient [1/s].
- ``max_linear_velocity`` β€” maximum allowable linear velocity [m/s]. A negative value lets the simulation choose
  a per-vertex value dynamically (currently only supported for surface deformables).
- ``settling_damping`` β€” additional damping applied when vertex velocity falls below ``settling_threshold`` [1/s].
- ``enable_speculative_c_c_d`` β€” enables speculative continuous collision detection.
- ``disable_gravity`` β€” per-deformable gravity control.
- ``collision_pair_update_frequency`` β€” how often surface-to-surface collision pairs are updated per time step
  (surface deformables only).
- ``collision_iteration_multiplier`` β€” collision subiterations per solver iteration (surface deformables only).

For a full description of all available properties, refer to the `PhysX deformable schema`_ and
`OmniPhysics deformable schema`_ documentation.

Material Changes
^^^^^^^^^^^^^^^^

The deformable material hierarchy is now split by backend:

- :class:`~isaaclab.sim.DeformableBodyMaterialBaseCfg` and
  :class:`~isaaclab.sim.SurfaceDeformableBodyMaterialBaseCfg` β€” empty base classes for backend-specific
  deformable material configs.
- :class:`~isaaclab_physx.sim.PhysxDeformableBodyMaterialCfg` β€” for PhysX volume deformables. Contains ``density``,
  ``static_friction``, ``dynamic_friction``, ``youngs_modulus``, ``poissons_ratio``, and ``elasticity_damping``.
- :class:`~isaaclab_physx.sim.PhysxSurfaceDeformableBodyMaterialCfg` β€” extends the PhysX volume material config with
  surface-specific properties: ``surface_thickness``, ``surface_stretch_stiffness``, ``surface_shear_stiffness``,
  ``surface_bend_stiffness``, and ``bend_damping``.
- :class:`~isaaclab_newton.sim.spawners.materials.NewtonDeformableBodyMaterialCfg` and
  :class:`~isaaclab_newton.sim.spawners.materials.NewtonSurfaceDeformableBodyMaterialCfg` contain Newton-specific
  fields such as density, particle radius, direct Lame parameters ``k_mu``/``k_lambda`` for volume deformables,
  and VBD stiffness parameters for surface deformables.

The old ``damping_scale`` property has been removed. Use ``elasticity_damping`` directly instead.

DeformableObject View Change
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The internal PhysX view type has changed from ``physx.SoftBodyView`` to ``physx.DeformableBodyView``.
The property ``root_physx_view`` has been deprecated in favor of ``root_view``.


Code Examples
~~~~~~~~~~~~~

Volume Deformable (Before and After)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

**Before**:

.. code-block:: python
   :emphasize-lines: 1,2

   import isaaclab.sim as sim_utils
   from isaaclab.assets import DeformableObject, DeformableObjectCfg

   cfg = DeformableObjectCfg(
       prim_path="/World/Origin.*/Cube",
       spawn=sim_utils.MeshCuboidCfg(
           size=(0.2, 0.2, 0.2),
           deformable_props=sim_utils.DeformableBodyPropertiesCfg(),
           visual_material=sim_utils.PreviewSurfaceCfg(),
           physics_material=sim_utils.DeformableBodyMaterialCfg(poissons_ratio=0.4, youngs_modulus=1e5),
       ),
   )
   cube_object = DeformableObject(cfg=cfg)

**After**:

.. code-block:: python
   :emphasize-lines: 1,2

   import isaaclab.sim as sim_utils
   from isaaclab.assets import DeformableObject, DeformableObjectCfg
   from isaaclab_physx.sim import PhysxDeformableBodyMaterialCfg, PhysxDeformableBodyPropertiesCfg

   cfg = DeformableObjectCfg(
       prim_path="/World/Origin.*/Cube",
       spawn=sim_utils.MeshCuboidCfg(
           size=(0.2, 0.2, 0.2),
           deformable_props=PhysxDeformableBodyPropertiesCfg(),
           visual_material=sim_utils.PreviewSurfaceCfg(),
           physics_material=PhysxDeformableBodyMaterialCfg(poissons_ratio=0.4, youngs_modulus=1e5),
       ),
   )
   cube_object = DeformableObject(cfg=cfg)

Surface Deformable (New)
^^^^^^^^^^^^^^^^^^^^^^^^

Surface deformables use :class:`~isaaclab.sim.spawners.meshes.MeshRectangleCfg` for 2D meshes, combined with
:class:`~isaaclab_physx.sim.PhysxSurfaceDeformableBodyMaterialCfg`:

.. code-block:: python

   import isaaclab.sim as sim_utils
   from isaaclab.assets import DeformableObject, DeformableObjectCfg
   from isaaclab_physx.sim import PhysxDeformableBodyPropertiesCfg, PhysxSurfaceDeformableBodyMaterialCfg

   cfg = DeformableObjectCfg(
       prim_path="/World/Origin.*/Cloth",
       spawn=sim_utils.MeshRectangleCfg(
           size=(1.5, 1.5),
           resolution=(21, 21),
           deformable_props=PhysxDeformableBodyPropertiesCfg(),
           visual_material=sim_utils.PreviewSurfaceCfg(),
           physics_material=PhysxSurfaceDeformableBodyMaterialCfg(poissons_ratio=0.4, youngs_modulus=1e5),
       ),
   )
   cloth_object = DeformableObject(cfg=cfg)

USD File Deformable
^^^^^^^^^^^^^^^^^^^

Deformable properties can also be applied to imported USD assets using
:class:`~isaaclab.sim.spawners.from_files.UsdFileCfg`:

.. code-block:: python

   import isaaclab.sim as sim_utils
   from isaaclab.assets import DeformableObject, DeformableObjectCfg
   from isaaclab_physx.sim import PhysxDeformableBodyMaterialCfg, PhysxDeformableBodyPropertiesCfg

   from isaaclab.utils.assets import ISAACLAB_NUCLEUS_DIR

   cfg = DeformableObjectCfg(
       prim_path="/World/Origin.*/Teddy",
       spawn=sim_utils.UsdFileCfg(
           usd_path=f"{ISAACLAB_NUCLEUS_DIR}/Objects/Teddy_Bear/teddy_bear.usd",
           deformable_props=PhysxDeformableBodyPropertiesCfg(),
           physics_material=PhysxDeformableBodyMaterialCfg(poissons_ratio=0.4, youngs_modulus=1e5),
           scale=[0.05, 0.05, 0.05],
       ),
   )
   teddy_object = DeformableObject(cfg=cfg)


Limitations
~~~~~~~~~~~

- **Kinematic targets are volume-only.** Calling
  :meth:`~isaaclab.assets.DeformableObject.write_nodal_kinematic_target_to_sim_index` on a surface
  deformable will raise a ``ValueError``.
- **Surface-specific solver properties** (``collision_pair_update_frequency``,
  ``collision_iteration_multiplier``) have no effect on volume deformables.
- **Newton deformables are experimental.** They are implemented in
  :mod:`isaaclab_contrib.deformable` and currently target VBD-based solvers and
  coupled rigid-deformable workflows.


.. _Omni Physics documentation: https://docs.omniverse.nvidia.com/kit/docs/omni_physics/110.0/dev_guide/deformables/deformable_bodies.html
.. _PhysX deformable schema: https://docs.omniverse.nvidia.com/kit/docs/omni_physics/110.0/dev_guide/deformables/physx_deformable_schema.html#physxbasedeformablebodyapi
.. _OmniPhysics deformable schema: https://docs.omniverse.nvidia.com/kit/docs/omni_physics/110.0/dev_guide/deformables/omniphysics_deformable_schema.html
.. _release notes: https://github.com/isaac-sim/IsaacLab/releases