From 08e7a5a354586ea95a3e40970fc531205720ddad Mon Sep 17 00:00:00 2001 From: Edwin Jakobs Date: Sat, 4 Jan 2025 14:07:25 +0100 Subject: [PATCH] [orx-shapes] Add RectifiedPath.curvature --- orx-shapes/src/commonMain/kotlin/rectify/RectifiedPath.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/orx-shapes/src/commonMain/kotlin/rectify/RectifiedPath.kt b/orx-shapes/src/commonMain/kotlin/rectify/RectifiedPath.kt index a971bd30..7ab44167 100644 --- a/orx-shapes/src/commonMain/kotlin/rectify/RectifiedPath.kt +++ b/orx-shapes/src/commonMain/kotlin/rectify/RectifiedPath.kt @@ -101,6 +101,13 @@ abstract class RectifiedPath>( } } + /** + * Evaluate curvature for [t] + */ + fun curvature(t: Double): Double { + return originalPath.curvature(rectify(safe(t))) + } + abstract fun sub(t0: Double, t1: Double): Path /**