isl-org / isl-org/Open3D

adding lines to scene

Open
#6,074 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](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `master` branch).

### My Question

Hi,

I am trying to use the [vis.py ](http://www.open3d.org/docs/latest/python_example/visualization/index.html#vis-gui-py) and the [mouse_and_point_coord.py](http://www.open3d.org/docs/latest/python_example/visualization/index.html#mouse-and-point-coord-py). The goal is to draw lines in the scene, this is what I am doing.

1 - Add the _on_mouse_widget3d function to self._scene
2 - Create a list self._points when the one point cloud is selected
3 - Create the lines :
```
lines = o3d.geometry.LineSet()
pts = [list(i) for i in self._points]
lines.colors = o3d.utility.Vector3dVector([[0.0, 0.0, 0.0]])

lines.points = o3d.utility.Vector3dVector(pts)
lines.lines = o3d.utility.Vector2iVector(line_indices)

mat = o3d.visualization.rendering.MaterialRecord()
mat.shader = "defaultUnlit"
mat.line_width = 10 # note that this is scaled with respect to pixels,
```

I would like to do a gui similar to VisualizerWithEditing like when you press Ctrl+mouse_press you visualize lines of a region you want to crop. I do not want to use o3dvis.
Do you think this is possible or I should try another approach ?

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.