Skip to content

Commit

Permalink
Fix pathological case with CDT cavity doubling back on itself (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielVandH authored Nov 23, 2023
2 parents 7f0ed94 + 22a5128 commit 7762f1b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DelaunayTriangulation"
uuid = "927a84f5-c5f4-47a5-9785-b46e178433df"
authors = ["Daniel VandenHeuvel <[email protected]>"]
version = "0.8.10"
version = "0.8.11"

[deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Expand Down
1 change: 1 addition & 0 deletions src/constrained_triangulation/segment_insertion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ end

function add_point_cavity_cdt!(tri::Triangulation, marked_vertices, u, v, w)
x = get_adjacent(tri, w, v)
(u == v || v == w || u == w) && return tri
if !edge_exists(x)
insert_flag = true
else
Expand Down
4 changes: 2 additions & 2 deletions test/triangulation/constrained.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ using StableRNGs
include("../helper_functions.jl")

@testset "Test random constrained Delaunay triangulations" begin
for i in 1:250
for i in 1:25000
rng = StableRNG(i)
points, edges, mat_edges = get_random_vertices_and_constrained_edges(40, 200, 20, rng)
tri = triangulate(points; edges, rng)
tri = triangulate(points; edges, rng=StableRNG(i))
@test validate_triangulation(tri)
empty!(get_all_constrained_edges(tri))
@test !validate_triangulation(tri)
Expand Down

4 comments on commit 7762f1b

@DanielVandH
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/95850

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.8.11 -m "<description of version>" 7762f1b32100e55f0c5f75161106cc917b13a857
git push origin v0.8.11

@DanielVandH
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

  • Fixed a very rare bug that caused, for some pathological examples, constrained triangulations to have triangles with duplicated vertices. This seemed to be caused when a cavity on the side of an inserted segment had a doubly-dangling edge that doubled back on itself, and only sometimes.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/95850

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.8.11 -m "<description of version>" 7762f1b32100e55f0c5f75161106cc917b13a857
git push origin v0.8.11

Please sign in to comment.