[orx-shapes] Fix bug in RectifiedPath for closed paths

This commit is contained in:
Edwin Jakobs
2024-05-22 12:17:23 +02:00
parent d2e6d0070c
commit 86ae5f70de
2 changed files with 10 additions and 2 deletions

View File

@@ -17,7 +17,7 @@ abstract class RectifiedPath<T : EuclideanVector<T>>(
val candidatePoints =
originalPath.equidistantPositionsWithT((originalPath.length * lengthScale).toInt().coerceAtLeast(2), distanceTolerance)
val points = if (originalPath.closed) candidatePoints + candidatePoints.first() else candidatePoints
val points = if (originalPath.closed) candidatePoints + candidatePoints.first().copy(second = 1.0) else candidatePoints
val intervals by lazy {
points.zipWithNext().map {