Skip to content

Commit

Permalink
Switch to DelaunayTriangulation.Naive
Browse files Browse the repository at this point in the history
Per noinia/hgeometry#28, occasionally
DelaunayTriangulation.DivideAndConquer loops infinitely - in this case,
I was able to consistently use the seed 127624940715530481, to generate
a dungeon which had the following room centroids:

    [ Point2 [38.5,3.5] :+ 0
    , Point2 [67.0,33.0] :+ 1
    , Point2 [46.0,45.5] :+ 2
    , Point2 [55.5,42.0] :+ 3
    , Point2 [36.0,25.0] :+ 4
    , Point2 [76.5,12.0] :+ 5
    , Point2 [29.0,26.5] :+ 6
    , Point2 [55.0,10.5] :+ 7
    ]

and cause delaunay triangulation to loop indefinitely (or at least
longer than I cared to wait for). Given the size of our graphs switching
to naive generation should be fine performance-wise, and avoids the
infinite loop.
  • Loading branch information
glittershark committed Jan 19, 2020
1 parent b6f170c commit d62aba2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Xanthous/Util/Graphics.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ module Xanthous.Util.Graphics
--------------------------------------------------------------------------------
import Xanthous.Prelude
--------------------------------------------------------------------------------
import qualified Algorithms.Geometry.DelaunayTriangulation.DivideAndConquer
-- https://github.com/noinia/hgeometry/issues/28
-- import qualified Algorithms.Geometry.DelaunayTriangulation.DivideAndConquer
-- as Geometry
import qualified Algorithms.Geometry.DelaunayTriangulation.Naive
as Geometry
import qualified Algorithms.Geometry.DelaunayTriangulation.Types as Geometry
import Codec.Picture (imagePixels)
Expand Down

0 comments on commit d62aba2

Please sign in to comment.