Cannot create multiple scenes in parallel
- 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
I am running Open3D 0.15.2 in a fresh Python 3.8 conda environment. My goal is to do some computations in parallel using `o3d.t.geometry.RaycastingScene()`. Unfortunately, my code gets stuck when I run `o3d.t.geometry.TriangleMesh.from_legacy(mesh)`. Please find an example below. Converting the mesh to a `o3d.t.geometry.TriangleMesh` in the main-function and passing it to the parallelized function is not an option for me.
I am happy to hear about your insights.
### Steps to reproduce the bug
```python
import os
import open3d as o3d
from tqdm import tqdm
from tqdm.contrib.concurrent import process_map
def create_scene(path_to_mesh: str) -> None:
mesh = o3d.io.read_triangle_mesh(path_to_mesh)
mesh_t = o3d.t.geometry.TriangleMesh.from_legacy(mesh)
scene = o3d.t.geometry.RaycastingScene()
scene.add_triangles(mesh_t)
if __name__ == '__main__':
path_to_mesh = o3d.data.BunnyMesh().path
args = [path_to_mesh for _ in range(2)]
process_map(create_scene, args, max_workers=2, desc='Creating scenes')
# # for loop below succeeds
# for arg in tqdm(args, 'Creating scenes'):
# create_scene(arg)
```
### Open3D, Python and System information
```markdown
- Operating system: Ubuntu 20.04
- Python version: Python 3.8
- Open3D version: 0.15.2
- How did you install Open3D?: pip
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.