Cleanup, improve auto wall rotate
This commit is contained in:
@@ -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?"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user