[orx-shapes] Fix problems with shadowing in Arrangement

This commit is contained in:
Edwin Jakobs
2025-01-20 11:08:18 +01:00
parent 3309bd91d5
commit 57f2223682

View File

@@ -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 }