| 177 | } |
| 178 | |
| 179 | void 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 | |
| 201 | Expected<void> meshDenoiseViaNormals( Mesh & mesh, const DenoiseViaNormalsSettings & settings ) |
| 202 | { |
no test coverage detected