# triangles-index

> index a set of triangles into a set of positions/pts and cells. merge vertices fast.

Latest version **0.0.42** (published 2022-11-03) · CC0-1.0 license · 0 weekly downloads

## Install

```sh
npm install triangles-index
pnpm add triangles-index
yarn add triangles-index
bun add triangles-index
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.42 |
| Published | 2022-11-03 |
| First published | 2022-01-28 |
| Weekly downloads | 0 |
| License | CC0-1.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | stonkpunk |
| Maintainers | stonkpunk |
| Keywords | triangle, mesh, index, merge |

## Links

- npm: https://www.npmjs.com/package/triangles-index
- Homepage: https://github.com/stonkpunk/my-npm-modules/tree/main/triangles-index
- npm.io page: https://npm.io/package/triangles-index

## Recent versions

- 0.0.42 (latest) — 2022-11-03
- 0.0.41 — 2022-11-03
- 0.0.4 — 2022-04-05
- 0.0.3 — 2022-02-06
- 0.0.2 — 2022-01-28
- 0.0.1 — 2022-01-28

## README

# triangles-index

index a set of triangles into a set of positions/pts and cells. merge vertices fast.

```javascript
//module.exports = {indexTriangles, deIndexTriangles};

//single triangle = [[x,y,z],[x,y,z],[x,y,z]]

//indexTriangles(triangles) => {cells: cells, pts: pts}
//deindexTriangles(indexResult) => array of triangles
//demergeMeshTriangles(indexResult) => {cells: cells, pts: pts} -- but no more shared vertices -- # cells == # triangles * 3 
```

add `_meshView` to the function names to get the same format as meshview and other libs use {cells, positions}

```javascript
//indexTriangles_meshView(triangles) => {cells: cells, positions: positions}
//deindexTriangles_meshView(indexResult) => array of triangles
//demergeMeshTriangles_meshView(indexResult) => {cells: cells, pts: pts} -- but no more shared vertices -- # cells == # triangles * 3 
```


[![stonks](https://i.imgur.com/UpDxbfe.png)](https://www.npmjs.com/~stonkpunk)

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