From 41bc7e774414dea48d2664e8654a8782aaab45ba Mon Sep 17 00:00:00 2001 From: hasufell Date: Mon, 12 Jan 2015 22:40:39 +0100 Subject: [PATCH] ALGO: simplify --- Algorithms/PolygonTriangulation.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Algorithms/PolygonTriangulation.hs b/Algorithms/PolygonTriangulation.hs index cde57c1..64503dd 100644 --- a/Algorithms/PolygonTriangulation.hs +++ b/Algorithms/PolygonTriangulation.hs @@ -113,14 +113,13 @@ monotonePartitioning pts | otherwise = go (monotoneDiagonals pts) pts where go :: [Segment] -> [PT] -> [[PT]] - go [] _ = [[]] - go _ [] = [[]] - go (x:xs) pts' + go (x:xs) pts'@(_:_) | isYmonotone a && isYmonotone b = [a, b] | isYmonotone b = b : go xs a | otherwise = a : go xs b where [a, b] = splitPoly pts' x + go _ _ = [[]] -- |Try to eliminate the merge and split vertices by computing the