From 57f22236825d02847cd2b781c7d5c86e6f38bc52 Mon Sep 17 00:00:00 2001 From: Edwin Jakobs Date: Mon, 20 Jan 2025 11:08:18 +0100 Subject: [PATCH] [orx-shapes] Fix problems with shadowing in Arrangement --- orx-shapes/src/commonMain/kotlin/arrangement/Arrangement.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/orx-shapes/src/commonMain/kotlin/arrangement/Arrangement.kt b/orx-shapes/src/commonMain/kotlin/arrangement/Arrangement.kt index d4cc50c6..79ece7f9 100644 --- a/orx-shapes/src/commonMain/kotlin/arrangement/Arrangement.kt +++ b/orx-shapes/src/commonMain/kotlin/arrangement/Arrangement.kt @@ -33,7 +33,7 @@ private val ShapeContour.endContourPoint get() = segments.last().start, ) -private fun ShapeContour.direction(ut: Double): Vector2 = normal(ut).perpendicular(polarity.opposite) +private fun ShapeContour.pdirection(ut: Double): Vector2 = normal(ut).perpendicular(polarity.opposite) private val YPolarity.opposite get() = when(this) { @@ -128,10 +128,10 @@ data class XHalfEdge(val source: XVertex, val target: XVertex, val contour: Shap val next by lazy { if (target.outgoing.size == 2 && this in target.outgoing) return@lazy this val y = target.pos - val x = y - contour.direction(1.0) + val x = y - contour.pdirection(1.0) val candidates = target.outgoing.filterNot { it == twin } .map { - val z = y + it.contour.direction(0.0) + val z = y + it.contour.pdirection(0.0) it to angleBetween(z - y, x - y) }.filter { it.second > -1E-6 || it.second < -PI + 1E-6 }