Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type error in TriangleMesh::create_from_point_cloud_alpha_shape #1621

Closed
FedeMiorelli opened this issue Mar 16, 2020 · 4 comments
Closed

Type error in TriangleMesh::create_from_point_cloud_alpha_shape #1621

FedeMiorelli opened this issue Mar 16, 2020 · 4 comments

Comments

@FedeMiorelli
Copy link

I am not able to use the function create_from_point_cloud_alpha_shape due to type errors.

Below is a simple code to reproduce, and the error displayed.


import open3d as o3d
import numpy as np

pc = o3d.geometry.PointCloud()
pc.points = o3d.utility.Vector3dVector(np.random.randn(100,3))
T_recon = o3d.geometry.TriangleMesh()

alpha = 1.0
T_recon.create_from_point_cloud_alpha_shape(pc, alpha)
Traceback (most recent call last):
  File "C:\Temp\test_open3d.py", line 16, in <module>
    T_recon.create_from_point_cloud_alpha_shape(pc, alpha)
TypeError: create_from_point_cloud_alpha_shape(): incompatible function arguments. The following argument types are supported:
    1. (pcd: open3d.open3d.geometry.PointCloud, alpha: float, tetra_mesh: open3d::geometry::TetraMesh, pt_map: List[int]) -> open3d.open3d.geometry.TriangleMesh

Invoked with: geometry::PointCloud with 100 points., 1.0

Open3d v0.9.0, Windows 10 64 bit, Python 3.7.6.0
Wheel installed from https://www.lfd.uci.edu/~gohlke/pythonlibs/

@griegler
Copy link
Contributor

Addressed in #1624.

@FedeMiorelli
Copy link
Author

@griegler Thank you!

Is there a workaround I could use from Python until this is released and packages are updated?
Like creating instances of the two additional parameters in the same way they would be specified inside C++ if they were not passed.

@griegler
Copy link
Contributor

You could use something like:

tetra_mesh, pt_map = o3d.geometry.TetraMesh.create_from_point_cloud(pcd)
mesh = o3d.geometry.TriangleMesh.create_from_point_cloud_alpha_shape(pcd, alpha, tetra_mesh, pt_map)

@FedeMiorelli
Copy link
Author

That works, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants