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

Function main

examples/cpp-examples/PointsToMesh.dox.cpp:7–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include <iostream>
6
7int main()
8{
9 // load points
10 auto loadRes = MR::PointsLoad::fromAnySupportedFormat( "Points.ply" );
11 if ( !loadRes.has_value() )
12 {
13 std::cerr << loadRes.error() << "\n";
14 return 1; // error while loading file
15 }
16 auto triangulationRes = MR::triangulatePointCloud( *loadRes );
17 assert( triangulationRes ); // can be nullopt only if canceled by progress callback
18
19 auto saveRes = MR::MeshSave::toAnySupportedFormat( *triangulationRes, "Mesh.ctm" );
20 if ( !saveRes.has_value() )
21 {
22 std::cerr << saveRes.error() << "\n";
23 return 1; // error while saving file
24 }
25 return 0;
26}

Callers

nothing calls this directly

Calls 4

triangulatePointCloudFunction · 0.85
errorMethod · 0.80
fromAnySupportedFormatFunction · 0.50
toAnySupportedFormatFunction · 0.50

Tested by

no test coverage detected