isl-org / isl-org/Open3D

How to open a new window when clicking on a mesh in Open3D

Open
#6,823 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
C++
Stars
14k
Forks
2.6k
Avg merge
5d 18h
Merged PRs (30d)
6

Description

### Checklist

- [X] I have searched for [similar issues](https://github.com/isl-org/Open3D/issues).
- [X] For Python issues, I have tested with the [latest development wheel](https://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](https://www.open3d.org/docs/release/) and the [latest documentation](https://www.open3d.org/docs/latest/) (for `main` branch).

### My Question

Hi everyone, I would like to ask a question. So i have some mesh which I have created using the Visualizer, now how can I open a new window when I click on that mesh ? Because it seems that the examples talk about clicking on some Button and not in the Visualizer. Below I have attached some code. Thank you very much.

```
import numpy as np
import open3d as o3d

def main():
mesh = o3d.io.read_triangle_mesh(o3d.data.BunnyMesh().path)
pcd1 = mesh.sample_points_poisson_disk(10000)

visualizer = o3d.visualization.Visualizer()
visualizer.create_window()

visualizer.add_geometry(pcd1)

# mesh = convert_image_to_mesh(img)
# mesh.scale(scale=0.1, center=pcd1.get_center())
# visualizer.add_geometry(mesh)

# Show xyz axes
rendering_options = visualizer.get_render_option()
rendering_options.show_coordinate_frame = True
rendering_options.background_color = np.asarray([0.5, 0.5, 0.5])

mesh = o3d.geometry.TriangleMesh.create_sphere(radius=0.1)
mesh.scale(scale=0.3, center=mesh.get_center())

visualizer.add_geometry(mesh)

visualizer.run()

if __name__ == "__main__":
main()
```

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.