Skip to content

Commit

Permalink
Disable 2*pi Rotate2 identity
Browse files Browse the repository at this point in the history
  • Loading branch information
sorki committed Nov 5, 2023
1 parent 193f86e commit 012d0ad
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Graphics/Implicit/Canon.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import Prelude
, Ord((<))
, ($)
, (<$>)
, pi
, length
)
import Linear (V2(V2), V3(V3), V4(V4))
Expand Down Expand Up @@ -239,7 +238,12 @@ canon2 (Square v) | hasZeroComponent v = emptySpace
canon2 (Circle 0) = emptySpace
canon2 (Polygon ps) | length ps < 3 = emptySpace
canon2 (Rotate2 0 o) = o
canon2 (Rotate2 θ o) | θ == (2*pi) = o
-- TOOD(srk): this "fixes" (more like hides) the problem
-- with polygon under rotation described in #449
-- so we keep it disabled for now
-- needs import Data.Fixed (mod') and Prelude (pi)
-- canon2 (Rotate2 θ o) | θ `mod'` (2*pi) == 0 = o

-- ignore if zeroes, TODO(srk): produce warning
-- TODO(srk): produce warning and ignore if we get a non-invertible matrix
canon2 (Transform2
Expand Down

0 comments on commit 012d0ad

Please sign in to comment.