import { getVerticeCount, getFaceCount, getFace, getVertex, } from "../ControlLattice";
export var create = function (controlLattice) {
    var vertices = new Array();
    var numVertices = getVerticeCount(controlLattice);
    for (var i = 0; i < numVertices; i++) {
        vertices.push([]);
    }
    var numFaces = getFaceCount(controlLattice);
    for (var i = 0; i < numFaces; i++) {
        var face = getFace(controlLattice, i);
        var vertexA = getVertex(controlLattice, face.a);
        var vertexB = getVertex(controlLattice, face.b);
        var vertexC = 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,
    };
};
export var getLength = function (vertexTrianglesMap) {
    return vertexTrianglesMap.vertices.length;
};
export var getTriangles = function (vertexTrianglesMap, index) { return vertexTrianglesMap.vertices[index]; };
