Skip to content

Commit

Permalink
fixed roughness computation
Browse files Browse the repository at this point in the history
  • Loading branch information
amock committed Jun 24, 2024
1 parent d9abc42 commit c691ed0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions include/lvr2/algorithm/GeometryAlgorithms.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,12 @@ DenseVertexMap<float> calcVertexRoughness(
continue;
}

float sum = 0.0;
size_t count = 0;
// forgot to add self
float sum = averageAngles[vH];
size_t count = 1;

visitLocalVertexNeighborhood(mesh, invalid, vH, radius, [&](auto neighbor) {
visitLocalVertexNeighborhood(mesh, invalid, vH, radius, [&](auto neighbor)
{
sum += averageAngles[neighbor];
count += 1;
});
Expand Down Expand Up @@ -441,7 +443,8 @@ void calcVertexRoughnessAndHeightDifferences(
float minHeight = std::numeric_limits<float>::max();
float maxHeight = std::numeric_limits<float>::lowest();

visitLocalVertexNeighborhood(mesh, invalid, vH, radius, [&](auto neighbor) {
visitLocalVertexNeighborhood(mesh, invalid, vH, radius, [&](auto neighbor)
{
sum += averageAngles[neighbor];
count += 1;

Expand Down

0 comments on commit c691ed0

Please sign in to comment.