Skip to content

Instantly share code, notes, and snippets.

@borismus
Created February 13, 2021 00:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save borismus/abd5d5240618fb842adacbefcbcaddf8 to your computer and use it in GitHub Desktop.
Save borismus/abd5d5240618fb842adacbefcbcaddf8 to your computer and use it in GitHub Desktop.
function getBoundingBox(folded) {
const points = folded.vertices_coords.map(p => [p[0], p[1]]);
const boundary = ear.polygon(points);
return boundary.enclosingRectangle();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment