isl-org / isl-org/Open3D

AttributeError: 'open3d.open3d.geometry.VoxelGrid' object has no attribute 'ndim'

Open
#1,851 0 comments 0 reactions 0 assignees View on GitHub
feature request geometry legacy (Open3D 0.x API) pybind voxelgrid
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.