isl-org / isl-org/Open3D

io.read_triangle_mesh return non-empty TriangleMesh when read an empty file with .stl extensiuon

Open
#2,391 0 comments 0 reactions 1 assignee Claimed by @errissa View on GitHub
io
Dominant language
C++
Stars
14k
Forks
2.6k
Avg merge
5d 18h
Merged PRs (30d)
6

Description

**IMPORTANT: Please use the following template to report the bug.**
_____

**Describe the bug**
io.read_triangle_mesh return non-empty TriangleMesh when read an empty file with .stl extensiuon.
All the vertices are 0.0, and when I show it by `o3d.visualization.draw_geometries([mesh])`,
an exception with type of RuntimeError raised.

**To Reproduce**
Steps to reproduce the behavior:

1. create an emtpy file with stl extension: touch empty.stl
2. read created empty file by io.read_triangle_mesh:
```python
import numpy as np
import open3d.open3d as o3d

if __name__ == '__main__':
mesh = o3d.io.read_triangle_mesh('empty.stl')

assert isinstance(mesh, o3d.geometry.TriangleMesh)

print(np.asarray(mesh.vertices))
print(np.asarray(mesh.triangles))

```
3. See error

**Expected behavior**
an empty TriangleMesh should be returned, or an exception raised.

A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment (please complete the following information):**

- Operating system: Ubuntu 16.04
- Python version: Python 3.6
- Open3D version: 0.9.0.0
- Is this remote workstation?: no
- How did you install Open3D?: pip (pip install -i https://mirrors.aliyun.com/pypi/simple/ open3d==0.9.0.0)
- Compiler version (if built from source): NO

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.