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

Function makeObjectGcodeFromFile

source/MRMesh/MRObjectLoad.cpp:355–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353}
354
355Expected<ObjectGcode> makeObjectGcodeFromFile( const std::filesystem::path& file, ProgressCallback callback /*= {} */ )
356{
357 MR_TIMER;
358
359 auto gcodeSource = GcodeLoad::fromAnySupportedFormat( file, callback );
360 if ( !gcodeSource.has_value() )
361 return unexpected( std::move( gcodeSource.error() ) );
362
363 ObjectGcode objectGcode;
364 objectGcode.setName( utf8string( file.stem() ) );
365 objectGcode.setGcodeSource( std::make_shared<GcodeSource>( std::move( *gcodeSource ) ) );
366
367 return objectGcode;
368}
369
370Expected<LoadedObjects> loadObjectFromFile( const std::filesystem::path& filename, const ProgressCallback& callback )
371{

Callers 1

loadObjectFromFileFunction · 0.85

Calls 5

utf8stringFunction · 0.85
errorMethod · 0.80
fromAnySupportedFormatFunction · 0.70
unexpectedFunction · 0.70
setGcodeSourceMethod · 0.45

Tested by

no test coverage detected