Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thibauts/serialize-stl-binary
STL binary serialization
https://github.com/thibauts/serialize-stl-binary
Last synced: 21 days ago
JSON representation
STL binary serialization
- Host: GitHub
- URL: https://github.com/thibauts/serialize-stl-binary
- Owner: thibauts
- License: mit
- Created: 2015-04-08T20:32:17.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-04-08T21:07:36.000Z (over 9 years ago)
- Last Synced: 2024-11-17T06:20:08.998Z (about 1 month ago)
- Language: JavaScript
- Size: 113 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
serialize-stl-binary
====================
### STL binary serializationProduces a [STL](http://en.wikipedia.org/wiki/STL_%28file_format%29) (STereoLithography) binary buffer from a mesh. Face normals are computed internally if not provided.
Install
-------```bash
$ npm install serialize-stl-binary
```Usage
-----```javascript
var serializeSTL = require('serialize-stl-binary');
var fs = require('fs');var mesh = {
positions: [
[-1.0, 0.0, 0.0],
[ 0.0, 1.0, 0.0],
[ 1.0, 0.0, 0.0]
],
cells: [
[0, 1, 2]
]
};var buf = serializeSTL(mesh.cells, mesh.positions/*, faceNormals*/);
fs.writeFileSync('mesh.stl', buf);
```