geom-edges
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

geom-edges

Computes unique edges for a list of faces.

Installation

npm install geom-edges

Usage

import computeEdges from "geom-edges";

const faces = [[0, 1, 2, 3], [3, 2, 5, 4], ...];
const edges = computeEdges(faces); // [[0, 1], [1, 2], ...]

API

computeEdges(faces): edges

Parameters

  • faces: TypedArray | Array | Array<[x, y, z]> – list of face indices new Array([a, b, c, d], [a, b, c, d], ...)

Note: if faces is a TypedArray (eg. new Uint32Array([a, b, c, a, b, c, ...]) or a flat array of positions (eg. new Array(a, b, c, a, b, c, ...)), we assumes faces are triangles.

Returns

  • edges: Array<[a, b]> – list of edges (new Array([a, b], [b, c], [c, d], ...))

License

MIT. See license file.

Package Sidebar

Install

npm i geom-edges

Weekly Downloads

0

Version

2.0.0

License

MIT

Unpacked Size

4.71 kB

Total Files

6

Last publish

Collaborators

  • vorg