Skip to content

Unify primitive mesh refinement controls - #7357

Merged
mmichelis merged 11 commits into
isaac-sim:developfrom
mmichelis:deformable-primitive-mesh-resolution
Sep 4, 2026
Merged

Unify primitive mesh refinement controls#7357
mmichelis merged 11 commits into
isaac-sim:developfrom
mmichelis:deformable-primitive-mesh-resolution

Conversation

@mmichelis

@mmichelis mmichelis commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Add MeshCfg.edge_refinement, defaulting to 4.0, to control surface subdivision for all primitive mesh spawners using a bounding-box-diagonal target.
  • Forward 1.0 / edge_refinement to automatic tetrahedralization for volume deformables spawned through MeshCfg primitive spawners. Direct callers of define_deformable_body_properties retain its existing default factor of 0.1.
  • Document that values near 1.0 should be avoided for volume deformables because they can make TetWild tetrahedralization significantly slower.
  • Replace MeshRectangleCfg.resolution with scalar edge_refinement. This removes independent per-axis resolution control, and subdivision counts can be discontinuous for non-power-of-two factors.
  • Migrate existing cloth callsites and examples, and set the Franka soft-lift cuboid refinement to 8.0.

This is a breaking change. Unconfigured primitive surfaces now use an edge-refinement factor of 4.0, and unconfigured volume primitive spawners use a tetrahedralization factor of 0.25 instead of 0.1. Rectangles now use the common recursive edge-length subdivision instead of the previous per-axis grid.

Type of change

  • Breaking change
  • New feature

Release backport

  • Backport this pull request to the active release branch after it merges into develop

Testing

  • Ruff, format, compilation, and diff checks
  • Mesh-spawner integration suite: 21 tests
  • Newton surface-deformable initialization and freefall integration test
  • PhysX deformables demo: completed setup and simulation
  • Franka cloth environment: 20 steps each on Newton, PhysX, and OvPhysX
  • Franka cloth camera environment: 5 PhysX/RTX steps with image observations
  • Scripted Franka cloth lift: 50 steps each on Newton and PhysX
  • Franka soft lift with refinement 8.0: 10 steps each on Newton and Isaac Sim PhysX
  • Seed-42 RSL-RL scratch smoke at 2,048 environments: 55 soft updates and 11 cloth updates with finite losses
  • Seed-42 matched checkpoint continuation at 2,048 environments: 52 updates each on develop and the PR mesh; final-20 success was 67.1% versus 81.5% for soft and 85.3% versus 87.6% for cloth
  • TetWild timing check for all five volume primitives at the default factor of 0.25

PhysX reports an invalid surface-deformable-view warning in the demo and cloth environment. The same warning is present on untouched develop with the same runtime and is not introduced by this change.

Checklist

  • Changelog fragments added
  • Existing callsites migrated

@github-actions github-actions Bot added isaac-lab Related to Isaac Lab team documentation Improvements or additions to documentation labels Aug 26, 2026
@mmichelis mmichelis changed the title Expose deformable primitive mesh refinement Unify primitive mesh refinement controls Aug 26, 2026
@mmichelis
mmichelis marked this pull request as ready for review August 26, 2026 16:25
@mmichelis
mmichelis requested a review from a team August 26, 2026 16:25
@greptile-apps

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR unifies primitive mesh surface subdivision around MeshCfg.edge_refinement and forwards its reciprocal to automatic tetrahedralization for primitive volume deformables.

  • Moves edge refinement from cuboid-specific configuration to the common primitive mesh configuration with a default of 4.0.
  • Replaces rectangle per-axis grid resolution with generic diagonal-based recursive subdivision.
  • Migrates cloth examples, tests, and Franka soft-object configurations to the unified control.
  • Preserves the direct schema API’s existing tetrahedralization default of 0.1.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete blocking or independently actionable non-blocking issue identified.

The common refinement path validates the documented lower bound, applies subdivision consistently to primitive meshes, preserves direct schema-call defaults, and forwards the new tetrahedralization factor only on the existing volume-deformable path.

Important Files Changed

