License | BSD-3-Clause |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Swarm.Game.Scenario.Topography.Structure.Recognition.Symmetry
Description
Symmetry analysis for structure recognizer.
Synopsis
Documentation
data RedundantOrientations Source #
Constructors
TwoFoldRedundancy (NonEmpty CoordinateOrientation) | |
FourFoldRedundancy (Set AbsoluteDir) |
checkSymmetry :: Eq a => ExtractedArea b a -> Either RedundantOrientations (SymmetryAnnotatedGrid (ExtractedArea b a)) Source #
Warns if any recognition orientations are redundant by rotational symmetry. We can accomplish this by testing only two rotations:
- Rotate 90 degrees. If identical to the original orientation, then has 4-fold symmetry and we don't need to check any other orientations. Warn if more than one recognition orientation was supplied.
- Rotate 180 degrees. At best, we may now have 2-fold symmetry. Warn if two opposite orientations were supplied.