AttributeError: 'open3d.open3d.geometry.VoxelGrid' object has no attribute 'ndim'
- Dominant language
- C++
- Stars
- 14k
- Forks
- 2.6k
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 6
Description
Hi, I am trying to convert mesh to voxel using VoxelGrid().
Code-
import open3d as o3d
import numpy as np
import matplotlib.pyplot as plt
input='obj_file_path'
mesh=o3d.io.read_triangle_mesh(input)
mesh.compute_vertex_normals()
print(mesh)
voxel=o3d.geometry.VoxelGrid.create_from_triangle_mesh(mesh,voxel_size=0.05)
print(voxel.has_voxels())
print(voxel)
fig = plt.figure()
ax = fig.gca(projection='3d')
ax.voxels(voxel)
ax.imshow(np.asarray(voxel),cmap='gray')
fig.savefig('save_voxel_to_visualize')
Output-
geometry::TriangleMesh with 49751 points and 100000 triangles.
True
geometry::VoxelGrid with 480 voxels.
AttributeError: 'open3d.open3d.geometry.VoxelGrid' object has no attribute 'ndim'
Is there any way to visualize and save the converted voxel in mat files??
Thanks!!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.