Skip to content

Commit 46c8ac5

Browse files
committed
Pointiness: merge-on-distance beforehand
1 parent 4f1bc27 commit 46c8ac5

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/slg/shapes/pointiness.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@
1717
***************************************************************************/
1818

1919
#include <boost/format.hpp>
20+
#include <limits>
2021
#include <optional>
2122

2223
#include "luxrays/core/exttrianglemesh.h"
2324
#include "slg/shapes/pointiness.h"
2425
#include "slg/scene/scene.h"
26+
#include "slg/shapes/merge_on_distance.h"
2527

2628
using namespace std;
2729
using namespace luxrays;
@@ -68,11 +70,18 @@ class VertexAverageComparator {
6870
const Point *verts_;
6971
};
7072

71-
PointinessShape::PointinessShape(ExtTriangleMeshRef srcMesh, const u_int destAOVIndex) {
72-
SDL_LOG("Pointiness shape " << srcMesh.GetName());
73+
PointinessShape::PointinessShape(ExtTriangleMeshRef rawSrcMesh, const u_int destAOVIndex) {
74+
// rawSrcMesh is source mesh before merge-on-distance
75+
SDL_LOG("Pointiness shape " << rawSrcMesh.GetName());
7376

7477
const double startTime = WallClockTime();
7578

79+
// Merge vertices on distance
80+
auto srcMeshPtr = MergeOnDistanceShape::ApplyMergeOnDistance(
81+
rawSrcMesh, std::numeric_limits<float>::min(), true
82+
);
83+
auto& srcMesh = *srcMeshPtr;
84+
7685
const u_int originalVertCount = srcMesh.GetTotalVertexCount();
7786
const u_int triCount = srcMesh.GetTotalTriangleCount();
7887

0 commit comments

Comments
 (0)