Temporary de-randomisation of random seed
This commit is contained in:
@@ -10,6 +10,7 @@ import Control.Lens
|
||||
|
||||
import Data.Function (on)
|
||||
|
||||
import Data.Graph
|
||||
import Data.List
|
||||
import Data.Maybe
|
||||
import qualified Data.IntMap as IM
|
||||
@@ -48,10 +49,10 @@ checkWallLeft (x,y) wls = case filter (\(a,b) -> b == x ) wls of
|
||||
-- ie returns a new set of walls with a hole determined by anticlockwise ordering of the points
|
||||
cutWalls' :: [Point2] -> [WallP] -> [WallP]
|
||||
cutWalls' qs walls =
|
||||
nub
|
||||
. filter (not.wallIsZeroLength)
|
||||
. fuseWallsWith zs
|
||||
. addPolyWalls rs
|
||||
-- nub
|
||||
-- . filter (not.wallIsZeroLength)
|
||||
-- . fuseWallsWith zs
|
||||
addPolyWalls rs
|
||||
-- . removeWallsInPolygon ps
|
||||
-- . filter (not.wallIsZeroLength)
|
||||
-- . fuseWallsWith zs
|
||||
@@ -161,6 +162,22 @@ wallIsZeroLength (x,y) = x == y
|
||||
removeWallsInPolygon :: [Point2] -> [WallP] -> [WallP]
|
||||
removeWallsInPolygon ps walls = filter (not . cond) walls
|
||||
where
|
||||
cond wall = pointInsidePolygon (fst wall) ps
|
||||
&& pointInsidePolygon (snd wall) ps
|
||||
cond wall = pointInsidePolygon (0.5 *.* (fst wall +.+ snd wall)) ps
|
||||
-- pointInsidePolygon (fst wall) ps
|
||||
-- && pointInsidePolygon (snd wall) ps
|
||||
|
||||
|
||||
|
||||
--pairElems :: Eq a => [(a,a)] -> [a]
|
||||
--pairElems = concatMap flat2
|
||||
-- where
|
||||
-- flat2 (x,y) = [x,y]
|
||||
--
|
||||
--findLinkedPairs :: Eq a => (a,a) -> [(a,a)] -> [(a,a)]
|
||||
--findLinkedPairs (x,y) = ( (x,y) : ) . filter f
|
||||
-- where
|
||||
-- f (a,b) = b == x || a == y
|
||||
--
|
||||
--
|
||||
--combineListsWithID :: Eq a => [[a]] -> [[a]]
|
||||
--combineListsWithID (x:
|
||||
|
||||
Reference in New Issue
Block a user