/*! * MarchingSquaresJS * version 1.3.3 * https://github.com/RaumZeit/MarchingSquares.js * * @license GNU Affero General Public License. * Copyright (c) 2015-2019 Ronny Lorenz */ !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):o(e.MarchingSquaresJS=e.MarchingSquaresJS||{})}(this,function(e){"use strict";function p(e,o,t){return e>=1,i++;r===1<>=1,h++;n===1<=o||e[s][r-1]>=o){t=!1;break}if(t&&(e[n-1][0]>=o||e[n-1][r-1]>=o)&&(t=!1),t)for(l=0;l=o||e[n-1][l]>o){t=!1;break}return t}(t,u.threshold)&&(u.linearRing?M.push([[0,0],[0,C],[N,C],[N,0],[0,0]]):M.push([[0,0],[0,C],[N,C],[N,0]])),p.forEach(function(e,a){e.forEach(function(e,o){for(d=null,c=0;c<4;c++)if(d=S[c],"object"==typeof e.edges[d]){for(y=[],g=e.edges[d],w=d,b=o,B=!1,v=[(m=a)+g.path[0][0],o+g.path[0][1]],y.push(v);!B&&"object"==typeof(f=p[m][b]).edges[w];)if(g=f.edges[w],delete f.edges[w],(x=g.path[1])[0]+=m,x[1]+=b,y.push(x),w=g.move.enter,m+=g.move.x,b+=g.move.y,void 0===p[m]||void 0===p[m][b]){if(!u.linearRing)break;if(A=k=0,m===N?(m--,k=0):m<0?(m++,k=2):b===C?(b--,k=3):b<0&&(b++,k=1),m===a&&b===o&&k===D[d]){B=!0,w=d;break}for(;;){if(E=!1,4o||this.upperBound=o)&&r.push({x:this.x,y:this.y})),r},a.prototype.cellsBelowThreshold=function(e,o){var t=[];return o=void 0===o||o,this.lowerBound>e||(this.childA||this.childB||this.childC||this.childD?(this.childA&&(t=t.concat(this.childA.cellsBelowThreshold(e,o))),this.childB&&(t=t.concat(this.childB.cellsBelowThreshold(e,o))),this.childD&&(t=t.concat(this.childD.cellsBelowThreshold(e,o))),this.childC&&(t=t.concat(this.childC.cellsBelowThreshold(e,o)))):(o||this.upperBound>=e)&&t.push({x:this.x,y:this.y})),t},e.isoLines=o,e.isoContours=o,Object.defineProperty(e,"__esModule",{value:!0})});