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" diff --git a/src/api.jl b/src/api.jl index c8891b5..9c5796e 100644 --- a/src/api.jl +++ b/src/api.jl @@ -29,13 +29,13 @@ function TetGen.tetrahedralize(mesh::Mesh{3, Float64, <:TetGen.Ngon}, command = end """ -$(SIGNATURES) + $(SIGNATURES) -Tetrahedralize a domain described by a mesh of triangles. -Returns a mesh of tetrahdra. + 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 + 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..50d7953 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -48,6 +48,20 @@ 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}[