Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Typo in warp.sim.model.ModelBuilder.add_cloth_mesh bending constraints (edge) initialization? #319

Closed
OhLeMatt opened this issue Sep 30, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@OhLeMatt
Copy link

Bug Description

Hello warp community,

I noticed that the initialization of cloth bending constraints for arbitrary cloth-mesh presents what is mostlikely a typo in the call of add_edges(...).
The fourth argument is currently:

edgeinds[:, 0],

Whereas it should probably be (to reflect the same functionning as in add_cloth_grid):

            edgeinds[:, 3],

For some more context, this is the current code:

        adj = wp.utils.MeshAdjacency(self.tri_indices[start_tri:end_tri], end_tri - start_tri)

        edgeinds = np.fromiter(
            (x for e in adj.edges.values() for x in (e.o0, e.o1, e.v0, e.v1)),
            int,
        ).reshape(-1, 4)
        self.add_edges(
            edgeinds[:, 0],
            edgeinds[:, 1],
            edgeinds[:, 2],
            edgeinds[:, 0],
            edge_ke=[edge_ke] * len(edgeinds),
            edge_kd=[edge_kd] * len(edgeinds),
        )

I hope this issue was not already raised, I looked and found nothing yet.
Thank you for your time and awesome lib!

System Information

No response

@OhLeMatt OhLeMatt added the bug Something isn't working label Sep 30, 2024
@AnkaChan
Copy link
Contributor

I just submitted a fixing MR.

shi-eric added a commit that referenced this issue Sep 30, 2024
Fix wrong vertex index passed to `add_edges()` called from `ModelBuilder.add_cloth_mesh()`

Closes GH-319

See merge request omniverse/warp!764
@shi-eric
Copy link
Contributor

Fix is merged in main and will be in the next Warp release, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants