
Research
Namastex.ai npm Packages Hit with TeamPCP-Style CanisterWorm Malware
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.
triangulate-polyline
Advanced tools
Triangulates a polygon with holes encoded as a list of loops.
var triangulate = require("triangulate-polyline")
var positions = [
[-2, -2],
[ 2, -2],
[ 2, 2],
[-2, 2],
[-1, -1],
[ 1, -1],
[ 1, 1],
[-1, 1]
]
var loops = [
[0, 1, 2, 3],
[4, 5, 6, 7]
]
console.log(triangulate(loops, positions))
Example output:
[ [ 3, 7, 2 ],
[ 3, 0, 7 ],
[ 0, 4, 7 ],
[ 4, 0, 1 ],
[ 5, 4, 1 ],
[ 6, 5, 1 ],
[ 6, 1, 2 ],
[ 7, 6, 2 ] ]
npm install triangulate-polyline
require("triangulate-polyline")(loops, positions)Triangulates a complex polygon
loops is a list of vertices of the polygon, where each vertex is represented as an index into positionspositions is a list of vertex positions encoded, each represented by a length 2 arrayReturns A list of triangles represented by triples of indices of position indices.
Note This library is built on top of poly2tri, which is not robust. Points which are close together or near the boundary of other loops may be incorrectly classified and could result in broken triangulations.
(c) 2014 Mikola Lysenko. MIT License
FAQs
Triangulates a complex polygon
The npm package triangulate-polyline receives a total of 17,256 weekly downloads. As such, triangulate-polyline popularity was classified as popular.
We found that triangulate-polyline 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.

Research
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.