Reputation: 794
I am working with open3d for python3 on windows. It was installed through pip via 'pip install open3d-python'
. I've checked documentation and everything seems right with my script, which attempts to convert a point cloud file (.ply) to a mesh (.stl). However, on execution I get an attribute error: 'open3d.open3d.geometry.PointCloud' has no attribute 'estimate_normals'
. Any help would be appreciated.
Thank you
Here is my script
import open3d as o3d
import trimesh
import numpy as np
pcd = o3d.io.read_point_cloud("pointcloud.ply")
pcd.estimate_normals()
#pcd = pcd2.normals
# estimate radius for rolling ball
distances = pcd.compute_nearest_neighbor_distance()
avg_dist = np.mean(distances)
radius = 1.5 * avg_dist
mesh = o3d.geometry.TriangleMesh.create_from_point_cloud_ball_pivoting(pcd,o3d.utility.DoubleVector([radius, radius * 2]))
trimesh = trimesh.Trimesh(np.asarray(mesh.vertices), np.asarray(mesh.triangles),vertex_normals=np.asarray(mesh.vertex_normals))
trimesh.export('stuff.stl')
I read somewhere that compiling the original package from source would do the trick, but I'm a mac user, and am trying to do this on Windows, so I can't figure out how to do that. here is the github link for the package https://github.com/intel-isl/Open3D
Upvotes: 4
Views: 12223
Reputation: 363
This works for me:
open3d
and open3d-python
:pip uninstall open3d open3d-python
open3d 0.8
:pip install open3d==0.8.0.0
pcd.estimate_normals(search_param=o3d.geometry.KDTreeSearchParamHybrid(radius=0.1, max_nn=30))
n
when the display window opens up to view the normals:o3d.visualization.draw_geometries([pcd])
Upvotes: 0
Reputation: 81
I got the same problem and found that the issue happened because of the wrong version of open3d which was installed via pip install open3d-python
. For me it was v0.6.0
.
The documentation is based on the new releases. Starting with version v0.8.0
open3d should be installed as pip install open3d
or conda install -c open3d-admin open3d
for conda. Found that information in releases. It solved the problem on my mac.
Upvotes: 3