'Open 3D issues creating a 3D mesh

I am trying to create a 3D mesh in Open3D given a set of 3D points. My code is the following:

pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(points)
hull, _ = pcd.compute_convex_hull()
hull_ls = o3d.geometry.LineSet.create_from_triangle_mesh(hull)
hull_ls.paint_uniform_color((1, 0, 0))
o3d.visualization.draw_geometries([pcd, hull_ls])

The visualization I obtain is the following:

enter image description here

The main issue is that there are 2 points that are not connected correctly. See highlighted area.

What I am trying to obtain instead is something like this:

enter image description here

The second image was drawn using Open3D LineSet, since I have the points and order in which they need to be connected. The issue with the second visualization is that I am not able to export is a mesh file, since it is just a set of line. Any help is appreciated.



Solution 1:[1]

The expected mesh is not a convex hull. Therefore, compute_convex_hull will not produce the expected result anyways.

You should be able to export a LineSet using write_line_set and read using read_line_set.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dilara Gokay