Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dmnsgn/path-tangents
Compute tangents for a path of 3D points.
https://github.com/dmnsgn/path-tangents
Last synced: 3 months ago
JSON representation
Compute tangents for a path of 3D points.
- Host: GitHub
- URL: https://github.com/dmnsgn/path-tangents
- Owner: dmnsgn
- License: mit
- Created: 2018-09-12T14:45:08.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-03-15T09:54:51.000Z (8 months ago)
- Last Synced: 2024-04-24T15:18:49.497Z (7 months ago)
- Language: JavaScript
- Homepage: https://dmnsgn.github.io/path-tangents/
- Size: 373 KB
- Stars: 10
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# path-tangents
[![npm version](https://img.shields.io/npm/v/path-tangents)](https://www.npmjs.com/package/path-tangents)
[![stability-stable](https://img.shields.io/badge/stability-stable-green.svg)](https://www.npmjs.com/package/path-tangents)
[![npm minzipped size](https://img.shields.io/bundlephobia/minzip/path-tangents)](https://bundlephobia.com/package/path-tangents)
[![dependencies](https://img.shields.io/librariesio/release/npm/path-tangents)](https://github.com/dmnsgn/path-tangents/blob/main/package.json)
[![types](https://img.shields.io/npm/types/path-tangents)](https://github.com/microsoft/TypeScript)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-fa6673.svg)](https://conventionalcommits.org)
[![styled with prettier](https://img.shields.io/badge/styled_with-Prettier-f8bc45.svg?logo=prettier)](https://github.com/prettier/prettier)
[![linted with eslint](https://img.shields.io/badge/linted_with-ES_Lint-4B32C3.svg?logo=eslint)](https://github.com/eslint/eslint)
[![license](https://img.shields.io/github/license/dmnsgn/path-tangents)](https://github.com/dmnsgn/path-tangents/blob/main/LICENSE.md)Compute tangents for a path of 3D points.
[![paypal](https://img.shields.io/badge/donate-paypal-informational?logo=paypal)](https://paypal.me/dmnsgn)
[![coinbase](https://img.shields.io/badge/donate-coinbase-informational?logo=coinbase)](https://commerce.coinbase.com/checkout/56cbdf28-e323-48d8-9c98-7019e72c97f3)
[![twitter](https://img.shields.io/twitter/follow/dmnsgn?style=social)](https://twitter.com/dmnsgn)![](https://raw.githubusercontent.com/dmnsgn/path-tangents/main/screenshot.jpg)
## Installation
```bash
npm install path-tangents
```## Usage
```js
import pathTangents from "path-tangents";// const path = ...
const closed = true;
const tangents = pathTangents(path, closed);
```## API
## Functions
-
pathTangents(path, [closed]) ⇒TypedArray
|Array
|Array.<vec3>
-
Compute tangents for a path of 3D points.
## Typedefs
-
vec3 :Array.<number>
## pathTangents(path, [closed]) ⇒ TypedArray
\| Array
\| [Array.<vec3>
](#vec3)
Compute tangents for a path of 3D points.
**Kind**: global function
| Param | Type | Default | Description |
| -------- | ----------------------------------------------------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| path | TypedArray
\| Array
\| [Array.<vec3>
](#vec3) | | Simplicial complex geometry positions (eg. `new Float32Array([x, y, z, x, y, z, ...])/new Array(x, y, z, x, y, z, ...)` or `new Array([x, y, z], [x, y, z], ...)`) |
| [closed] | boolean
| false
| Specify if the path is closed. If so the last tangent will point to the first point. Otherwise it will follow the previous point. |
## vec3 : Array.<number>
**Kind**: global typedef
## License
MIT. See [license file](https://github.com/dmnsgn/path-tangents/blob/main/LICENSE.md).