I have a 3-D point cloud file with 1 million points that I need to convert into a mesh file in trimesh. The ultimate goal here is to take a point cloud and determine if that point cloud is convex or concave (trimesh allows me to do that once i convert the cloud into a mesh). I'm open to other libraries to solve this.
I've tried Delaunay triangulation using scipy, I just can't seem to convert my pointcloud into the right format so that it can be read by trimesh.
import open3d as o3d
import numpy as np
import trimesh
from scipy.spatial import Delaunay
pointcloud = o3d.io.read_triangle_mesh("pointcloud.ply")
points = np.array(pointcloud.points)
triangle_mesh = Delaunay(points)
# How do i include triangle_mesh from Delaunay triangulation into processing the mesh file?
mesh = trimesh.load("pointcloud.ply")
print(trimesh.convex.is_convex(mesh))
Error
geometry::TriangleMesh appears to be a geometry::PointCloud (only contains vertices, but no triangles).
geometry::TriangleMesh with 1390073 points and 0 triangles.
expected = (faces.shape[0], faces.shape[1] * 2)
AttributeError: 'NoneType' object has no attribute 'shape'