Improve intersection test--fails sometimes

This commit is contained in:
2021-08-17 00:52:54 +02:00
parent 650e58bdfa
commit 5da577ff12
6 changed files with 68 additions and 24 deletions
+3 -3
View File
@@ -72,9 +72,9 @@ blank = []
polygon :: [Point2] -> Picture
{-# INLINE polygon #-}
polygon ps = map (f . zeroZ) $ polyToTris ps
polygon ps = map f $ polyToTris ps
where
f pos = Verx pos black [] 0 polyNum
f (V2 x y) = Verx (V3 x y 0) black [] 0 polyNum
polygonZ :: [Point2] -> Float -> Picture
{-# INLINE polygonZ #-}
@@ -191,7 +191,7 @@ scale3 a b (V3 x y z) = V3 (x*a) (y*b) z
scale :: Float -> Float -> Picture -> Picture
{-# INLINE scale #-}
--scale x y = map . second . overPos $ scale3 x y
scale x y = map $ overPos $ scale3 x y
scale x = map . overPos . scale3 x
rotate :: Float -> Picture -> Picture
{-# INLINE rotate #-}