From 14e6a556daf8464d29c0f9d5455d84f1e82895ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Fuhrmann?= Date: Sat, 10 Oct 2026 21:50:47 +0200 Subject: [PATCH 1/2] Allow for TetGen v3 --- CHANGELOG.md | 4 ++++ Project.toml | 4 ++-- test/Project.toml | 1 + test/runtests.jl | 48 +++++++++++++++++++++++++++++++++++------------ 4 files changed, 43 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 313c50a..c0a2f15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes +## v2.7.0 October 10, 2026 +- Allow for TetGen.jl version 3. Consult the [TetGen.jl README](https://github.com/JuliaGeometry/TetGen.jl/blob/master/README.md) for + information on the different versions the upstream C++ TetGen code and its Julia binary package TetGen_jll.jl. + ## v2.6.0 June 24, 2025 - Fixed `minangle` parameter forwarding to TetGen diff --git a/Project.toml b/Project.toml index 96b189b..c830b28 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SimplexGridFactory" uuid = "57bfcd06-606e-45d6-baf4-4ba06da0efd5" +version = "2.7.0" authors = ["Juergen Fuhrmann ", "Patrick Jaap "] -version = "2.6.1" [deps] DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" @@ -26,6 +26,6 @@ GridVisualize = "1.7.0" LinearAlgebra = "1.9" MeshIO = "0.4, 0.5" Printf = "1.6" -TetGen = "1.5,2" +TetGen = "1.5,2,3" Triangulate = "2.3.1, 3" julia = "1.9" diff --git a/test/Project.toml b/test/Project.toml index f942355..2339041 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -9,4 +9,5 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" TetGen = "c5d3f3f7-f850-59f6-8a2e-ffc6dc1317ea" +TetGen_jll = "b47fdcd6-d2c1-58e9-bbba-c1cee8d8c179" Triangulate = "f7e6ffb2-c36d-4f8f-a77e-16e897189344" diff --git a/test/runtests.jl b/test/runtests.jl index ec39097..b68e756 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -8,7 +8,7 @@ using ExtendableGrids using CairoMakie using GridVisualize using Triangulate -using TetGen +using TetGen, TetGen_jll using LinearAlgebra @@ -91,6 +91,7 @@ testgrid(builder::SimplexGridBuilder, testdata) = testgrid(simplexgrid(builder), grid = simplexgrid(points, cells, cellregions, bfaces, bfaceregions) end + @test testgrid(test_ctriangulateio(), (177, 319, 33)) function test_triangulateio() @@ -225,11 +226,18 @@ end grid = simplexgrid(SimplexGridFactory.TetGenType, TetGen, tio; kwargs...) end - @test testgrid(test_simplecube(), (109, 286, 198)) - @test testgrid(test_simplecube(; flags = "pAaqQD"), (109, 286, 198)) - @test testgrid(test_simplecube(; maxvolume = 0.05), (50, 68, 96)) + if pkgversion(TetGen_jll) < v"1.6.0" + @test testgrid(test_simplecube(), (109, 286, 198)) + @test testgrid(test_simplecube(; flags = "pAaqQD"), (109, 286, 198)) + @test testgrid(test_simplecube(; maxvolume = 0.05), (50, 68, 96)) + @test testgrid(test_simplecube(; unsuitable = test_tetunsuitable), (242, 1095, 198)) + else + @test testgrid(test_simplecube(), (63, 192, 96)) + @test testgrid(test_simplecube(; flags = "pAaqQD"), (63, 192, 96)) + @test testgrid(test_simplecube(; maxvolume = 0.05), (14, 24, 24)) + @test testgrid(test_simplecube(; unsuitable = test_tetunsuitable), (167, 788, 110)) - @test testgrid(test_simplecube(; unsuitable = test_tetunsuitable), (242, 1095, 198)) + end end @testset "SimplexGridBuilder 3d" begin @@ -269,7 +277,11 @@ end end @test SimplexGridFactory.tetgenio(test_buildercube0()) isa RawTetGenIO - @test testgrid(test_buildercube(; unsuitable = test_tetunsuitable), (242, 1095, 198)) + if pkgversion(TetGen_jll) < v"1.6.0" + @test testgrid(test_buildercube(; unsuitable = test_tetunsuitable), (242, 1095, 198)) + else + @test testgrid(test_buildercube(; unsuitable = test_tetunsuitable), (167, 788, 110)) + end end @testset "examples2d.jl" begin @@ -286,10 +298,17 @@ end; @testset "examples3d.jl" begin include("../examples/examples3d.jl") - @test testgrid(tetrahedralization_of_cube(), (718, 2456, 1094)) - @test testgrid(tet_cube_with_primitives(), (5658, 27324, 6888)) - @test testgrid(glue_3d(), (29832, 173202, 13200)) - @test testgrid(stl_3d(), (5979, 20640, 9818)) + if pkgversion(TetGen_jll) < v"1.6.0" + @test testgrid(tetrahedralization_of_cube(), (718, 2456, 1094)) + @test testgrid(tet_cube_with_primitives(), (5658, 27324, 6888)) + @test testgrid(glue_3d(), (29832, 173202, 13200)) + @test testgrid(stl_3d(), (5979, 20640, 9818)) + else + @test testgrid(tetrahedralization_of_cube(), (417, 1755, 484)) + @test testgrid(tet_cube_with_primitives(), (4186, 21037, 3830)) + @test testgrid(glue_3d(), (29832, 173202, 13200)) + @test testgrid(stl_3d(), (2869, 10116, 4584)) + end end; # @testset " PlutoGridFactory.jl" begin @@ -387,8 +406,13 @@ end; end @test testgrid(prim2d(), (106, 179, 50)) @test testgrid(prim2d_lineto(), (24, 30, 16)) - @test testgrid(prim3d(), (591, 2872, 822)) - @test testgrid(prim3d_moveto(), (207, 564, 368)) + if pkgversion(TetGen_jll) < v"1.6.0" + @test testgrid(prim3d(), (591, 2872, 822)) + @test testgrid(prim3d_moveto(), (207, 564, 368)) + else + @test testgrid(prim3d(), (509, 2705, 652)) + @test testgrid(prim3d_moveto(), (137, 446, 214)) + end end @testset "builderplot" begin From b9095eaeeab627676cfcd21c2b36dfe43e2cc594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Fuhrmann?= Date: Sun, 11 Oct 2026 19:06:09 +0200 Subject: [PATCH 2/2] increase rtol for testgrid test --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index b68e756..68fc8a6 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -47,7 +47,7 @@ CairoMakie.activate!(; visible = false) # Generated point numbers depend on floating point operations, # so we don't insist in exact matches function testgrid(grid::ExtendableGrid, testdata) - return all(isapprox.((num_nodes(grid), num_cells(grid), num_bfaces(grid)), testdata, rtol = 0.1)) + return all(isapprox.((num_nodes(grid), num_cells(grid), num_bfaces(grid)), testdata, rtol = 0.2)) end testgrid(builder::SimplexGridBuilder, testdata) = testgrid(simplexgrid(builder), testdata)