Filename Overview
source/isaaclab/isaaclab/sim/spawners/meshes/meshes.py Centralizes primitive surface subdivision and forwards the reciprocal refinement factor for volume tetrahedralization; no actionable defect was established.
source/isaaclab/isaaclab/sim/spawners/meshes/meshes_cfg.py Adds the common refinement field and removes rectangle resolution and the cuboid-specific override as an intentional breaking API change.
source/isaaclab/isaaclab/sim/schemas/schemas.py Adds an optional tetrahedralization factor while retaining the existing direct-caller default.
source/isaaclab/test/sim/test_spawn_meshes.py Extends integration coverage across all primitive spawners, invalid refinement, and volume-factor forwarding.
source/isaaclab_tasks/isaaclab_tasks/core/lift/config/franka_soft/franka_cloth_env_cfg.py Migrates cloth configurations from per-axis resolution to the unified refinement factor.
source/isaaclab_tasks/isaaclab_tasks/core/lift/config/franka_soft/franka_soft_env_cfg.py Raises cuboid refinement for both configured deformable backends consistently.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  C[MeshCfg.edge_refinement] --> S[Primitive surface mesh]
  S --> R[subdivide_to_size using bbox diagonal / refinement]
  R --> D{Deformable?}
  D -- No --> U[Write USD mesh]
  D -- Surface --> P[Apply surface deformable properties]
  D -- Volume --> T[Automatic tetrahedralization using 1 / refinement]
  P --> U
  T --> U
Loading

Reviews (1): Last reviewed commit: "Refine Franka soft lift cuboid mesh" | Re-trigger Greptile

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isaac Lab Review Bot

The shared edge_refinement implementation is internally consistent, but the PR removes the public MeshRectangleCfg.resolution API without deprecation and does not document the changed primitive defaults as breaking changes with migration guidance in the changelog.

  • Design and architecture: Centralizing primitive subdivision in _spawn_mesh_geom_from_mesh and forwarding the normalized target to volume tetrahedralization is coherent. However, the public rectangle configuration transition must retain a deprecation path rather than deleting resolution immediately.
  • API: MeshCfg.edge_refinement is documented and validated, and direct callers of define_deformable_body_properties retain the existing 0.1 default. Existing rectangle callers using resolution will now fail during configuration construction, contrary to the repository rule requiring deprecation before public API removal. The changed surface-refinement and tetrahedralization defaults also need a major changelog entry with explicit migration guidance.
  • Implementation: The changed spawner path consistently applies subdivision across primitive meshes and forwards 1.0 / edge_refinement only for volume deformables. The required fixes are compatibility handling for MeshRectangleCfg.resolution and release-note coverage for the changed defaults; no separate implementation defect was established.

Minor fixes needed. Posted 2 actionable findings inline.

Automated review; human maintainers own approval decisions.

Added
^^^^^

* Added ``MeshCfg.edge_refinement``, defaulting to ``4.0``, to control surface mesh resolution for all primitives and

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning · Api — Default behavior changes filed as minor addition

This fragment records only the new field, but the change also alters existing behavior: cuboid refinement default moves 1.0 -> 4.0, all other primitives gain subdivision they never had, and primitive volume deformables now tetrahedralize at 0.25 instead of 0.1. Unmodified user configs silently produce different render and simulation meshes. Record these default changes in a major fragment with migration guidance (e.g. set edge_refinement=1.0).

