InsightSoftwareConsortium / InsightSoftwareConsortium/ITK-Wasm

Binary STL write

Open
#1,244 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.