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.vizFunction
viz(object)

Visualize Meshes.jl object with various options:

  • size - size of points in point set
  • color - color of geometries or points
  • alpha - transparency channel in [0,1]
  • colorscheme - color scheme from ColorSchemes.jl
  • boundarycolor - color of the boundary (e.g. segments)
  • facetcolor - color of the facets (e.g. edges)
  • showboundary - tells whether or not to show the boundary
  • showfacets - tells whether or not to show the facets
  • variable - informs which variable to visualize
  • decimation - 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))