[orx-shapes] add RectifiedPath3D.path override

This commit is contained in:
Edwin Jakobs
2024-05-08 13:55:58 +02:00
parent c4f28d2925
commit 4c086d9ff9
2 changed files with 3 additions and 2 deletions

View File

@@ -11,7 +11,7 @@ import org.openrndr.shape.ShapeContour
* RectifiedContour provides an approximately uniform parameterization for [ShapeContour]
*/
abstract class RectifiedPath<T : EuclideanVector<T>>(
val path: Path<T>,
open val path: Path<T>,
distanceTolerance: Double = 0.5,
lengthScale: Double = 1.0
) {

View File

@@ -7,8 +7,9 @@ import kotlin.math.floor
class RectifiedPath3D(contour: Path3D, distanceTolerance: Double = 0.5, lengthScale: Double = 1.0) :
RectifiedPath<Vector3>(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)
}