From 2e7391ffbc89755b3c0da813991683f5323b20c2 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 12 May 2026 23:35:35 +0200 Subject: [PATCH] Pass terrain data to path resolution functions --- src/viewport-three/viewport-host.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/viewport-three/viewport-host.ts b/src/viewport-three/viewport-host.ts index 1f5c5b93..a7603194 100644 --- a/src/viewport-three/viewport-host.ts +++ b/src/viewport-three/viewport-host.ts @@ -7436,8 +7436,20 @@ export class ViewportHost { } } + private getPathTerrainGlueTerrains(): readonly Terrain[] { + if (this.currentDocument === null) { + return []; + } + + return getTerrains(this.currentDocument.terrains).filter( + (terrain) => terrain.enabled + ); + } + private createPathLineGeometry(path: ScenePath): BufferGeometry { - const resolvedPath = resolveScenePath(path); + const resolvedPath = resolveScenePath(path, { + terrains: this.getPathTerrainGlueTerrains() + }); const points = resolvedPath.segments.length === 0 ? path.points.map( @@ -7487,7 +7499,9 @@ export class ViewportHost { } private createPathSegmentMeshes(path: ScenePath): PathRenderObjects["segments"] { - const resolvedPath = resolveScenePath(path); + const resolvedPath = resolveScenePath(path, { + terrains: this.getPathTerrainGlueTerrains() + }); const segments: PathRenderObjects["segments"] = []; for (const resolvedSegment of resolvedPath.segments) {