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

PointCloud.points has no elements and read only #6755

Open
3 tasks done
szppaks opened this issue Apr 15, 2024 · 3 comments
Open
3 tasks done

PointCloud.points has no elements and read only #6755

szppaks opened this issue Apr 15, 2024 · 3 comments
Labels
bug Not a build issue, this is likely a bug.

Comments

@szppaks
Copy link

szppaks commented Apr 15, 2024

Checklist

Describe the issue

The points property is readonly, so I have created the point cloud passing a Vector3dVector(nparray) in the constructor. A point cloud has_points() gives True, te get_minimal_oriented_bounding_box() works well, but the points property stores an empty numpy array.

Steps to reproduce the bug

pcd
Out  [2]: PointCloud with 977 points.

pcd.points
Out  [3]: array([], shape=(0, 3), dtype=float64)

pcd.points=np.array([[1,3,3]])
*** AttributeError: 'open3d.cpu.pybind.geometry.PointCloud' object attribute 'points' is read-only

Error message

No response

Expected behavior

No response

Open3D, Python and System information

- Operating system:  Windows 11 64-bit
- Python version: 3.10.11
- Open3D version: 0.18.0
- System architecture: x86 pi
- Is this a remote workstation?: no
- How did you install Open3D?: pip 
- Compiler version (if built from source):

Additional information

No response

@szppaks szppaks added the bug Not a build issue, this is likely a bug. label Apr 15, 2024
@saurabheights
Copy link
Contributor

@szppaks - Use o3d.utility.Vector3dVector. For example:-

import open3d as o3d

pcd = o3d.geometry.PointCloud()
pcd.points=o3d.utility.Vector3dVector(np.array([[1,3,3]]))

See https://www.open3d.org/docs/release/tutorial/geometry/working_with_numpy.html

@szppaks
Copy link
Author

szppaks commented Apr 17, 2024

import open3d as o3d

pcd = o3d.geometry.PointCloud()
pcd.points=o3d.utility.Vector3dVector(np.array([[1,3,3]]))
Traceback (most recent call last):

File "C:\Users\b0898\AppData\Local\Temp\ipykernel_9748\1296022844.py", line 4, in <cell line: 4>
pcd.points=o3d.utility.Vector3dVector(np.array([[1,3,3]]))

AttributeError: 'open3d.cpu.pybind.geometry.PointCloud' object attribute 'points' is read-only

(I have tried Vector3dVector first, and then simple numpy array, but it does not work - nor set the points neither get the points.)

@saurabheights
Copy link
Contributor

@szppaks Just read again through your original message. This issue is definitely peculiar. Looks like some issue in python bindings not properly mapping points data from C++ to numpy array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not a build issue, this is likely a bug.
Projects
None yet
Development

No branches or pull requests

2 participants