JuliaGeometry / VoronoiDelaunay.jl

Fast and robust Voronoi & Delaunay tessellation creation with Julia
Other
123 stars 26 forks source link

Infinite loop when attempting to generate degenerate triangulation #7

Closed jbaayen closed 9 years ago

jbaayen commented 9 years ago

Trying to generate a degenerate triangulation causes the code to enter an infinite loop. The following code exhibits this behaviour:

using VoronoiDelaunay tess = DelaunayTessellation() push!(tess, Point(-1, -1)) push!(tess, Point(-1, -2)) push!(tess, Point(-1, -3))

Such code can be a part of a valid use case, where points on further lines are added later.

skariel commented 9 years ago

As written in the documentation, coordinates must be between 1.0+eps and 2.0-eps. For covinience the constants max_coord and min_coord are given. In your example all the coordinates are outside of needed range. This library can handle degenerate cases with no problem unless there is a bug, and this case is no bug, so closing issue