Triangulate.jl - Generating a triangle grid using Triangulate

Hi, I’m trying to generate an unstructured triangle grid using Triangulate.jl with coordinate data specifying layer boundaries and measuring points within those boundaries.

I’ve tried just about every bit of example code I can find online but somehow have never ended up with an actual plot output. The code functions run without error, but it never displays anything afterwards.

I’m intending to use GLMakie as a plotting backend. Is there any place within the code I need to specify this for it to actually create the plot?

I’m simply confused as to why, even in examples with provided data, I never end up with a plot in a separate window, even though no errors occur in the code.

Any help is greatly appreciated :slight_smile:

Not sure.

Does the mesh generation cause any output to screen?

Do you output files (.ploy, .node or .ele) being created?

There are no outputs visible on screen whatsoever. It just shows the checkmark telling me that the code ran, but there’s no popup window or other information in the terminal at all.

For reference, the following code was suggested to me for the initial problem. It’s from the Triangulate.jl examples on github, but I simply cannot figure out why it doesn’t display the output as shown in the example.

function example_domain_bcdt_area(; maxarea = 0.05)
    triin = Triangulate.TriangulateIO()
    triin.pointlist = Matrix{Cdouble}([0.0 0.0; 1.0 0.0; 1.0 1.0; 0.6 0.6; 0.0 1.0]')
    triin.segmentlist = Matrix{Cint}([1 2; 2 3; 3 4; 4 5; 5 1]')
    triin.segmentmarkerlist = Vector{Int32}([1, 2, 3, 4, 5])
    area = @sprintf("%.15f", maxarea)
    (triout, vorout) = triangulate("pa$(area)DQ", triin)
    return plot_in_out(
        triin,
        triout;
        circumcircles = true,
    )
end;

Since you posted it under the Geo tag, you may be interested in the GMT.jl alternatives

This one creates a spherical triangulation

using GMT

D = sphtriangulate("@hotspots.txt", voronoi=:d, arcs=true)
imshow(D, region=:global, proj=:guess, frame=:afg, pen=3)

The triangulate (also uses the Shewchuk’s triangulate program) page has Cartesian examples, but they are hypothetical.