Stop intersectSegSegTest returning True for collinear line pairs

This commit is contained in:
2026-03-12 13:37:56 +00:00
parent cdc21c9fb1
commit 65383e2303
15 changed files with 326 additions and 223 deletions
+5 -1
View File
@@ -10,6 +10,7 @@ module Dodge.Tree.Shift (
PosRooms (..),
) where
import Data.Monoid
import Control.Lens
import Data.Bifunctor
import Data.List (delete)
@@ -66,7 +67,9 @@ posRms prs parenti@(parent, _) ((numChild, t@(Node childi _)) : its) tseq = do
where
tryChildLinks [] = tryParentLinks ls
tryChildLinks ((numinlink, il) : ils)
| clipping = tryChildLinks ils
| Just xs <- clipping' = do
putStrLn $ show xs
tryChildLinks ils
| otherwise = do
putStrLn $ show j ++ "-" ++ show numinlink
mayrs <-
@@ -83,6 +86,7 @@ posRms prs parenti@(parent, _) ((numChild, t@(Node childi _)) : its) tseq = do
where
newBounds = map pointsToPoly . _rmBound . doRoomShift . fst $ rootLabel shiftedt
clipping = or (convexPolysOverlap <$> newBounds <*> _prBounds prs)
clipping' = getFirst . foldMap First $ convexPolysOverlapWitness <$> newBounds <*> _prBounds prs
updateparent rm =
_rmLinkEff rm il child numChild outlnk rm
& rmLinks %~ delete outlnk