| 4 | #include <iostream> |
| 5 | |
| 6 | int main() |
| 7 | { |
| 8 | auto refMesh = MR::MeshLoad::fromAnySupportedFormat( "mesh1.ctm" ); |
| 9 | if ( !refMesh.has_value() ) |
| 10 | { |
| 11 | std::cerr << refMesh.error(); |
| 12 | return 1; |
| 13 | } |
| 14 | auto mesh = MR::MeshLoad::fromAnySupportedFormat( "mesh2.ctm" ); |
| 15 | if ( !mesh.has_value() ) |
| 16 | { |
| 17 | std::cerr << mesh.error(); |
| 18 | return 1; |
| 19 | } |
| 20 | // get object of VertScalars - set of distances between points of target mesh and reference mesh |
| 21 | auto vertDistances = MR::findSignedDistances( *refMesh, *mesh ); |
| 22 | auto minmax = std::minmax_element( begin( vertDistances ), end( vertDistances ) ); |
| 23 | std::cout << "Distance between reference mesh and the closest point of target mesh is " << *minmax.first << "\n"; |
| 24 | std::cout << "Distance between reference mesh and the farthest point of target mesh is " << *minmax.second << "\n"; |
| 25 | |
| 26 | return 0; |
| 27 | } |
nothing calls this directly
no test coverage detected