npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

frenet-serret-frames

v4.0.0

Published

Compute rotation minimizing (Bishop) or Frenet-Serret frames for a path of 3D positions.

Readme

frenet-serret-frames

npm version stability-stable npm minzipped size dependencies types Conventional Commits styled with prettier linted with eslint license

Compute rotation minimizing (Bishop) or Frenet-Serret frames for a path of 3D positions.

paypal coinbase twitter

frenet-serret-frames screenshot

Installation

npm install frenet-serret-frames

Features

  • Bishop frames (default): rotation minimizing frames, also known as parallel transport frames, computed with the double reflection method. Minimal twist around the path, suited for sweeping tubes and ribbons.
  • Frenet frames: normal pointing towards the centre of curvature. Flips at inflection points; straight parts take the nearest frame.
  • Seamless closed paths: the mismatch at the seam is spread along the arc length.
  • Constraints: initialNormal, finalNormal on open paths, and an additional twist spread along the arc length.
  • Any layout: flat or nested positions, normals and binormals out in the same layout, written into provided arrays.
  • Robust: duplicated points, straight lines and reversed tangents handled without flips.

Usage

import frenetSerretFrames from "frenet-serret-frames";
import { squirclePath } from "primitive-geometry";

const geometry = squirclePath();
frenetSerretFrames(geometry, {
  closed: false,
  mode: "bishop",
  initialNormal: null,
  finalNormal: null,
  twist: 0,
});
console.log(geometry);
// {
//   positions: Float32Array [x, y, z, x, y, z, ...],
//   cells: [[a, b, c, ...]],
//   tangents: Float32Array [x, y, z, x, y, z, ...],
//   normals: Float32Array [x, y, z, x, y, z, ...],
//   binormals: Float32Array [x, y, z, x, y, z, ...],
// }

API

Functions

Typedefs

frenetSerretFrames(geometry, [options]) ⇒ SimplicialComplexWithTNB

Compute rotation minimizing (Bishop) or Frenet-Serret frames for a path of 3D positions.

Kind: global function See

| Param | Type | Default | | --------- | ---------------------------------------------------- | --------------- | | geometry | SimplicialComplex | | | [options] | Options | {} |

SimplicialComplex : object

Geometry definition.

Kind: global typedef Properties

| Name | Type | | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | positions | module:pex-math~TypedArray | Array.<number> | Array.<module:pex-math~Vec3> | | [tangents] | module:pex-math~TypedArray | Array.<number> | Array.<module:pex-math~Vec3> | | [normals] | module:pex-math~TypedArray | Array.<number> | Array.<module:pex-math~Vec3> | | [binormals] | module:pex-math~TypedArray | Array.<number> | Array.<module:pex-math~Vec3> | | [uvs] | module:pex-math~TypedArray | Array.<number> | Array.<module:pex-math~Vec2> | | [cells] | Uint8Array | Uint16Array | Uint32Array | Array | Array.<module:pex-math~Vec3> |

SimplicialComplexWithTNB : object

Geometry definition augmented with tangents, normals and binormals.

Kind: global typedef Properties

| Name | Type | | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | positions | module:pex-math~TypedArray | Array.<number> | Array.<module:pex-math~Vec3> | | tangents | module:pex-math~TypedArray | Array.<number> | Array.<module:pex-math~Vec3> | | normals | module:pex-math~TypedArray | Array.<number> | Array.<module:pex-math~Vec3> | | binormals | module:pex-math~TypedArray | Array.<number> | Array.<module:pex-math~Vec3> | | [uvs] | module:pex-math~TypedArray | Array.<number> | Array.<module:pex-math~Vec2> | | [cells] | Uint8Array | Uint16Array | Uint32Array | Array | Array.<module:pex-math~Vec3> |

Options : object

Options for frames computation. All optional.

Kind: global typedef Properties

| Name | Type | Default | Description | | --------------- | ------------------------------------------------------------------ | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | [closed] | boolean | false | Specify if the path is closed. | | [mode] | "bishop" | "frenet" | "bishop" | Frame type: - "bishop": rotation minimizing (parallel transport) frames, computed with the double reflection method. Twist free, suited for sweeping. - "frenet": normal pointing towards the curvature centre. Flips at inflection points and is undefined on straight parts, where the nearest frame is transported instead. | | [initialNormal] | module:pex-math~Vec3 | | Specify a starting normal for "bishop" frames, made orthogonal to the first tangent. Defaults to a coordinate axis not aligned with the first tangent, also used when the initial normal is parallel to it. | | [finalNormal] | module:pex-math~Vec3 | | Specify an ending normal for "bishop" frames of open paths, made orthogonal to the last tangent. Reached with the smallest rotation, spread along the arc length. Ignored when parallel to the last tangent. | | [twist] | number | 0 | Additional rotation of "bishop" frames around the tangent, in radians, spread along the arc length from the first frame to the last. Closed paths and paths with a final normal need a multiple of 2π to keep their end frame, or of π when the sign of the normal doesn't matter (eg. flat ribbons). |

License

MIT. See license file.