makeMesh = function(points, i) {
let tx = -5;
let ty = -2.5;
let scale = .01;
const material = new THREE.MeshStandardMaterial({
color: weightColor(toOneScale(i))
});
material.color.convertSRGBToLinear();
var extrudeSettings = {
steps: 4,
depth: .1,
bevelEnabled: false
};
let shape = new THREE.Shape();
extrudeSettings.depth = toOneScale(i) / 5;
shape.moveTo(tx + points[0][0] * scale, ty + points[0][1] * scale);
points.forEach(d => {
let x = tx + d[0] * scale;
let y = ty + d[1] * scale;
shape.lineTo(x, y);
});
let geometry = new THREE.ExtrudeGeometry(shape, extrudeSettings);
let mesh = new THREE.Mesh(geometry, material);
return mesh;
}