"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ControlLattice_1 = require("../ControlLattice");
exports.create = function (controlLattice) {
    var vertices = new Array();
    var numVertices = ControlLattice_1.getVerticeCount(controlLattice);
    for (var i = 0; i < numVertices; i++) {
        vertices.push([]);
    }
    var numFaces = ControlLattice_1.getFaceCount(controlLattice);
    for (var i = 0; i < numFaces; i++) {
        var face = ControlLattice_1.getFace(controlLattice, i);
        var vertexA = ControlLattice_1.getVertex(controlLattice, face.a);
        var vertexB = ControlLattice_1.getVertex(controlLattice, face.b);
        var vertexC = ControlLattice_1.getVertex(controlLattice, face.c);
        vertices[face.a].push([vertexA, vertexB, vertexC]);
        vertices[face.b].push([vertexB, vertexC, vertexA]);
        vertices[face.c].push([vertexC, vertexA, vertexB]);
    }
    return {
        vertices: vertices,
    };
};
exports.getLength = function (vertexTrianglesMap) {
    return vertexTrianglesMap.vertices.length;
};
exports.getTriangles = function (vertexTrianglesMap, index) { return vertexTrianglesMap.vertices[index]; };
