mapbox / delaunator

An incredibly fast JavaScript library for Delaunay triangulation of 2D points
https://mapbox.github.io/delaunator/
ISC License
2.34k stars 141 forks source link

TypeError: undefined is not a constructor. #56

Closed Seventh7th-Son closed 4 years ago

Seventh7th-Son commented 4 years ago

Using "https://unpkg.com/delaunator@4.0.1/delaunator.js" I am converting the code to another system. It works in the Chrome but not in the other system. What is missing ? /////////////////////////////////////////////////// TypeError: undefined is not a constructor (evaluating 'new Int32Array(this._hashSize).fill(-1)')

moi://appdata/nodeeditor2/nodes/extensions/delaunator.js line 26

22: this._hashSize = Math.ceil(Math.sqrt(n)); 23: this._hullPrev = new Uint32Array(n); // edge to prev edge 24: this._hullNext = new Uint32Array(n); // edge to next edge 25: this._hullTri = new Uint32Array(n); // edge to adjacent triangle 26: >> this._hullHash = new Int32Array(this._hashSize).fill(-1); // angular edge hash 27:
28: // temporary arrays for sorting points 29: this._ids = new Uint32Array(n); 30: this._dists = new Float64Array(n); /////////////////////////////////////////////////////////

mourner commented 4 years ago

Apparently the other system doesn't support typed arrays, which are required for this library.