Skip to content

Directly use Makie instead of Meshes for visualization #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
maltezfaria opened this issue Oct 7, 2024 · 3 comments
Open

Directly use Makie instead of Meshes for visualization #97

maltezfaria opened this issue Oct 7, 2024 · 3 comments
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request

Comments

@maltezfaria
Copy link
Member

Inti uses Meshes.viz for the visualization of elements and meshes, but this can be achieved directly by e.g. writing simple Makie recipes. The main advantages would be:

  • Drop Meshes dependency (we only use it for plotting)
  • Custom control of recipes, easier to extend to our needs
  • Simpler user interface. At present, we mix viz from Meshes with pure Makie commands such as arrows for the normals, thus requiring familiarity with both packages.
@maltezfaria maltezfaria added enhancement New feature or request dependencies Pull requests that update a dependency file labels Oct 7, 2024
@mdmaas
Copy link

mdmaas commented Nov 5, 2024

I haven't used Makie's recipies yet, but this is how I directly plot meshes with Makie (and GeometryBasics) in case it helps:

fig = Figure()
ax = LScene(fig[1, 1])

tri_mesh = GeometryBasics.Mesh(vertices,faces)
mesh!(ax, tri_mesh, color=:lightblue, alpha=0.7)
wireframe!(ax, tri_mesh, color=(:black, 0.2), linewidth=2, transparency=true, alpha=0.4)

@maltezfaria
Copy link
Member Author

Thanks for the info, this is certainly a good starting point for the triangular meshes in 3D.

For future reference, transitioning to full Makie essentially requires replacing the to_meshes methods in the IntiMakieExt module by an equivalent Makie.convert_argument function as described here.

@mdmaas
Copy link

mdmaas commented Dec 19, 2024

Alright, well, in visualization one typically only needs trianglular meshes, because OpenGL doesn't support any other primitive types. The usual way to go would be to decompose any other element into triangles, and also "sample" high-order elements using multiple triangles. That way visualization of high-order elements could be achieved, too, which doesn't seem to be currently supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants