Visualization
All geometries and meshes can be visualized with MeshViz.jl. The package exports a single viz
command that can be used to add objects to the scene with a consistent set of attributes.
MeshViz.viz
— Functionviz(object)
Visualize Meshes.jl object
with various options:
size
- size of points in point setcolor
- color of geometries or pointsalpha
- transparency channel in [0,1]colorscheme
- color scheme from ColorSchemes.jlboundarycolor
- color of the boundary (e.g. segments)facetcolor
- color of the facets (e.g. edges)showboundary
- tells whether or not to show the boundaryshowfacets
- tells whether or not to show the facetsvariable
- informs which variable to visualizedecimation
- decimation tolerance for polygons
The option color
can be a single scalar or a vector of scalars. For meshes, the length of the vector of colors determines if the colors should be assigned to vertices or elements.
Examples
# vertex coloring (i.e. linear interpolation)
viz(mesh, color = 1:nvertices(mesh))
# element coloring (i.e. discrete colors)
viz(mesh, color = 1:nelements(mesh))