Skip to content

Commit

Permalink
Don't check convex hull in equality
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielVandH committed Apr 16, 2024
1 parent 98db39f commit a268d70
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/data_structures/triangulation/triangulation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function Base.:(==)(tri1::Triangulation, tri2::Triangulation)
get_boundary_edge_map(tri1) get_boundary_edge_map(tri2) && return false
get_ghost_vertex_map(tri1) get_ghost_vertex_map(tri2) && return false
get_ghost_vertex_ranges(tri1) get_ghost_vertex_ranges(tri2) && return false
get_convex_hull(tri1) get_convex_hull(tri2) && return false
# get_convex_hull(tri1) ≠ get_convex_hull(tri2) && return false
rep1 = get_representative_point_list(tri1)
rep2 = get_representative_point_list(tri2)
length(rep1) length(rep2) && return false
Expand Down
2 changes: 1 addition & 1 deletion test/triangulation/constrained.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ include("../helper_functions.jl")
points, edges, mat_edges = get_random_vertices_and_constrained_edges(40, 200, 20, rng)
# Need to deepcopy edges below, else it gets changed and updated on the first call to tri, which changes the insertion order of the segments and thus comparing tri to _tri might not work
tri = triangulate(points; segments=deepcopy(edges), rng=StableRNG(i))
if i % 250 == 0
if i % 25 == 0
_tri = retriangulate(tri; segments=deepcopy(edges), rng=StableRNG(i))
@inferred retriangulate(tri)
@test tri == _tri
Expand Down
2 changes: 1 addition & 1 deletion test/triangulation/triangulate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ include("../helper_functions.jl")
end

@testset "Retriangulate should ignore deleted points" begin
points = [(0.0, 0.0), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0), (0.5, 0.5)]
points = [(0.0, 0.0), (0.87, 0.0), (1.0006, 0.7766), (0.0, 1.0), (0.5, 0.5)]
tri = triangulate(points; skip_points = 5)
_tri = retriangulate(tri)
@test tri == _tri && !DelaunayTriangulation.has_vertex(_tri, 5) && validate_triangulation(_tri)
Expand Down

0 comments on commit a268d70

Please sign in to comment.