# parse-stl

> STL (ASCII and binary) file parser

Latest version **1.0.2** (published 2015-04-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install parse-stl
pnpm add parse-stl
yarn add parse-stl
bun add parse-stl
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2015-04-07 |
| First published | 2015-04-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | thibauts |
| Maintainers | thibauts |
| Keywords | stl, format, mesh, buffer |

## Links

- npm: https://www.npmjs.com/package/parse-stl
- Repository: https://github.com/thibauts/parse-stl
- Issues: https://github.com/thibauts/parse-stl/issues
- npm.io page: https://npm.io/package/parse-stl

## Dependencies (2)

- [parse-stl-ascii](https://npm.io/package/parse-stl-ascii.md) ^1.0.2
- [parse-stl-binary](https://npm.io/package/parse-stl-binary.md) ^1.0.1

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2015-04-07
- 1.0.1 — 2015-04-07
- 1.0.0 — 2015-04-07

## README

parse-stl
=========
### STL (ASCII and binary) file parser

Parses an [STL](http://en.wikipedia.org/wiki/STL_%28file_format%29) (STereoLithography) ASCII or binary buffer to a mesh compatible with [simplicial-complex*](https://github.com/mikolalysenko/simplicial-complex). If you're looking for a streaming parser check [this](https://github.com/tmpvar/stl).

This module works well with [merge-vertices](https://github.com/thibauts/merge-vertices) to deduplicate identical vertices from different faces.

\* ASCII files having faces with more than 3 vertices will have to be triangulated for use with [simplicial-complex](https://github.com/mikolalysenko/simplicial-complex). One option is using [earcut](https://github.com/mapbox/earcut).

Install
-------

```bash
$ npm install parse-stl
```

Usage
-----

```javascript
var parseSTL = require('parse-stl');
var fs = require('fs');

var buf = fs.readFileSync('mesh.stl');
var mesh = parseSTL(buf);

console.log(mesh);
/*
{
  positions: [...],
  cells: [...],
  faceNormals: [...]
}
*/
```

---
_Source: https://npm.io/package/parse-stl · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
