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: deduplicate_mesh_vertices produces degenerate faces #94

Open
nvibd opened this issue Jul 16, 2024 · 1 comment
Open

Bug: deduplicate_mesh_vertices produces degenerate faces #94

nvibd opened this issue Jul 16, 2024 · 1 comment

Comments

@nvibd
Copy link

nvibd commented Jul 16, 2024

Using deduplicate_mesh_vertices on a triangular mesh leads to sporadic degenerate faces.

I have some mesh vertex and face data, v and f, which I clean using deduplicate_mesh_vertices.
I validate that the faces are non-degenerate by asserting that a face does not contain a vertex multiple times.

This code illustrates the test:

import numpy as np
import point_cloud_utils as pcu

# v and f are produced from Poisson reconstruction
v = np.load("...")
f = np.load("...")

def validate_faces(faces):
    for face in faces:
        assert len(set(list(face))) == len(list(face))

validate_faces(f) # Passes without issues

v_clean, f_clean, _, _ = pcu.deduplicate_mesh_vertices(v, f, 1e-7)

validate_faces(f_clean) # Assertion error

I have dumped the data before and after the deduplication, which should allow you to reproduce the issue.
Here's the data, four files zipped: https://drive.google.com/file/d/1e_vJRHqNEyB4eGFnLj1J3EfYtqtw-5XB/view?usp=sharing

I am using PCU version 0.30.4, which is the latest version as of creation of this bug report.

@nvibd
Copy link
Author

nvibd commented Jul 18, 2024

I have tried building my own version of PCU with an updated version (v2.5.0 of the IGL library. However, it did not resolve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant