🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

earcut

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

earcut - npm Package Compare versions

Comparing version

to
1.0.6

.npmignore

8

package.json
{
"name": "earcut",
"version": "1.0.5",
"version": "1.0.6",
"description": "The fastest and smallest JavaScript polygon triangulation library for your WebGL apps",
"main": "src/earcut.js",
"scripts": {
"test": "jshint src",
"test": "jshint src test/test.js && tape test/test.js",
"watch": "watchify -v -d src/earcut.js -s earcut -o dist/earcut.dev.js",

@@ -18,2 +18,3 @@ "build-dev": "mkdirp dist && browserify -d src/earcut.js -s earcut > dist/earcut.dev.js",

"mkdirp": "^0.5.0",
"tape": "^3.4.0",
"uglifyjs": "^2.3.6",

@@ -25,4 +26,5 @@ "watchify": "^2.2.1"

"unused": true,
"undef": true
"undef": true,
"eqeqeq": true
}
}

@@ -22,6 +22,6 @@ ## Earcut

------------------| ---- | --------- | -------- | -------- | ---------
OSM building | 15 | _572,982_ | _28,124_ | _28,131_ | _210,320_
dude shape | 94 | _22,238_ | _5,904_ | _3,544_ | _12,916_
holed dude shape | 104 | _9,752_ | _5,204_ | _3,205_ | _2,232_
complex OSM water | 2523 | _29.17_ | _64.73_ | failure | failure
OSM building | 15 | _600,314_ | _28,124_ | _28,131_ | _210,320_
dude shape | 94 | _28,226_ | _5,904_ | _3,544_ | _12,916_
holed dude shape | 104 | _10,674_ | _5,204_ | _3,205_ | _2,232_
complex OSM water | 2523 | _35.95_ | _64.73_ | failure | failure

@@ -32,3 +32,3 @@ Earcut may be slow for huge complex shapes,

If you want a library that is always guaranteed to produce correct triangulation even on very bad data,
If you want a library that is more likely to produce correct triangulation even on very bad data,
[libtess.js](https://github.com/brendankenny/libtess.js) is certainly the best choice.

@@ -63,2 +63,8 @@

Running tests:
```bash
npm test
```
![](https://cloud.githubusercontent.com/assets/25395/5778431/e8ec0c10-9da3-11e4-8d4e-a2ced6a7d2b7.png)

@@ -122,12 +122,9 @@ 'use strict';

s = cay * px + acx * py - acd;
if (s < 0) continue;
t = aby * px + bax * py + abd;
if (t < 0) continue;
k = A - s - t;
if (k < 0) continue;
if (s > 0 && t > 0 && k > 0) return false;
if (t === 0 && s && k && (a[0] === b[0] || a[1] === b[1])) return false;
if (k === 0 && s && t && (b[0] === c[0] || b[1] === c[1])) return false;
if (s === 0 && t && k && (a[0] === c[0] || a[1] === c[1])) return false;
if (s >= 0) {
t = aby * px + bax * py + abd;
if (t >= 0) {
k = A - s - t;
if ((k >= 0) && ((s && t) || (s && k) || (t && k))) return false;
}
}
}

@@ -134,0 +131,0 @@ return true;