diff --git a/Project.toml b/Project.toml index deae03c4c..1d6340334 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "DelaunayTriangulation" uuid = "927a84f5-c5f4-47a5-9785-b46e178433df" authors = ["Daniel VandenHeuvel "] -version = "1.6.3" +version = "1.6.4" [deps] AdaptivePredicates = "35492f91-a3bd-45ad-95db-fcad7dcfedb7" diff --git a/src/algorithms/point_location/jump_and_march.jl b/src/algorithms/point_location/jump_and_march.jl index d250080d3..10f05ba3e 100644 --- a/src/algorithms/point_location/jump_and_march.jl +++ b/src/algorithms/point_location/jump_and_march.jl @@ -419,7 +419,7 @@ function search_right_down_adjacent_boundary_edges(tri::Triangulation, q, q_pos, k = get_adjacent(tri, i, j) return (true, Cert.On, i, j, k) # true is the return_flag end - return (false, Cert.Outside, i, j, k) + return (false, Cert.Outside, i, j, get_adjacent(tri, i, j)) end function search_left_down_adjacent_boundary_edges(tri::Triangulation, q, q_pos, predicates::AbstractPredicateKernel, store_history::F, history, ghost_vertex, i, j, pⱼ) where {F} if is_true(store_history) # in case we don't enter the loop @@ -445,7 +445,7 @@ function search_left_down_adjacent_boundary_edges(tri::Triangulation, q, q_pos, k = get_adjacent(tri, j, i) return (true, Cert.On, j, i, k) end - return (false, Cert.Outside, i, j, k) + return (false, Cert.Outside, i, j, get_adjacent(tri, i, j)) end """ diff --git a/src/algorithms/triangulation/unconstrained_triangulation.jl b/src/algorithms/triangulation/unconstrained_triangulation.jl index d9382621c..ed3d47422 100644 --- a/src/algorithms/triangulation/unconstrained_triangulation.jl +++ b/src/algorithms/triangulation/unconstrained_triangulation.jl @@ -457,8 +457,8 @@ function unconstrained_triangulation!( ) where {M} initialise_bowyer_watson!(tri, insertion_order, predicates) remaining_points = @view insertion_order[(begin + 3):end] - for (num_points, new_point) in enumerate(remaining_points) - initial_search_point = get_initial_search_point(tri, num_points, new_point, insertion_order, num_sample_rule, rng, try_last_inserted_point) + for (npts, new_point) in enumerate(remaining_points) + initial_search_point = get_initial_search_point(tri, npts, new_point, insertion_order, num_sample_rule, rng, try_last_inserted_point) add_point_bowyer_watson!(tri, new_point, initial_search_point, rng, predicates) end convex_hull!(tri; predicates, reconstruct = false) diff --git a/test/point_location/jump_and_march.jl b/test/point_location/jump_and_march.jl index 2d3ca9b32..29d69b1fb 100644 --- a/test/point_location/jump_and_march.jl +++ b/test/point_location/jump_and_march.jl @@ -764,4 +764,10 @@ end @test DT.is_positively_oriented(DT.triangle_orientation(tri, V)) @test DT.is_inside(DT.point_position_relative_to_triangle(tri, V, (1e-16, 0.0))) end -end \ No newline at end of file +end + +"Issue #216" +points = [(1.0791812460476249, -3.7886681935906106), (1.0791812460476249, -4.4006006582615305), (1.0791812460476249, -5.012533122932451), (1.0791812460476249, -4.022405596275408), (1.0791812460476249, -4.634338060946328), (1.0791812460476249, -5.2462705256172475), (1.0791812460476249, -4.256142998960205), (1.0791812460476249, -4.868075463631126), (1.0791812460476249, -3.877947936974082), (1.0791812460476249, -4.489880401645002), (1.0791812460476249, -5.101812866315922), (1.0791812460476249, -4.111685339658881), (1.0791812460476249, -4.723617804329802), (1.0791812460476249, -3.7334902776727588), (1.0791812460476249, -4.345422742343679), (1.0791812460476249, -4.957355207014598), (1.0791812460476249, -3.967227680357556), (1.0791812460476249, -4.579160145028475), (1.0791812460476249, -5.191092609699395), (1.0791812460476249, -4.200965083042353), (1.0791812460476249, -4.8128975477132725)] +tri = triangulate(points; randomise=false) # PointNotFoundError +tri = Triangulation(points) +DelaunayTriangulation.initialise_bowyer_watson!(tri, insertion_order, predicates)