geometry = {
const vertices = [
{ pos: [ 0, -4, -0.5 ] },
{ pos: [ 2.5, 4, 1.5 ] },
{ pos: [ 0.5, 4, 0.5 ] },
{ pos: [ 0, -4, -0.5 ] },
{ pos: [ 0.5, 4, 0.5 ] },
{ pos: [ 0, 4, -1.5 ] },
{ pos: [ 0, -4, -0.5 ] },
{ pos: [ 0, 4, -1.5 ] },
{ pos: [ -0.5, 4, 0.5 ] },
{ pos: [ 0, -4, -0.5 ] },
{ pos: [ -0.5, 4, 0.5 ] },
{ pos: [ -2.5, 4, 1.5 ] }
];
const positions = [];
for (const vertex of vertices) {
positions.push(...vertex.pos);
}
const geometry = new THREE.BufferGeometry();
const positionNumComponents = 3;
geometry.setAttribute(
'position',
new THREE.BufferAttribute(new Float32Array(positions), positionNumComponents));
geometry.computeVertexNormals();
return geometry;
}