https://github.com/dmnsgn/path-tangents
Compute tangents for a path of 3D points.
https://github.com/dmnsgn/path-tangents
Last synced: 2 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 (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2024-07-07T14:37:42.000Z (12 months ago)
- Last Synced: 2025-04-20T22:32:52.618Z (2 months ago)
- Language: JavaScript
- Homepage: https://dmnsgn.github.io/path-tangents/
- Size: 425 KB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# path-tangents
[](https://www.npmjs.com/package/path-tangents)
[](https://www.npmjs.com/package/path-tangents)
[](https://bundlephobia.com/package/path-tangents)
[](https://github.com/dmnsgn/path-tangents/blob/main/package.json)
[](https://github.com/microsoft/TypeScript)
[](https://conventionalcommits.org)
[](https://github.com/prettier/prettier)
[](https://github.com/eslint/eslint)
[](https://github.com/dmnsgn/path-tangents/blob/main/LICENSE.md)Compute tangents for a path of 3D points.
[](https://paypal.me/dmnsgn)
[](https://commerce.coinbase.com/checkout/56cbdf28-e323-48d8-9c98-7019e72c97f3)
[](https://twitter.com/dmnsgn)
## 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).