
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Package provides javascript implementation of algorithms that generate various types of splines from a set of control way points
npm install js-spline
The sample code below create a b-spline curve which create 9700 nodes (i.e., interpolated points) from 100 way points
var jsspline = require("js-spline");
var curve = new jsspline.BSpline({
steps: 100 // number of interpolated points between 4 way points
});
for(var i = 0; i < 100; ++i) {
curve.addWayPoint({ x: i, y: Math.sin(Math.PI * i * 0.2), z: 0.0});
}
console.log("nodes: " + curve.nodes.length); // 9700 interpolated points
// first node
curve.nodes[0].x;
curve.nodes[0].y;
curve.nodes[0].z;
// second node
curve.nodes[1].x;
curve.nodes[1].y;
curve.nodes[1].z;
// distance from the first node
curve.distances[1]
// third node
curve.nodes[2].x;
curve.nodes[2].y;
curve.nodes[2].z;
// distance from the first node
curve.distances[2]
The sample code below create a Bezier curve which create 4900 nodes (i.e., interpolated points) from 100 way points
var jsspline = require("js-spline");
var curve = new jsspline.Bezier({
steps: 100 // number of interpolated points between 4 way points
});
for(var i = 0; i < 100; ++i) {
curve.addWayPoint({ x: i, y: Math.sin(Math.PI * i * 0.2), z: 0.0});
}
console.log("nodes: " + curve.nodes.length); // 4900 interpolated points
// first node
curve.nodes[0].x;
curve.nodes[0].y;
curve.nodes[0].z;
// second node
curve.nodes[1].x;
curve.nodes[1].y;
curve.nodes[1].z;
// distance from the first node
curve.distances[1]
// third node
curve.nodes[2].x;
curve.nodes[2].y;
curve.nodes[2].z;
// distance from the first node
curve.distances[2]
Please refers to the example.html for how to use the splines in the HTML page.
FAQs
Package implements various statistics and distribution function
The npm package js-spline receives a total of 1 weekly downloads. As such, js-spline popularity was classified as not popular.
We found that js-spline demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.