From ee65a479e3c8ec72ca8486d3f6b04d712dc421a6 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Thu, 21 May 2026 07:59:03 +0200 Subject: [PATCH] Move boundary sample skipping logic to lowered edge vertex collection --- tests/geometry/terrain-mesh.test.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/geometry/terrain-mesh.test.ts b/tests/geometry/terrain-mesh.test.ts index d603c739..b7200bb1 100644 --- a/tests/geometry/terrain-mesh.test.ts +++ b/tests/geometry/terrain-mesh.test.ts @@ -56,19 +56,11 @@ function collectTopEdgeKeys(options: { options.level.positions[positionOffset + varyingOffset]! / options.terrain.cellSize; const roundedVaryingSample = Math.round(varyingSample); - const maxVaryingSample = - options.axis === "x" - ? options.terrain.sampleCountZ - 1 - : options.terrain.sampleCountX - 1; if (Math.abs(varyingSample - roundedVaryingSample) > epsilon) { continue; } - if (roundedVaryingSample === 0 || roundedVaryingSample === maxVaryingSample) { - continue; - } - const sampleX = options.axis === "x" ? options.sampleCoordinate @@ -122,11 +114,19 @@ function collectLoweredEdgeVertexCount(options: { options.level.positions[positionOffset + varyingOffset]! / options.terrain.cellSize; const roundedVaryingSample = Math.round(varyingSample); + const maxVaryingSample = + options.axis === "x" + ? options.terrain.sampleCountZ - 1 + : options.terrain.sampleCountX - 1; if (Math.abs(varyingSample - roundedVaryingSample) > epsilon) { continue; } + if (roundedVaryingSample === 0 || roundedVaryingSample === maxVaryingSample) { + continue; + } + const sampleX = options.axis === "x" ? options.sampleCoordinate