isl-org / isl-org/Open3D

App interactive with Visualizer

Open
#5,414 0 comments 0 reactions 0 assignees View on GitHub
bug
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).

### Describe the issue

Hi, I need to crop the point cloud in the App. Since VisualizerWithEditing working well, so I add a button in the App to create a VisualizerWithEditing. But after destroy_window, the whole app destroy with log:
[Open3D WARNING] GLFW Error: The GLFW library is not initialized
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

Do you have an idea or is this simply not possible yet?

thank for your work and looking forward to your response

Best regards

### Steps to reproduce the bug

```python
import open3d as o3d
import open3d.visualization.gui as gui
import open3d.visualization.rendering as rendering
import numpy as np

class CustomWindow(object):
def __init__(self):
self.window = gui.Application.instance.create_window("Reconstruct", 960, 720)

self.widget3d = gui.SceneWidget()
self.widget3d.scene = rendering.Open3DScene(self.window.renderer)
self.widget3d.scene.set_background([1, 1, 1, 1])

geometry_crop_btn = gui.Button("Crop")
geometry_crop_btn.set_on_clicked(self.geometry_crop_on_click)

em = self.window.theme.font_size
self.spacing = int(np.round(0.5 * em))
vspacing = int(np.round(0.5 * em))
self.margins = gui.Margins(vspacing)
self.panel = gui.Vert(self.spacing, self.margins)

self.panel.add_child(geometry_crop_btn)

self.window.add_child(self.panel)
self.window.add_child(self.widget3d)

self.window.set_on_layout(self._on_layout)

def geometry_crop_on_click(self):
vis = o3d.visualization.VisualizerWithEditing()
vis.create_window(width=960, height=720)
vis.run()
vis.destroy_window()

def _on_layout(self, layout_context):
em = layout_context.theme.font_size

panel_width = 15 * em
rect = self.window.content_rect

self.widget3d.frame = gui.Rect(rect.x, rect.y, rect.get_right() - panel_width, rect.height)
self.panel.frame = gui.Rect(self.widget3d.frame.get_right(), rect.y, panel_width, rect.height)

def main():
app = gui.Application.instance
app.initialize()

window = CustomWindow()

app.run()

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

### Error message

FEngine (64 bits) created at 0x7fce0001b010 (threading is enabled)
FEngine resolved backend: OpenGL
[Open3D WARNING] GLFW Error: The GLFW library is not initialized
[Open3D WARNING] GLFW Error: The GLFW library is not initialized

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

### Expected behavior

After destroy the VisualizerWithEditing, the app should be alive.

### Open3D, Python and System information

```markdown
- Operating system: Ubuntu 18.04
- Python version: Python 3.9.12
- Open3D version: 0.15.2+e705e648
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: build from source
- Compiler version (if built from source): gcc 7.5 / clang 7.0
```

### Additional information

_No response_

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.