Converting 3D DelaunayTriangulation into Mesh

I have a DelaunayTriangulation.Triangulation that contains 3D points.

I want to plot it using Makie, but I’ve only seen that 2D triangulations can be plotted directly using triplot. If I try to triplot the 3D triangulation I get the projection into 2D.

Is there a way to plot it directly? Or transform the triangulation into a Mesh type from GeometryBasics.jl that is supported?

I’ve found a way. May not be the best but works for my usecase

using GLMakie
using DelaunayTriangulation

pts = [...]

# Ghost triangles must be deleted for Makie.
tri = triangulate(pts; delete_ghosts = true)

fig = Figure()
ax = Axis3(fig[1, 1]; aspect = :equal)
mesh!(ax, stack(tri.points)', stack(tri.triangles)', color = :blue)
3 Likes