triangulate-polyline
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "triangulate-polyline", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Triangulates a complex polygon", | ||
@@ -5,0 +5,0 @@ "main": "tripolyline.js", |
@@ -14,2 +14,11 @@ "use strict" | ||
function tryTriangulation(ctx) { | ||
try { | ||
ctx.triangulate() | ||
} catch(e) { | ||
return false | ||
} | ||
return true | ||
} | ||
function triangulatePolyline(loops, positions) { | ||
@@ -54,3 +63,5 @@ //Converts a loop into poly2tri format | ||
//Triangulate | ||
ctx.triangulate() | ||
if(!tryTriangulation(ctx)) { | ||
return [] | ||
} | ||
var triangles = ctx.getTriangles() | ||
@@ -57,0 +68,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5065
81