From 469925722c08840725fe81d4e9a86c3a132638d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Fuhrmann?= Date: Thu, 23 May 2024 15:16:54 +0200 Subject: [PATCH 1/4] Remove old, non-working versions of GeometryBasics from compat --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 6cdcd19..a2fe116 100644 --- a/Project.toml +++ b/Project.toml @@ -13,7 +13,7 @@ TetGen_jll = "b47fdcd6-d2c1-58e9-bbba-c1cee8d8c179" [compat] DocStringExtensions = "0.8,0.9" -GeometryBasics = "0.2, 0.3, 0.4" +GeometryBasics = "0.4" StaticArrays = "1" TetGen_jll = "1.5.3" julia = "1.6" From 995cd799f0b85541b448f6d8b47e024f4a68edf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Fuhrmann?= Date: Thu, 23 May 2024 15:17:22 +0200 Subject: [PATCH 2/4] Remove tetrahedralize(mesh::Mesh{3, Float64, <:TetGen.Triangle}) from input With facet markers in the mesh, this creates the wrong entry type for facets. Fixes #37 --- src/api.jl | 22 +++++++++++----------- test/runtests.jl | 15 +++++++++++++++ 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/api.jl b/src/api.jl index c8891b5..af931c0 100644 --- a/src/api.jl +++ b/src/api.jl @@ -28,14 +28,14 @@ function TetGen.tetrahedralize(mesh::Mesh{3, Float64, <:TetGen.Ngon}, command = return Mesh{Tetrahedron}(result) end -""" -$(SIGNATURES) - -Tetrahedralize a domain described by a mesh of triangles. -Returns a mesh of tetrahdra. -""" -function TetGen.tetrahedralize(mesh::Mesh{3, Float64, <:TetGen.Triangle}, command = "Qp") - tio = JLTetGenIO(coordinates(mesh); facets = faces(mesh)) - result = tetrahedralize(tio, command) - Mesh{Tetrahedron}(result) -end +# """ +# $(SIGNATURES) +# +# Tetrahedralize a domain described by a mesh of triangles. +# Returns a mesh of tetrahdra. +#""" +# function TetGen.tetrahedralize(mesh::Mesh{3, Float64, <:TetGen.Triangle}, command = "Qp") +# tio = JLTetGenIO(coordinates(mesh); facets = faces(mesh)) +# result = tetrahedralize(tio, command) +# Mesh{Tetrahedron}(result) +# end diff --git a/test/runtests.jl b/test/runtests.jl index 68d1328..31f5adb 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -48,6 +48,21 @@ using Test result = tetrahedralize(tetmesh, "pQqAa0.01") @test result isa Mesh + # tetmesh with facet markers (Issue #37) + F = TriangleFace{Cint}[TriangleFace(1, 2, 3), TriangleFace(4, 2, 1), TriangleFace(4, 3, 2), TriangleFace(4, 1, 3)] + + V = Point{3, Float64}[[-0.8164965809277261, -0.47140452079103173, -0.3333333333333333], + [0.8164965809277261, -0.47140452079103173, -0.3333333333333333], + [0.0, 0.0, 1.0], + [0.0, 0.9428090415820635, -0.3333333333333333]] + + markers = Cint[-1, -2, 0, 0] + + mesh = GeometryBasics.Mesh(V, meta(F, markers=markers)) + result = tetrahedralize(mesh, "vpq1.414a0.1") + @test result isa Mesh + + ################# cube with hole example # Construct a cube out of Quads points = Point{3, Float64}[ From 3898a93aaa6982587dd6f61c44cbfd8f4cc10f60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Fuhrmann?= Date: Thu, 23 May 2024 15:26:43 +0200 Subject: [PATCH 3/4] format --- test/runtests.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 31f5adb..50d7953 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -58,11 +58,10 @@ using Test markers = Cint[-1, -2, 0, 0] - mesh = GeometryBasics.Mesh(V, meta(F, markers=markers)) + mesh = GeometryBasics.Mesh(V, meta(F; markers = markers)) result = tetrahedralize(mesh, "vpq1.414a0.1") @test result isa Mesh - ################# cube with hole example # Construct a cube out of Quads points = Point{3, Float64}[ From 88e50cdc9de159d50a5db65a9177641ba2a99a40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Fuhrmann?= Date: Fri, 12 Jul 2024 21:25:05 +0200 Subject: [PATCH 4/4] uncomment tetrahedralize method --- src/api.jl | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/api.jl b/src/api.jl index af931c0..9c5796e 100644 --- a/src/api.jl +++ b/src/api.jl @@ -28,14 +28,14 @@ function TetGen.tetrahedralize(mesh::Mesh{3, Float64, <:TetGen.Ngon}, command = return Mesh{Tetrahedron}(result) end -# """ -# $(SIGNATURES) -# -# Tetrahedralize a domain described by a mesh of triangles. -# Returns a mesh of tetrahdra. -#""" -# function TetGen.tetrahedralize(mesh::Mesh{3, Float64, <:TetGen.Triangle}, command = "Qp") -# tio = JLTetGenIO(coordinates(mesh); facets = faces(mesh)) -# result = tetrahedralize(tio, command) -# Mesh{Tetrahedron}(result) -# end +""" + $(SIGNATURES) + + Tetrahedralize a domain described by a mesh of triangles. + Returns a mesh of tetrahdra. +""" + function TetGen.tetrahedralize(mesh::Mesh{3, Float64, <:TetGen.Triangle}, command = "Qp") + tio = JLTetGenIO(coordinates(mesh); facets = faces(mesh)) + result = tetrahedralize(tio, command) + Mesh{Tetrahedron}(result) + end