Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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 2.0.2 to 2.0.3

test/fixtures/issue34.json

15

package.json
{
"name": "earcut",
"version": "2.0.2",
"version": "2.0.3",
"description": "The fastest and smallest JavaScript polygon triangulation library for your WebGL apps",

@@ -8,3 +8,3 @@ "main": "src/earcut.js",

"test": "eslint src test/test.js && tape test/test.js",
"watch": "watchify -v -d src/earcut.js -s earcut -o dist/earcut.dev.js",
"watch": "mkdirp dist && watchify -v -d src/earcut.js -s earcut -o dist/earcut.dev.js",
"build-dev": "mkdirp dist && browserify -d src/earcut.js -s earcut > dist/earcut.dev.js",

@@ -18,10 +18,15 @@ "build-min": "mkdirp dist && browserify src/earcut.js -s earcut | uglifyjs -c warnings=false -m > dist/earcut.min.js",

"devDependencies": {
"browserify": "^10.1.3",
"browserify": "^11.2.0",
"coveralls": "^2.11.2",
"eslint": "^0.21.0",
"eslint": "^1.6.0",
"eslint-config-mourner": "^1.0.1",
"istanbul": "^0.3.13",
"mkdirp": "^0.5.0",
"tape": "^4.0.0",
"uglify-js": "^2.4.21"
"uglify-js": "^2.4.21",
"watchify": "^3.4.0"
},
"eslintConfig": {
"extends": "mourner"
},
"repository": {

@@ -28,0 +33,0 @@ "type": "git",

@@ -102,2 +102,7 @@ ## Earcut

##### 2.0.3 (Oct 8, 2015)
- Fixed yet another rare race conditions (multiple holes connected with colinear bridges).
- Fixed crash on empty input.
##### 2.0.2 (Jul 8, 2015)

@@ -104,0 +109,0 @@

@@ -66,2 +66,3 @@ 'use strict';

function filterPoints(data, start, end) {
if (!start) return start;
if (!end) end = start;

@@ -416,3 +417,4 @@

tan = Math.abs(py - my) / amx; // tangential
if (tan < tanMin && locallyInside(data, node, holeNode)) {
if ((tan < tanMin || (tan === tanMin && mx > bx)) &&
locallyInside(data, node, holeNode)) {
mNode = node;

@@ -599,4 +601,4 @@ tanMin = tan;

if (((data[p1 + 1] > py) !== (data[p2 + 1] > py)) &&
(px < (data[p2] - data[p1]) * (py - data[p1 + 1]) / (data[p2 + 1] - data[p1 + 1]) + data[p1]))
inside = !inside;
(px < (data[p2] - data[p1]) * (py - data[p1 + 1]) / (data[p2 + 1] - data[p1 + 1]) + data[p1]))
inside = !inside;

@@ -603,0 +605,0 @@ node = node.next;

[
[[143.129527283745121, 61.240160826593640, 12.157953862848911],
[147.399527283763751, 74.780160826630892, 12.157953862848911],
[154.049527283757931, 90.260160827077932, 12.157953862848911],
[174.429527283762581, 81.710160826332872, 12.157953862848911],
[168.03952728374861, 67.040160826407372, 12.157953862848911],
[159.099527283746281, 53.590160826221112, 12.157953862848911]],
[[156.85952728375561, 67.430160827003422, 12.157953862848911],
[157.489527283760251, 67.160160826519132, 12.157953862848911],
[159.969527283741631, 68.350160826928912, 12.157953862848911],
[161.339527283766071, 67.640160826966172, 12.157953862848911],
[159.649527283763751, 63.310160826891662, 12.157953862848911],
[155.759527283749781, 64.880160826258362, 12.157953862848911]]
[[143.129527283745121, 61.240160826593640],
[147.399527283763751, 74.780160826630892],
[154.049527283757931, 90.260160827077932],
[174.429527283762581, 81.710160826332872],
[168.03952728374861, 67.040160826407372],
[159.099527283746281, 53.590160826221112]],
[[156.85952728375561, 67.430160827003422],
[157.489527283760251, 67.160160826519132],
[159.969527283741631, 68.350160826928912],
[161.339527283766071, 67.640160826966172],
[159.649527283763751, 63.310160826891662],
[155.759527283749781, 64.880160826258362]]
]
[
[[-20037508.34,19971868.877628453,0],
[-20037508.34,-19971868.877628453,0],
[20037508.34,-19971868.877628453,0],
[20037508.34,19971868.877628453,0]],
[[537637.6007702783,5907542.234420554,0],
[539500.1483225027,5905165.501947839,0],
[538610.3146341922,5905217.430281373,0],
[538040.6306361248,5906132.0755739985,0],
[538068.958329954,5906571.138846622,0],
[537711.0379352621,5906645.06648362,0],
[537629.886026485,5907533.69114742,0]]
[[-20037508.34,19971868.877628453],
[-20037508.34,-19971868.877628453],
[20037508.34,-19971868.877628453],
[20037508.34,19971868.877628453]],
[[537637.6007702783,5907542.234420554],
[539500.1483225027,5905165.501947839],
[538610.3146341922,5905217.430281373],
[538040.6306361248,5906132.0755739985],
[538068.958329954,5906571.138846622],
[537711.0379352621,5906645.06648362],
[537629.886026485,5907533.69114742]]
]

@@ -24,2 +24,6 @@ 'use strict';

areaTest('issue29', 40);
areaTest('issue34', 139);
areaTest('self-touching', 124, 3.4e-14);
areaTest('outside-ring', 64);
areaTest('simplified-us-border', 120);

@@ -38,2 +42,7 @@ test('indices-2d', function (t) {

test('empty', function (t) {
t.same(earcut([]), []);
t.end();
});
function areaTest(filename, expectedTriangles, expectedDeviation) {

@@ -40,0 +49,0 @@ expectedDeviation = expectedDeviation || 1e-14;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc