#include <MRMeshC/MRMesh.h>
#include <MRMeshC/MRMeshDecimate.h>
#include <MRMeshC/MRMeshLoad.h>
#include <MRMeshC/MRMeshSave.h>
#include <MRMeshC/MRString.h>
#include <stdio.h>
#include <stdlib.h>
int main( int argc, char* argv[] )
{
int rc = EXIT_FAILURE;
if ( argc != 2 && argc != 3 )
{
fprintf( stderr, "Usage: %s INPUT [OUTPUT]", argv[0] );
goto out;
}
const char* input = argv[1];
const char* output = ( argc == 2 ) ? argv[1] : argv[2];
if ( errorString )
{
fprintf( stderr,
"Failed to load mesh: %s",
mrStringData( errorString ) );
goto out;
}
if ( !changed && output == input )
{
fprintf( stderr, "No changes were made" );
goto out_mesh;
}
if ( errorString )
{
fprintf( stderr,
"Failed to save mesh: %s",
mrStringData( errorString ) );
goto out_mesh;
}
rc = EXIT_SUCCESS;
out_mesh:
out:
return rc;
}
MRMESHC_API float mrBox3fDiagonal(const MRBox3f *box)
MRMESHC_API MRResolveMeshDegenSettings mrResolveMeshDegenSettingsNew(void)
typedefMR_EXTERN_C_BEGIN struct MRString MRString
MRMESHC_API MRBox3f mrMeshComputeBoundingBox(const MRMesh *mesh, const MRAffineXf3f *toWorld)
MRMESHC_API void mrMeshFree(MRMesh *mesh)
MRMESHC_API MRSaveSettings mrSaveSettingsNew(void)
MRMESHC_API void mrStringFree(MRString *str)
MR_EXTERN_C_BEGIN MRMESHC_API const char * mrStringData(const MRString *str)
MRMESHC_API MRMesh * mrMeshLoadFromAnySupportedFormat(const char *file, MRString **errorStr)
MRMESHC_API void mrMeshSaveToAnySupportedFormat(const MRMesh *mesh, const char *file, MRString **errorStr)
MRMESHC_API bool mrResolveMeshDegenerations(MRMesh *mesh, const MRResolveMeshDegenSettings *settings)