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

Function main

examples/cpp-examples/SignedDistancePointToMesh.dox.cpp:6–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include <iostream>
5
6int main()
7{
8 auto mesh1Res = MR::MeshLoad::fromAnySupportedFormat( "mesh1.ctm" );
9 if ( !mesh1Res.has_value() )
10 {
11 std::cerr << mesh1Res.error();
12 return 1;
13 }
14 auto point = MR::Vector3f( 1.5f, 1.0f, 0.5f );
15
16 auto dist = MR::findSignedDistance( point, *mesh1Res );
17 if ( dist )
18 std::cout << "Signed distance from point to mesh " << dist->dist << "\n";
19 return 0;
20}

Callers

nothing calls this directly

Calls 3

errorMethod · 0.80
fromAnySupportedFormatFunction · 0.50
findSignedDistanceFunction · 0.50

Tested by

no test coverage detected