function buildGeometry() {
const basePoints = [
[1, 0, 0],
[0, 0, 1],
[-1, 0, 0],
[0, 0, -1]
];
const positions = [];
const faces = [];
const pushTriangle = (A, B, C) => {
const nextIndex = positions.length;
positions.push(A, B, C);
faces.push([nextIndex, nextIndex + 1, nextIndex + 2]);
}
for (let i = 0; i < basePoints.length; i++) {
const A = basePoints[i];
const B = basePoints[(i + 1) % basePoints.length];
pushTriangle(A, B, [0, 1, 0]);
pushTriangle(A, B, [0, -1, 0]);
}
return {
positions,
faces
}
}