@openhps/core
Version:
Open Hybrid Positioning System - Core component
23 lines (22 loc) • 905 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Earcut = void 0;
var _earcut = _interopRequireDefault(require("./lib/earcut.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
class Earcut {
/**
* Triangulates the given shape definition by returning an array of triangles.
*
* @param {Array<number>} data - An array with 2D points.
* @param {Array<number>} holeIndices - An array with indices defining holes.
* @param {number} [dim=2] - The number of coordinates per vertex in the input array.
* @return {Array<number>} An array representing the triangulated faces. Each face is defined by three consecutive numbers
* representing vertex indices.
*/
static triangulate(data, holeIndices, dim = 2) {
return (0, _earcut.default)(data, holeIndices, dim);
}
}
exports.Earcut = Earcut;