InsightSoftwareConsortium / InsightSoftwareConsortium/ITK-Wasm
Binary STL write
- Dominant language
- Python
- Stars
- 235
- Forks
- 61
- Avg merge
- 4d 19h
- Merged PRs (30d)
- 4
Description
The [writeMesh](https://insightsoftwareconsortium.github.io/ITK-Wasm/mesh-io/ts/docs/#/?id=writemesh) provides an option to create either binary or ASCII output. For the STL output, the default ASCII output functions (albeit slow and large files), while writing a [binary STL](https://en.wikipedia.org/wiki/STL_(file_format)#Binary) fails (creating just 12 bytes `solid ascii`):
```
from itkwasm_image_io import imread, imwrite
from itkwasm_mesh_io import meshread, meshwrite
mesh = meshread('brain.stl')
# n.b. output STL ASCII ~4 times larger than binary STL
meshwrite(mesh, 'brainSTLa.stl')
# only creates 12-byte header for binary STL output
meshwrite(mesh, 'brainSTL.stl', {'binary': True})
```
Contributor guide
Assessment
This issue has not been assessed yet.