NVIDIA / warp

A Python framework for high performance GPU simulation and graphics

Home Page:https://nvidia.github.io/warp/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

update the mesh during simulation

cyanzhao42 opened this issue · comments

Hi, thanks for the great work. I am interested in simulating cloth with moving objects. I am following the example code: https://github.com/NVIDIA/warp/blob/main/examples/example_sim_cloth.py here. I am wondering if it would be possible to update the "mesh" (builder.add_shape_mesh) vertices during the simulation.

I found the example here - https://github.com/NVIDIA/warp/blob/main/examples/example_mesh.py, on how to update the mesh, however, the mesh object is not compatible with wp.sim. I am wondering if there is a smart way to address this. Thanks!

Hi @cyanzhao42, yes take a look at the wp.sim.Mesh class: https://github.com/NVIDIA/warp/blob/main/warp/sim/model.py#L256. Here you can see it contains a regular mesh that can be updated + refit() as desired.

Cheers,
Miles

The Omniverse cloth node extension also does this, you can look here for an example:

https://github.com/NVIDIA/warp/blob/main/exts/omni.warp/omni/warp/nodes/_impl/OgnClothSimulate.py#L368

Cheers,
Miles