From 4c086d9ff937fe7e4e2467dc42ac368a53e59cf8 Mon Sep 17 00:00:00 2001 From: Edwin Jakobs Date: Wed, 8 May 2024 13:55:58 +0200 Subject: [PATCH] [orx-shapes] add RectifiedPath3D.path override --- orx-shapes/src/commonMain/kotlin/rectify/RectifiedPath.kt | 2 +- orx-shapes/src/commonMain/kotlin/rectify/RectifiedPath3D.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/orx-shapes/src/commonMain/kotlin/rectify/RectifiedPath.kt b/orx-shapes/src/commonMain/kotlin/rectify/RectifiedPath.kt index 8a2cd47d..d69c8c08 100644 --- a/orx-shapes/src/commonMain/kotlin/rectify/RectifiedPath.kt +++ b/orx-shapes/src/commonMain/kotlin/rectify/RectifiedPath.kt @@ -11,7 +11,7 @@ import org.openrndr.shape.ShapeContour * RectifiedContour provides an approximately uniform parameterization for [ShapeContour] */ abstract class RectifiedPath>( - val path: Path, + open val path: Path, distanceTolerance: Double = 0.5, lengthScale: Double = 1.0 ) { diff --git a/orx-shapes/src/commonMain/kotlin/rectify/RectifiedPath3D.kt b/orx-shapes/src/commonMain/kotlin/rectify/RectifiedPath3D.kt index 9e288d68..883e5a31 100644 --- a/orx-shapes/src/commonMain/kotlin/rectify/RectifiedPath3D.kt +++ b/orx-shapes/src/commonMain/kotlin/rectify/RectifiedPath3D.kt @@ -7,8 +7,9 @@ import kotlin.math.floor class RectifiedPath3D(contour: Path3D, distanceTolerance: Double = 0.5, lengthScale: Double = 1.0) : RectifiedPath(contour, distanceTolerance, lengthScale) { + override val path: Path3D = super.path as Path3D + override fun sub(t0: Double, t1: Double): Path3D { - path as Path3D if (path.empty) { return Path3D(emptyList(), false) }