dome = {
var vertices = [];
for (var j = 0; j < rotatedPoints.length; j++) {
for (var i = 0; i < rotatedPoints[j].length - 1; i++) {
var lastArc = j == rotatedPoints.length - 1;
var j1 = j + 1, i0 = i, i1 = i + 1;
if (lastArc) {
j1 = 0;
i0 = rotatedPoints[j].length - i - 1;
i1 = i0 - 1;
}
var bottomLeft = rotatedPoints[j][i];
var bottomRight = rotatedPoints[j1][i0];
var topRight = rotatedPoints[j1][i1];
var topLeft = rotatedPoints[j][i + 1];
vertices = vertices.concat([
bottomLeft[0], bottomLeft[2], bottomLeft[1],
bottomRight[0], bottomRight[2], bottomRight[1],
topRight[0], topRight[2], topRight[1],
bottomLeft[0], bottomLeft[2], bottomLeft[1],
topRight[0], topRight[2], topRight[1],
topLeft[0], topLeft[2], topLeft[1],
]);
}
}
const geometry = new THREE.BufferGeometry();
geometry.setAttribute('position', new THREE.Float32BufferAttribute(vertices, 3));
geometry.computeVertexNormals();
const material = new THREE.MeshNormalMaterial({side: THREE.DoubleSide});
const mesh = new THREE.Mesh(geometry, material);
return mesh;
}