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
Using
deduplicate_mesh_vertices
on a triangular mesh leads to sporadic degenerate faces.I have some mesh vertex and face data,
v
andf
, which I clean usingdeduplicate_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:
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.