Skip to content

Commit

Permalink
Reverse the winding of marching triangles.
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Jun 21, 2018
1 parent 9cffe62 commit 0435522
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/isolineFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ var util = require('./util');
*/
var patternLineTable = {
/* triangles with one high vertex */
17 /* 001 */: [{l0: 0, h0: 2, l1: 1, h1: 2}],
18 /* 010 */: [{l0: 2, h0: 1, l1: 0, h1: 1}],
20 /* 100 */: [{l0: 1, h0: 0, l1: 2, h1: 0}],
17 /* 001 */: [{l0: 1, h0: 2, l1: 0, h1: 2}],
18 /* 010 */: [{l0: 0, h0: 1, l1: 2, h1: 1}],
20 /* 100 */: [{l0: 2, h0: 0, l1: 1, h1: 0}],
/* triangles with one low vertex */
22 /* 110 */: [{l0: 2, h0: 1, l1: 2, h1: 0}],
21 /* 101 */: [{l0: 1, h0: 0, l1: 1, h1: 2}],
19 /* 011 */: [{l0: 0, h0: 2, l1: 0, h1: 1}],
22 /* 110 */: [{l0: 2, h0: 0, l1: 2, h1: 1}],
21 /* 101 */: [{l0: 1, h0: 2, l1: 1, h1: 0}],
19 /* 011 */: [{l0: 0, h0: 1, l1: 0, h1: 2}],
/* squares with one high vertex */
1 /* 0001 */: [{l0: 2, h0: 3, l1: 1, h1: 3}],
2 /* 0010 */: [{l0: 0, h0: 2, l1: 3, h1: 2}],
Expand Down
12 changes: 6 additions & 6 deletions tests/cases/isolineFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,16 +363,16 @@ describe('Isoline Feature', function () {
// we slice each element of the result to ignore the properties that
// are added to it.
expect(result.map(function (d) { return d.slice(); })).toEqual([[
{x: 10, y: 0, z: 0}, {x: 9, y: 1, z: 0}, {x: 7, y: 1, z: 0},
{x: 5, y: 1, z: 0}, {x: 4, y: 2, z: 0}
{x: 4, y: 2, z: 0}, {x: 5, y: 1, z: 0}, {x: 7, y: 1, z: 0},
{x: 9, y: 1, z: 0}, {x: 10, y: 0, z: 0}
], [
{x: 12, y: 2, z: 0}, {x: 13, y: 1, z: 0}, {x: 14, y: 0, z: 0}
{x: 14, y: 0, z: 0}, {x: 13, y: 1, z: 0}, {x: 12, y: 2, z: 0}
], [
{x: 18, y: 0, z: 0}, {x: 17, y: 1, z: 0}, {x: 16, y: 2, z: 0}
{x: 16, y: 2, z: 0}, {x: 17, y: 1, z: 0}, {x: 18, y: 0, z: 0}
], [
{x: 24, y: 2, z: 0}, {x: 23, y: 1, z: 0}, {x: 22, y: 0, z: 0}
{x: 22, y: 0, z: 0}, {x: 23, y: 1, z: 0}, {x: 24, y: 2, z: 0}
], [
{x: 26, y: 0, z: 0}, {x: 27, y: 1, z: 0}
{x: 27, y: 1, z: 0}, {x: 26, y: 0, z: 0}
]]);
});
});
Expand Down

0 comments on commit 0435522

Please sign in to comment.