Makie - Quadrilater-based mesh visualization

Hi all,

Is there any way of plotting a mesh of quadrilaterals using mesh or, alternatively, some way around using other functions?

1 Like

You can define a mesh via quad faces. Those will be decomposed into triangle faces by normal_mesh and Makie requires those in the end.

using GeometryBasics, GLMakie

points = [Point2f0(0, 0), Point2f0(1, 0), Point2f0(0, 1), Point2f0(1, 1)]
_faces = [QuadFace(1, 2, 4, 3)]
m = normal_mesh(points, _faces)
mesh(m)
3 Likes

Also take a look at MeshViz.jl if you are interested in mesh processing in general and other visualization options: GitHub - JuliaGeometry/MeshViz.jl: Makie.jl recipes for visualization of Meshes.jl

2 Likes

Where are those .ply files available?

And what about visualizing the edges with wireframe? Thanks!

I think you have to do that manually with something like

ls = Point2f0[]
for f in _faces
    push!(ls,
        points[f[1]], points[f[2]],
        points[f[2]], points[f[3]],
        points[f[3]], points[f[4]],
        points[f[4]], points[f[1]],
    )
end
linesegments(ls)
2 Likes

They are available online, I just searched for mesh PLY download. Here are some examples:

https://people.sc.fsu.edu/~jburkardt/data/ply/ply.html

2 Likes