From 6e7caef931057c264d56943ce6908d99b0c6d588 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Wed, 13 May 2026 05:07:00 +0200 Subject: [PATCH] auto-git: [change] src/document/paths.ts --- src/document/paths.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/document/paths.ts b/src/document/paths.ts index 272a7ceb..b50f612e 100644 --- a/src/document/paths.ts +++ b/src/document/paths.ts @@ -1354,6 +1354,32 @@ export function createAppendedScenePathPoint(path: ScenePath): ScenePathPoint { }); } +export function createScenePathPointAfter( + path: ScenePath, + pointId: string +): ScenePathPoint { + const pointIndex = getScenePathPointIndex(path, pointId); + + if (pointIndex === -1) { + throw new Error(`Path point ${pointId} does not exist.`); + } + + const currentPoint = path.points[pointIndex]!; + const nextPoint = path.points[pointIndex + 1] ?? null; + + if (nextPoint !== null) { + return createScenePathPoint({ + position: { + x: (currentPoint.position.x + nextPoint.position.x) * 0.5, + y: (currentPoint.position.y + nextPoint.position.y) * 0.5, + z: (currentPoint.position.z + nextPoint.position.z) * 0.5 + } + }); + } + + return createAppendedScenePathPoint(path); +} + function createResolvedPathSegment( options: { index: number;