Skip to content

[BUG] The add_cloth_mesh adds a non-existing spring which makes the XPBD integrator explode #621

@ManosAgelidis

Description

@ManosAgelidis

Bug Description

When loading an external mesh as a cloth mesh and passing the add_springs = True parameters to the add_cloth_mesh function a non-existing spring between vertices and 0,0,0 seems to be added. To reproduce you can try the following example where I have modified the example_cloth.py example to use the XPBD integrator and to load a cloth mesh rather than create a cloth grid. The behaviour can be seen in the video, sorry for the low resolution, github didn't allow me to load the full video.

Image

The problem seems to be coming from these lines in the add_cloth_mesh function in model.py
`# skip constraints open edges
if e.f0 != -1 and e.f1 != -1:
spring_indices.add((min(e.o0, e.o1), max(e.o0, e.o1)))
spring_indices.add((min(e.o0, e.v0), max(e.o0, e.v0)))
spring_indices.add((min(e.o0, e.v1), max(e.o0, e.v1)))

            spring_indices.add((min(e.o1, e.v0), max(e.o1, e.v0)))
            spring_indices.add((min(e.o1, e.v1), max(e.o1, e.v1)))

            spring_indices.add((min(e.v0, e.v1), max(e.v0, e.v1)))` 

System Information

Warp version : '1.7.0'
Python version: 3.12.8
OS: Windows 11

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions