Skip to content

Fix particle loading and update vis_mesh in USD stage construction - #4

Merged
xiangdonglai merged 3 commits into
xiangdonglai:donglaix/deformable_newton_apifrom
mmichelis:mym/deformable_newton_api
Apr 24, 2026
Merged

xiangdonglai merged 3 commits into
xiangdonglai:donglaix/deformable_newton_apifrom
mmichelis:mym/deformable_newton_api

Conversation

@mmichelis

Copy link
Copy Markdown
Collaborator

Description

This pull request introduces improvements to the synchronization and management of deformable body particles between the simulation and visual meshes, with a focus on supporting variable particle counts per body and ensuring the visual mesh matches the simulation mesh surface. The main changes include updating how particle counts are tracked and passed through the pipeline, and refactoring mesh synchronization logic for clarity and correctness.

Deformable mesh synchronization and visual mesh updates:

  • [schemas.py]: Added logic to overwrite the visual mesh with the surface points and faces from the simulation mesh (specifically for volume deformables), ensuring that the visual representation matches the simulated geometry. This is a temporary solution that addresses cases where the visual mesh does not match the simulation mesh surface.

Particle count tracking and synchronization:

  • [newton_manager.py]: Introduced a new per-body particle count attribute (_newton_particle_count_attr) and ensured it is created and set on the visual mesh prims during simulation startup. This allows for correct handling of bodies with varying particle counts.
  • [newton_manager.py]: Updated the particle synchronization kernel (_sync_particle_points) and its invocation to use per-body particle counts instead of a single global count, by passing a counts array.

Refactoring and cleanup:

  • [newton_manager.py]: Simplified and clarified the mesh resolving logic in start_simulation, focusing on visual mesh paths and removing redundant code for simulation mesh handling, since visual mesh synchronization is now handled in schemas.py.

@xiangdonglai
xiangdonglai marked this pull request as ready for review April 24, 2026 21:09
@xiangdonglai
xiangdonglai merged commit 8752d6f into xiangdonglai:donglaix/deformable_newton_api Apr 24, 2026
5 of 8 checks passed
xiangdonglai added a commit that referenced this pull request Apr 24, 2026
Cherry-pick Mike's fixes from #4:

- Move visual mesh topology overwrite to define_deformable_body_properties
  in schemas.py so it happens at USD authoring time, not simulation start.
- Add per-instance newton:particleCount Fabric attribute so the sync kernel
  supports heterogeneous deformable bodies instead of assuming a single
  particles_per_body for all instances.
- Simplify setup_fabric_particle_sync() to only create Fabric attributes.
mmichelis pushed a commit to mmichelis/IsaacLab that referenced this pull request May 7, 2026
Cherry-pick Mike's fixes from xiangdonglai#4:

- Move visual mesh topology overwrite to define_deformable_body_properties
  in schemas.py so it happens at USD authoring time, not simulation start.
- Add per-instance newton:particleCount Fabric attribute so the sync kernel
  supports heterogeneous deformable bodies instead of assuming a single
  particles_per_body for all instances.
- Simplify setup_fabric_particle_sync() to only create Fabric attributes.
@mmichelis
mmichelis deleted the mym/deformable_newton_api branch May 22, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants