From 61e0063d7806415d687adf8e7ebb90c8b54cf2b5 Mon Sep 17 00:00:00 2001 From: hasufell Date: Tue, 28 Oct 2014 18:51:11 +0100 Subject: [PATCH] POLYINT: fix comparison for different-length polygons --- Algorithms/PolygonIntersection/Core.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Algorithms/PolygonIntersection/Core.hs b/Algorithms/PolygonIntersection/Core.hs index 83bfb1e..26d2768 100644 --- a/Algorithms/PolygonIntersection/Core.hs +++ b/Algorithms/PolygonIntersection/Core.hs @@ -83,7 +83,7 @@ sortLexPolys (pA'@(_:_), pB'@(_:_)) = -- current point of polygon B, so insert it into the resulting -- queue and traverse the rest. | ptCmpY (fromMaybe negInfPT (id' <$> Q.first pA)) - (fromMaybe posInfPT (id' <$> Q.first pB)) == GT + (fromMaybe negInfPT (id' <$> Q.first pB)) == GT = Q.pushFront (go (maybeShift . snd . Q.popFront $ pA) pB) (fromJust . Q.first $ pA) -- Same as above, except that the current point of polygon B