Template Function lvr2::calcVertexRoughness

Function Documentation

template<typename BaseVecT>
DenseVertexMap<float> lvr2::calcVertexRoughness(const BaseMesh<BaseVecT> &mesh, double radius, const VertexMap<Normal<typename BaseVecT::CoordType>> &normals)

Calculates the roughness for each vertex.

For the calculation of the roughness we sum up the average angles of neighbored vertices and divide that by the size of the neighborhood.

Parameters:
  • mesh – The given mesh for the calculation.

  • radius – The radius which defines the local neighborhood. A local neighborhood is defined by a circular-shaped radius, which includes all connected edges and vertices. Once an edge leaves this radius and reenters somehow it isn’t part of the neighborhood.

  • normals – The vertex normals of the given mesh as a map. The normals are necessary in this function for delegating them to the submethods.

Returns:

A map <vertex, float> filled with roughness values for each vertex.