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

How to appropriately use the tensor-based fill_holes function? #6026

Open
3 tasks done
Chonghyang opened this issue Mar 23, 2023 · 2 comments
Open
3 tasks done

How to appropriately use the tensor-based fill_holes function? #6026

Chonghyang opened this issue Mar 23, 2023 · 2 comments
Labels

Comments

@Chonghyang
Copy link

Chonghyang commented Mar 23, 2023

Checklist

My Question

I have an issue regarding the open3d.t.geometry.TriangleMesh.fill_holes method. I create a mesh from a pointcloud using BPA meshing. The mesh is then converted to a tensor based mesh using the from_legacy method. I can then use the fill_holes method and convert the mesh back to legacy format. My problem is that the code seems to be set up correctly and working, however, the fill_holes method does not do anything. Not a single faces is created. What can I do about this?

Below are pasted method of my own point cloud (and mesh) class and the output of print statements showing the properties of the pointcloud and mesh after each step.

Code:

def fill_holes(self):
    print("Filling gaps")
    start_time = time.time()
    self.t_mesh.fill_holes()
    self.mesh = self.t_mesh.to_legacy()
    end_time = time.time()
    print(f"Time taken to fill gaps: {end_time - start_time} seconds", "\n")

Print output:
Saving Point Cloud
Time taken to save Point Cloud: 24.954465866088867 seconds

Pcd test #1 PointCloud with 448604 points.

Generating mesh
Time taken to generate faces: 29.580508947372437 seconds

Mesh test #2 TriangleMesh with 448604 points and 578407 triangles.

Calculating vertex normals
Time taken to compute normals: 0.05205130577087402 seconds

Mesh test #3 TriangleMesh with 448604 points and 578407 triangles.

Saving Mesh
Time taken to save Mesh: 33.49604797363281 seconds

Creating t.mesh class from legacy o3d mesh
Time taken to fill gaps: 0.0444490909576416 seconds

Filling gaps
[Open3D WARNING] Ignoring attribute 'normals' for TensorMap with primary key 'indices'
Time taken to fill gaps: 9.302194118499756 seconds

T_Mesh test #1 TriangleMesh on CPU:0 [448604 vertices (Float32) and 578407 triangles (Int64)].
Vertex Attributes: normals (dtype = Float32, shape = {448604, 3}), colors (dtype = Float32, shape = {448604, 3}).
Triangle Attributes: normals (dtype = Float32, shape = {578407, 3}).

@YuMeiWangddup
Copy link

hello@Chonghyang ,Imeet the same problem like you .have you found the answer?

@demlow
Copy link

demlow commented Apr 7, 2023

The fill_holes documentation says it returns a new mesh with the holes filled. You're not assigning the result to anything.

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

No branches or pull requests

3 participants