Finish slicing box

This commit is contained in:
Fuhrmann 2025-03-27 10:49:38 +01:00
parent 7c78015894
commit e71980ad17
4 changed files with 395 additions and 210 deletions

View file

@ -40,9 +40,14 @@ async function buildMesh(layerData: MappedFeature) {
// Transform coordinates to EPSG 3857
const vertices3857 = new Float32Array(vertices.length);
// Reduce coordinate precision
for (let i = 0; i < vertices.length; i += 3) {
const vertex = Array.from(vertices.slice(i, i + 3));
vertices3857.set(transform(vertex), i);
vertices3857.set(
transform(vertex).map((c) => parseInt(c.toFixed(0))),
i
);
}
const positions = new BufferAttribute(vertices3857, 3);