MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / updateIndicatorFast

Function updateIndicatorFast

source/MRMesh/MRNormalDenoising.cpp:179–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179void updateIndicatorFast( const MeshTopology & topology, Vector<float, UndirectedEdgeId> & v, const FaceNormals & normals, float beta, float gamma )
180{
181 MR_TIMER;
182
183 assert( v.size() == topology.undirectedEdgeSize() );
184 assert( (int)normals.size() >= topology.lastValidFace() );
185
186 const float rh = beta / ( 2 * eps );
187 ParallelFor( v, [&]( UndirectedEdgeId ue )
188 {
189 const EdgeId e = ue;
190 const auto l = topology.left( e );
191 const auto r = topology.right( e );
192 if ( !l || !r )
193 {
194 v[ue] = 1;
195 return;
196 }
197 v[ue] = rh / ( rh + 2 * gamma * ( normals[l] - normals[r] ).lengthSq() );
198 } );
199}
200
201Expected<void> meshDenoiseViaNormals( Mesh & mesh, const DenoiseViaNormalsSettings & settings )
202{

Callers 1

meshDenoiseViaNormalsFunction · 0.85

Calls 7

ParallelForFunction · 0.85
lastValidFaceMethod · 0.80
leftMethod · 0.80
rightMethod · 0.80
sizeMethod · 0.45
undirectedEdgeSizeMethod · 0.45
lengthSqMethod · 0.45

Tested by

no test coverage detected