From a268d70faaf46bce42326ba854d21e2073f64aef Mon Sep 17 00:00:00 2001 From: DanielVandH Date: Tue, 16 Apr 2024 13:22:27 +1000 Subject: [PATCH] Don't check convex hull in equality --- src/data_structures/triangulation/triangulation.jl | 2 +- test/triangulation/constrained.jl | 2 +- test/triangulation/triangulate.jl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/data_structures/triangulation/triangulation.jl b/src/data_structures/triangulation/triangulation.jl index 411e52e55..f950e6ec0 100644 --- a/src/data_structures/triangulation/triangulation.jl +++ b/src/data_structures/triangulation/triangulation.jl @@ -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 diff --git a/test/triangulation/constrained.jl b/test/triangulation/constrained.jl index e2e5853a2..3fea4c292 100644 --- a/test/triangulation/constrained.jl +++ b/test/triangulation/constrained.jl @@ -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 diff --git a/test/triangulation/triangulate.jl b/test/triangulation/triangulate.jl index 665019389..e0f1cb95e 100644 --- a/test/triangulation/triangulate.jl +++ b/test/triangulation/triangulate.jl @@ -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)