JSPM

@rbxts/bezier

0.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q30664F
  • License MIT

Simple package to calculate points on bezier curves

Package Exports

  • @rbxts/bezier

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rbxts/bezier) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Bezier Curve

Easily calculate points on a bezier curve! Typescript 4+ due to Variadic Tuple Types.

Example

import BezierCurve from "@rbxts/bezier";

const curve = new BezierCurve([
    new Vector3(0, 0, 0),
    new Vector3(100, 0, 0),
    new Vector3(100, 0, 100),
    new Vector3(0, 0, 100),
]);

const base = new Instance("Part");
base.Size = new Vector3(100, 1, 100);
base.Position = new Vector3(50, -1, 50);
base.Parent = game.Workspace;

for (let i = 0; i <= 100; i++) {
    const part = new Instance("Part");
    part.Position = curve.calculate(i / 100);
    part.Size = new Vector3(1, 1, 1);
    part.BrickColor = new BrickColor("Really red");
    part.Parent = game.Workspace;
}