Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
points-on-path
Advanced tools
Readme
This package calculate the points on a SVG Path with a certain tolerance. It can also simplify the shape to use fewer points. This can really usefule when estimating lines/polygons for paths in WebGL or for Hit/Cosllision detections.
This package essentially combines packages path-data-parser and points-on-curve
From npm
npm install --save points-on-path
The package is distributed as an ES6 module.
Pass in a SVG path string and get back a PathPoints
object. A PathPoints
gives you a list of points (each being a an array of 2 numbers [x, y]
), and a flag telling you if the path is actually composed of multiple disconnected paths.
PathPoints {
points: Point[];
continuous: boolean;
}
Take this path for example:
and estimate the points on the path
import { pointsOnPath } from 'points-on-path';
const points = pointsOnPath('M240,100c50,0,0,125,50,100s0,-125,50,-150s175,50,50,100s-175,50,-300,0s0,-125,50,-100s0,125,50,150s0,-100,50,-100');
// plotPoints(points);
The method also accepts two optional values tolerance
and distance
. These are described by points-on-curve; to estimate more tolerant and fewer points.
FAQs
Estimate points on a SVG path
The npm package points-on-path receives a total of 10,739 weekly downloads. As such, points-on-path popularity was classified as popular.
We found that points-on-path 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.