Skip to content

kmcs/polygon-selfintersect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

polygon-selfintersect

This script find all the self-intersections in a polygon.

Install

npm install polygon-selfintersect

Usage

var polygonSelfIntersect = require('polygon-selfintersect');
var myPolygon = [[1, 1], [1, 3], [3, 3], [3, 1], [0, 4], [1, 1]];

if (polygonSelfIntersect.findSelfIntersections(myPolygon)) {
  console.log("Found the following self intersection lines:");
  console.log(polygonSelfIntersect.getSelfIntersectionLines());
} else {
  console.log("No self intersection found.");
}

Licence

MIT

About

Detect if a polygon has self intersecting lines

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published