[orx-shapes] Fix RectifiedPath.kt for closed contours; Closes #334
This commit is contained in:
@@ -14,9 +14,11 @@ abstract class RectifiedPath<T : EuclideanVector<T>>(
|
||||
distanceTolerance: Double = 0.5,
|
||||
lengthScale: Double = 1.0
|
||||
) {
|
||||
val points =
|
||||
val candidatePoints =
|
||||
originalPath.equidistantPositionsWithT((originalPath.length * lengthScale).toInt().coerceAtLeast(2), distanceTolerance)
|
||||
|
||||
val points = if (originalPath.closed) candidatePoints + candidatePoints.first() else candidatePoints
|
||||
|
||||
val intervals by lazy {
|
||||
points.zipWithNext().map {
|
||||
Pair(it.first.second, it.second.second)
|
||||
|
||||
Reference in New Issue
Block a user