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

Function findMaxDistanceSqOneWay

source/MRMesh/MRPointCloudDistance.cpp:11–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9{
10
11float findMaxDistanceSqOneWay( const PointCloud& a, const PointCloud& b, const AffineXf3f* rigidB2A, float maxDistanceSq )
12{
13 MR_TIMER;
14
15 return tbb::parallel_reduce
16 (
17 tbb::blocked_range( 0_v, b.validPoints.endId() ),
18 0.0f,
19 [&] ( const tbb::blocked_range<VertId>& range, float init )
20 {
21 for ( VertId i = range.begin(); i < range.end(); ++i )
22 {
23 if ( !b.validPoints.test( i ) )
24 continue;
25
26 auto distSq = findProjectionOnPoints( rigidB2A ? (*rigidB2A)( b.points[i] ) : b.points[i], PointCloudPart{ a }, maxDistanceSq ).distSq;
27 if ( distSq > init )
28 init = distSq;
29 }
30
31 return init;
32 },
33 [] ( float a, float b ) -> float
34 {
35 return a > b ? a : b;
36 }
37 );
38}
39
40float findMaxDistanceSq( const PointCloud& a, const PointCloud& b, const AffineXf3f* rigidB2A, float maxDistanceSq )
41{

Callers 1

findMaxDistanceSqFunction · 0.70

Calls 5

findProjectionOnPointsFunction · 0.70
endIdMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
testMethod · 0.45

Tested by

no test coverage detected