Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
16 changes: 8 additions & 8 deletions src/api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 14 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}[
Expand Down