x5-geometry
Version:
Geometry and word processing utilities for XNet
20 lines (19 loc) • 558 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const x5sub_1 = require("./x5sub");
const testHex = [
{ x: 1.0, y: 0 },
{ x: 0.5, y: 0.866 },
{ x: -0.5, y: 0.866 },
{ x: -1.0, y: 0 },
{ x: -0.5, y: -0.866 },
{ x: 0.5, y: -0.866 }
];
const tris = [];
for (let i = 1; i < 127; i++) {
const hexIndex = i;
const result = (0, x5sub_1.hexIndexToIndexArray)(hexIndex);
tris.push((0, x5sub_1.hexIndexToVertices)(hexIndex, testHex));
}
const jsonString = JSON.stringify(tris);
console.log(jsonString);