Compute Frenet-Serret frames for a path of 3D points and tangents.

npm install frenet-serret-frames
import frenetSerretFrames from "frenet-serret-frames";
import pathTangents from "path-tangents";
const isClosed = true;
const tangents = pathTangents(path, isClosed);
const frames = frenetSerretFrames(path, tangents, {
closed: isClosed,
initialNormal: [0, 1, 0],
});
Array.<Frame>Compute Frenet-Serret frames for a path of 3D points and tangents
Array.<number>ObjectOptions for frames computation. All optional.
ObjectArray.<Frame>Compute Frenet-Serret frames for a path of 3D points and tangents
Kind: global function
See: Frenet–Serret formulas
| Param | Type | Default | Description |
|---|---|---|---|
| points | Array.<vec3> |
Array of 3D points [x, y, z]. | |
| tangents | Array.<vec3> |
Array of 3D points [x, y, z] corresponding to the tangents of the path. | |
| [options] | Options |
{} |
Array.<number>ObjectOptions for frames computation. All optional.
Kind: global typedef
Properties
| Name | Type | Default | Description |
|---|---|---|---|
| [closed] | boolean |
false |
Specify is the path is closed. |
| [initialNormal] | vec3 |
|
Specify a starting normal for the frames. Default to the direction of the minimum tangent component. |
ObjectKind: global typedef
Properties
| Name | Type |
|---|---|
| position | vec3 |
| normal | vec3 |
| binormal | vec3 |
| tangent | vec3 |
MIT. See license file.