#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)
computes length from min to max
MRMESHC_API MRResolveMeshDegenSettings mrResolveMeshDegenSettingsNew(void)
initializes a default instance
struct MRMesh MRMesh
Definition MRMeshC/MRMeshFwd.h:43
typedefMR_EXTERN_C_BEGIN struct MRString MRString
Definition MRMeshC/MRMeshFwd.h:32
MRMESHC_API MRBox3f mrMeshComputeBoundingBox(const MRMesh *mesh, const MRAffineXf3f *toWorld)
MRMESHC_API void mrMeshFree(MRMesh *mesh)
deallocates a Mesh object
MRMESHC_API void mrStringFree(MRString *str)
deallocates the string object
MR_EXTERN_C_BEGIN MRMESHC_API const char * mrStringData(const MRString *str)
gets read-only access to the string data
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)
Definition MRMeshC/MRBox.h:9
parameters for mrResolveMeshDegenerations
Definition MRMeshC/MRMeshDecimate.h:108
float maxDeviation
maximum permitted deviation from the original surface
Definition MRMeshC/MRMeshDecimate.h:110
float tinyEdgeLength
edges not longer than this value will be collapsed ignoring normals and aspect ratio checks
Definition MRMeshC/MRMeshDecimate.h:112