#include <stdio.h>
#include <stdlib.h>
int main(
int argc,
char* argv[] )
{
if ( argc != 2 && argc != 3 )
{
fprintf( stderr, "Usage: %s INPUT [OUTPUT]", argv[0] );
return EXIT_FAILURE;
}
const char* input = argv[1];
const char* output = ( argc == 2 ) ? argv[1] : argv[2];
int rc = EXIT_FAILURE;
if ( !mesh )
{
goto fail_mesh_loading;
}
{
printf( "Mesh doesn't have any holes" );
goto fail_no_holes;
}
size_t newFaceCount = 0;
#define FILL_ALL_HOLES 1
#if FILL_ALL_HOLES
#else
const float minHoleArea = 100.f;
{
{
}
}
#endif
printf( "Added %zu new faces\n", newFaceCount );
{
goto fail_save;
}
rc = EXIT_SUCCESS;
fail_save:
fail_no_holes:
fail_mesh_loading:
return rc;
}
struct MR_FaceBitSet MR_FaceBitSet
MRC_API void MR_FaceBitSet_Destroy(const MR_FaceBitSet *_this)
MRC_API const MR_BitSet * MR_FaceBitSet_UpcastTo_MR_BitSet(const MR_FaceBitSet *object)
MRC_API MR_uint64_t MR_BitSet_count(const MR_BitSet *_this)
MRC_API MR_FaceBitSet * MR_FaceBitSet_DefaultConstruct(void)
struct MR_expected_void_std_string MR_expected_void_std_string
struct MR_expected_MR_Mesh_std_string MR_expected_MR_Mesh_std_string
struct MR_FillHoleParams MR_FillHoleParams
MRC_API void MR_FillHoleParams_Set_metric(MR_FillHoleParams *_this, MR_PassBy value_pass_by, MR_FillHoleMetric *value)
struct MR_FillHoleMetric MR_FillHoleMetric
MRC_API void MR_fillHoles(MR_Mesh *mesh, const MR_std_vector_MR_EdgeId *as, const MR_FillHoleParams *params)
MRC_API MR_FillHoleParams * MR_FillHoleParams_DefaultConstruct(void)
MRC_API void MR_fillHole(MR_Mesh *mesh, MR_EdgeId a, const MR_FillHoleParams *params)
MRC_API void MR_FillHoleParams_Set_outNewFaces(MR_FillHoleParams *_this, MR_FaceBitSet *value)
MRC_API MR_expected_MR_Mesh_std_string * MR_MeshLoad_fromAnySupportedFormat_2(const char *file, const char *file_end, const MR_MeshLoadSettings *settings)
MRC_API MR_FillHoleMetric * MR_getUniversalMetric(const MR_Mesh *mesh)
MRC_API void MR_FillHoleMetric_Destroy(const MR_FillHoleMetric *_this)
MRC_API MR_expected_void_std_string * MR_MeshSave_toAnySupportedFormat_3(const MR_Mesh *mesh, const char *file, const char *file_end, const MR_SaveSettings *settings)
MRC_API MR_std_vector_MR_EdgeId * MR_MeshTopology_findHoleRepresentiveEdges(const MR_MeshTopology *_this, const MR_FaceBitSet *region)
MRC_API MR_Vector3d MR_Mesh_holeDirArea(const MR_Mesh *_this, MR_EdgeId e)
MRC_API const MR_MeshTopology * MR_Mesh_Get_topology(const MR_Mesh *_this)
MRC_API double MR_Vector3d_lengthSq(const MR_Vector3d *_this)
MRC_API MR_Mesh * MR_expected_MR_Mesh_std_string_GetMutableValue(MR_expected_MR_Mesh_std_string *_this)
MRC_API const MR_std_string * MR_expected_MR_Mesh_std_string_GetError(const MR_expected_MR_Mesh_std_string *_this)
MRC_API void MR_expected_MR_Mesh_std_string_Destroy(const MR_expected_MR_Mesh_std_string *_this)
MRC_API const MR_std_string * MR_expected_void_std_string_GetError(const MR_expected_void_std_string *_this)
MRMESH_API Vector3d holeDirArea(const MeshTopology &topology, const VertCoords &points, EdgeId e)
MRC_API const char * MR_std_string_Data(const MR_std_string *_this)
MRC_API size_t MR_std_vector_MR_EdgeId_Size(const MR_std_vector_MR_EdgeId *_this)
MRC_API bool MR_std_vector_MR_EdgeId_IsEmpty(const MR_std_vector_MR_EdgeId *_this)
MRC_API const MR_EdgeId * MR_std_vector_MR_EdgeId_At(const MR_std_vector_MR_EdgeId *_this, size_t i)
MRC_API void MR_std_vector_MR_EdgeId_Destroy(const MR_std_vector_MR_EdgeId *_this)