If None, then no physics material will be added.
"""

edge_refinement: float = 4.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning · Api — Public resolution field removed without deprecation

Introducing edge_refinement here deletes MeshRectangleCfg.resolution, so existing configurations passing resolution=(nx, ny) now fail at construction with a TypeError. Repository guidelines forbid removing a public API without a prior deprecation and migration path. Keep resolution for one release, warn when it is set, and map it onto edge_refinement (with defined precedence) before deleting it.

Rigid mesh primitives gained nothing from surface subdivision: subdivide_to_size
splits triangles linearly, so it only inserts coplanar vertices and leaves the
surface, and any collision approximation of it, unchanged. Measured on cuboid,
cylinder, cone and capsule, the convex hull volume is identical to machine
precision and every new vertex lies on the original surface to within 1e-17 m.
The default factor of 4.0 was therefore costing a 10-12x vertex count on every
rigid primitive for no benefit.

Gate the subdivision on deformable_props so rigid primitive meshes stay
identical to develop. The range validation stays unconditional.
Rebasing onto develop pushed _spawn_mesh_geom_from_mesh past the C901
complexity limit (31 > 30), since develop grew the collision-fragment
handling in the same function. Move the edge-refinement validation and
subdivision into a helper to bring it back under the cap.
@mmichelis
mmichelis force-pushed the deformable-primitive-mesh-resolution branch from 87e1398 to 791fcc6 Compare September 3, 2026 14:34
@kellyguo11

Copy link
Copy Markdown
Contributor

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 4, 2026
@kellyguo11

Copy link
Copy Markdown
Contributor

rendering test seems to have failed twice - do we need a golden image update for this?

@mmichelis

Copy link
Copy Markdown
Collaborator Author

rendering test seems to have failed twice - do we need a golden image update for this?

Ah yes that could very well be! I changed the default resolution so maybe there is some slight differences. Let me regenerate them!

Replacing MeshRectangleCfg.resolution with edge_refinement keeps the cloth
mesh geometrically identical, 81 vertices at the same positions, but flips
32 of the 64 quad diagonals: the removed grid generator alternated them,
while subdivide_to_size inherits one direction from its seed triangles.

That slightly changes the cloth's bending response, so motion_vectors is
the only affected data type, since it is the only one captured after
stepping the environment. It scored 3.32% against a 3.00% threshold,
identically on both CI shards. Every static data type still matches,
because the rest geometry is unchanged.

The new image is the reference output from the CI run for this branch.
@AntoineRichard

Copy link
Copy Markdown
Collaborator

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 4, 2026
@mmichelis
mmichelis merged commit 3fbbd15 into isaac-sim:develop Sep 4, 2026
53 checks passed
@mmichelis
mmichelis deleted the deformable-primitive-mesh-resolution branch September 4, 2026 12:29
@isaaclab-bot

isaaclab-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Backported to release/3.0.0 as 51642ea.

isaaclab-bot Bot pushed a commit that referenced this pull request Sep 4, 2026
## Description

- Add `MeshCfg.edge_refinement`, defaulting to `4.0`, to control surface
subdivision for all primitive mesh spawners using a
bounding-box-diagonal target.
- Forward `1.0 / edge_refinement` to automatic tetrahedralization for
volume deformables spawned through `MeshCfg` primitive spawners. Direct
callers of `define_deformable_body_properties` retain its existing
default factor of `0.1`.
- Document that values near `1.0` should be avoided for volume
deformables because they can make TetWild tetrahedralization
significantly slower.
- Replace `MeshRectangleCfg.resolution` with scalar `edge_refinement`.
This removes independent per-axis resolution control, and subdivision
counts can be discontinuous for non-power-of-two factors.
- Migrate existing cloth callsites and examples, and set the Franka
soft-lift cuboid refinement to `8.0`.

This is a breaking change. Unconfigured primitive surfaces now use an
edge-refinement factor of `4.0`, and unconfigured volume primitive
spawners use a tetrahedralization factor of `0.25` instead of `0.1`.
Rectangles now use the common recursive edge-length subdivision instead
of the previous per-axis grid.

## Type of change

- [x] Breaking change
- [x] New feature

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`

## Testing

- [x] Ruff, format, compilation, and diff checks
- [x] Mesh-spawner integration suite: 21 tests
- [x] Newton surface-deformable initialization and freefall integration
test
- [x] PhysX deformables demo: completed setup and simulation
- [x] Franka cloth environment: 20 steps each on Newton, PhysX, and
OvPhysX
- [x] Franka cloth camera environment: 5 PhysX/RTX steps with image
observations
- [x] Scripted Franka cloth lift: 50 steps each on Newton and PhysX
- [x] Franka soft lift with refinement `8.0`: 10 steps each on Newton
and Isaac Sim PhysX
- [x] Seed-42 RSL-RL scratch smoke at 2,048 environments: 55 soft
updates and 11 cloth updates with finite losses
- [x] Seed-42 matched checkpoint continuation at 2,048 environments: 52
updates each on develop and the PR mesh; final-20 success was 67.1%
versus 81.5% for soft and 85.3% versus 87.6% for cloth
- [x] TetWild timing check for all five volume primitives at the default
factor of `0.25`

PhysX reports an invalid surface-deformable-view warning in the demo and
cloth environment. The same warning is present on untouched `develop`
with the same runtime and is not introduced by this change.

## Checklist

- [x] Changelog fragments added
- [x] Existing callsites migrated

(cherry picked from commit 3fbbd15)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants