Continue to refactor zoning to be more stream-based

This commit is contained in:
2022-06-28 03:21:55 +01:00
parent f6d96ec92c
commit e06527091e
34 changed files with 214 additions and 252 deletions
+5
View File
@@ -29,6 +29,7 @@ import Geometry.LHS
import ListHelp
--import Geometry.ConvexPoly
import qualified Data.Set as S
--import Data.Maybe
--import Data.List
-- | Return a point a distance away from a first point towards a second point.
@@ -122,6 +123,10 @@ angleBetween v1 v2 = argV v1 - argV v2
doublePair :: (a,a) -> [(a,a)]
doublePair (x,y) = [(x,y),(y,x)]
-- this shouldn't be here
doublePairSet :: Ord a => (a,a) -> S.Set (a,a)
doublePairSet (x,y) = S.fromList [(x,y),(y,x)]
doubleV2 :: V2 a -> [V2 a]
doubleV2 (V2 x y) = [V2 x y,V2 y x]
-- split a list into triples, forms triangles from a polygon