MCPcopy Create free account
hub / github.com/Code-Bullet/Jump-King / getContours

Function getContours

libraries/p5.js:4521–4535  ·  view source on GitHub ↗
(points)

Source from the content-addressed store, hash-verified

4519}
4520
4521function getContours(points) {
4522 var contours = [];
4523 var currentContour = [];
4524 for (var i = 0; i < points.length; i += 1) {
4525 var pt = points[i];
4526 currentContour.push(pt);
4527 if (pt.lastPointOfContour) {
4528 contours.push(currentContour);
4529 currentContour = [];
4530 }
4531 }
4532
4533 check.argument(currentContour.length === 0, 'There are still points left in the current contour.');
4534 return contours;
4535}
4536
4537// Convert the TrueType glyph outline to a Path.
4538function getPath(points) {

Callers 1

getPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected