oscpacking-0.1.0.0: Examples.hs
{--
This file is part of the OscPacking library.
Copyright 2016 Christopher Howard.
OscPacking is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OscPacking is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OscPacking. If not, see <http://www.gnu.org/licenses/>.
--}
module Examples where
import Packing
import Paint
import Interpret
import Graphics.Gloss.Interface.Pure.Display
import Boundary
import Geometry
displayExample1 :: IO()
displayExample1 = displayWindow (800, 600) black $
buildPicture (cycling 0.05 200)
defaultPacking { boxWidth = 800.0,
boxHeight = 600.0,
seedX = 42,
seedY = 11,
boundary = Just (rectB (20, 20) 760 560),
startingCircles = [Geometry.Circle
{ position = (400, 300), radius = 10 }]
}
1000
displayExample2 :: IO()
displayExample2 = displayWindow (600, 600) black $
buildPicture (colorful 270)
defaultPacking { boxWidth = 600.0,
boxHeight = 600.0,
seedX = 331,
seedY = 2010,
boundary = Just (circleB (600.0 / 2, 600.0 / 2) 250),
startingCircles = [Geometry.Circle
{ position = (300, 300), radius = 10 }]
}
1000
growExample1 :: IO()
growExample1 = growWindow (600, 600) black (colorful 55) 8
defaultPacking { boxWidth = 600.0,
boxHeight = 600.0,
seedX = 58387,
seedY = 943,
boundary = Just (circleB (600.0 / 2, 600.0 / 2) 250),
startingCircles = [Geometry.Circle
{ position = (300, 300), radius = 10 }]
}