Cleanup, improve auto wall rotate

This commit is contained in:
2026-03-24 11:28:11 +00:00
parent be2f7160ba
commit 32f1740577
25 changed files with 226 additions and 252 deletions
+2 -2
View File
@@ -160,9 +160,9 @@ convexHull _ = error "Tried to create the convex hull of two or fewer points"
--convexPartition _ = error "unexpected shape for convexPartition"
triangulateEarClip :: [Point2] -> [[Point2]]
triangulateEarClip (x:y:z:[]) = [(x:y:z:[])]
triangulateEarClip [x,y,z] = [[x,y,z]]
triangulateEarClip (x:y:z:xs)
| isLHS x y z && not (any (`pointInPoly` (x:y:z:[])) xs) = (x:y:z:[]) : triangulateEarClip (x:z:xs)
| isLHS x y z && not (any (`pointInPoly` [x,y,z]) xs) = [x,y,z] : triangulateEarClip (x:z:xs)
| otherwise = triangulateEarClip (y:z:xs ++ [x])
triangulateEarClip _ = error "triangulateEarClip: non-simple polygon input?"