Tweak wall cutting
This commit is contained in:
@@ -41,11 +41,22 @@ removeInverseWalls ps = ps
|
||||
|
||||
-- | Cut out a polygon from a set of walls, and check for errors in the
|
||||
-- created walls.
|
||||
-- If created walls are not consistent, expand poly and retry.
|
||||
-- If created walls are not consistent, rotate and expand poly and retry.
|
||||
cutWalls :: [Point2] -> [WallP] -> [WallP]
|
||||
cutWalls ps wls = case mapMaybe (`checkWallRight` newWalls) newWalls of
|
||||
[] -> newWalls
|
||||
_ -> cutWalls (expandPolyBy 0.01 ps) wls
|
||||
-- _ -> cutWalls (expandPolyBy 100 ps) wls
|
||||
-- _ -> cutWalls (expandPolyBy 0.01 ps) wls
|
||||
_ -> cutWalls (map (rotateV 0.001) $ expandPolyBy 0.01 ps) wls
|
||||
where
|
||||
newWalls = cutWalls' ps wls
|
||||
errsL = mapMaybe (`checkWallLeft` newWalls) newWalls
|
||||
|
||||
cutWallsL ps wls = case mapMaybe (`checkWallRight` newWalls) newWalls of
|
||||
[] -> newWalls
|
||||
-- _ -> cutWalls (expandPolyBy 100 ps) wls
|
||||
-- _ -> cutWalls (expandPolyBy 0.01 ps) wls
|
||||
_ -> cutWalls (map (rotateV (-0.001)) $ expandPolyBy 0.01 ps) wls
|
||||
where
|
||||
newWalls = cutWalls' ps wls
|
||||
errsL = mapMaybe (`checkWallLeft` newWalls) newWalls
|
||||
|
||||
Reference in New Issue
Block a user