Skip to content

Commit

Permalink
Merge pull request #34 from DanielVandH/deltriapi
Browse files Browse the repository at this point in the history
Use DelaunayTriangulation's public API
  • Loading branch information
Kevin-Mattheus-Moerman authored Jul 8, 2024
2 parents 4cea4ac + f6c692b commit ca5d77e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3884,7 +3884,7 @@ function regiontrimesh(VT,R,P)
# Initial triangulation
constrained_segments_ori = deepcopy(constrained_segments) # Clone since triangulate can add new constraint points
TRn = triangulate(Vn; boundary_nodes=constrained_segments, delete_ghosts=true)
Fn = [TriangleFace{Int}(tr) for tr in TRn.triangles]
Fn = [TriangleFace{Int}(tr) for tr in each_solid_triangle(TRn)]

# Check if new boundary points were introduced and remove if needed
Eb = boundaryedges(Fn)
Expand All @@ -3899,8 +3899,8 @@ function regiontrimesh(VT,R,P)
Vn = Vn[indKeep]
constrained_segments = [[indFix[c[1]]] for c in constrained_segments_ori] # Fix indices after point removal
TRn = triangulate(Vn; boundary_nodes=constrained_segments,delete_ghosts=true)
Fn = [TriangleFace{Int}(tr) for tr in TRn.triangles]
Vn = TRn.points
Fn = [TriangleFace{Int}(tr) for tr in each_solid_triangle(TRn)]
Vn = get_points(TRn)
end

# Remove unused points (e.g. outside region)
Expand Down Expand Up @@ -3928,8 +3928,8 @@ function regiontrimesh(VT,R,P)

# Redo triangulation after points have been removed
TRn = triangulate(Vn; boundary_nodes=constrained_segments,delete_ghosts=true)
Fn = [TriangleFace{Int}(tr) for tr in TRn.triangles]
Vn = TRn.points
Fn = [TriangleFace{Int}(tr) for tr in each_solid_triangle(TRn)]
Vn = get_points(TRn)

Fn,Vn,indFix = remove_unused_vertices(Fn,Vn)

Expand Down

0 comments on commit ca5d77e

Please sign in to comment.