MeshLib Documentation
Loading...
Searching...
No Matches
MRMeshC.h File Reference
#include "MRMesh.h"
#include "MRMeshBoolean.h"
#include "MRMeshDecimate.h"
#include "MRMeshLoad.h"
#include "MRMeshSave.h"
#include "MRMultiwayICP.h"
#include "MROffset.h"
#include "MRPointCloud.h"
#include "MRPointsLoad.h"
#include "MRPointsSave.h"

Go to the source code of this file.

Functions

MR_EXTERN_C_BEGIN MRMESHC_API MRBooleanResult mrBoolean (const MRMesh *meshA, const MRMesh *meshB, MRBooleanOperation operation, const MRBooleanParameters *params)
 
MRMESHC_API MRDecimateResult mrDecimateMesh (MRMesh *mesh, const MRDecimateSettings *settings)
 Collapse edges in mesh region according to the settings.
 
MRMESHC_API bool mrResolveMeshDegenerations (MRMesh *mesh, const MRResolveMeshDegenSettings *settings)
 
MRMESHC_API MRMeshmrOffsetMesh (MRMeshPart mp, float offset, const MROffsetParameters *params, MRString **errorString)
 
MRMESHC_API MRMultiwayICPmrMultiwayICPNew (const MRMeshOrPointsXf *objects, size_t objectsNum, const MRMultiwayICPSamplingParameters *samplingParams)
 
MRMESHC_API MRVectorAffineXf3f * mrMultiwayICPCalculateTransformations (MRMultiwayICP *mwicp, MRProgressCallback cb)
 
MRMESHC_API void mrMultiwayICPSetParams (MRMultiwayICP *mwicp, const MRICPProperties *prop)
 tune algorithm params before run calculateTransformations()
 
MRMESHC_API MRMeshmrMeshFromTriangles (const MRVector3f *vertexCoordinates, size_t vertexCoordinatesNum, const MRThreeVertIds *t, size_t tNum)
 constructs a mesh from vertex coordinates and a set of triangles with given ids
 
MRMESHC_API MRMeshmrMeshFromTrianglesDuplicatingNonManifoldVertices (const MRVector3f *vertexCoordinates, size_t vertexCoordinatesNum, const MRThreeVertIds *t, size_t tNum)
 
MRMESHC_API MRMeshmrMeshNewFromPointTriples (const MRTriangle3f *posTriangles, size_t posTrianglesNum, bool duplicateNonManifoldVertices)
 
MRMESHC_API MRMeshmrMeshLoadFromAnySupportedFormat (const char *file, MRString **errorStr)
 
MRMESHC_API void mrMeshSaveToAnySupportedFormat (const MRMesh *mesh, const char *file, MRString **errorStr)
 
MRMESHC_API MRPointCloudmrPointCloudFromPoints (const MRVector3f *points, size_t pointsNum)
 creates a new PointCloud object
 
MRMESHC_API MRPointCloudmrPointsLoadFromAnySupportedFormat (const char *filename, MRString **errorString)
 detects the format from file extension and loads points from it
 
MRMESHC_API void mrPointsSaveToAnySupportedFormat (const MRPointCloud *pc, const char *file, MRString **errorString)
 detects the format from file extension and save points to it
 

Function Documentation

◆ mrBoolean()

MR_EXTERN_C_BEGIN MRMESHC_API MRBooleanResult mrBoolean ( const MRMesh * meshA,
const MRMesh * meshB,
MRBooleanOperation operation,
const MRBooleanParameters * params )

Makes new mesh - result of boolean operation on mesh A and mesh B

Parameters
meshAInput mesh A
meshBInput mesh B
operationCSG operation to perform

◆ mrDecimateMesh()

MRMESHC_API MRDecimateResult mrDecimateMesh ( MRMesh * mesh,
const MRDecimateSettings * settings )

Collapse edges in mesh region according to the settings.

◆ mrMeshFromTriangles()

MRMESHC_API MRMesh * mrMeshFromTriangles ( const MRVector3f * vertexCoordinates,
size_t vertexCoordinatesNum,
const MRThreeVertIds * t,
size_t tNum )

constructs a mesh from vertex coordinates and a set of triangles with given ids

◆ mrMeshFromTrianglesDuplicatingNonManifoldVertices()

MRMESHC_API MRMesh * mrMeshFromTrianglesDuplicatingNonManifoldVertices ( const MRVector3f * vertexCoordinates,
size_t vertexCoordinatesNum,
const MRThreeVertIds * t,
size_t tNum )

constructs a mesh from vertex coordinates and a set of triangles with given ids; unlike simple mrMeshFromTriangles it tries to resolve non-manifold vertices by creating duplicate vertices

◆ mrMeshLoadFromAnySupportedFormat()

MRMESHC_API MRMesh * mrMeshLoadFromAnySupportedFormat ( const char * file,
MRString ** errorStr )

detects the format from file extension and loads mesh from it if an error has occurred and errorStr is not NULL, returns NULL and allocates an error message to errorStr

◆ mrMeshNewFromPointTriples()

MRMESHC_API MRMesh * mrMeshNewFromPointTriples ( const MRTriangle3f * posTriangles,
size_t posTrianglesNum,
bool duplicateNonManifoldVertices )

constructs a mesh from point triples;

Parameters
duplicateNonManifoldVertices= false, all coinciding points are given the same VertId in the result;
duplicateNonManifoldVertices= true, it tries to avoid non-manifold vertices by creating duplicate vertices with same coordinates

◆ mrMeshSaveToAnySupportedFormat()

MRMESHC_API void mrMeshSaveToAnySupportedFormat ( const MRMesh * mesh,
const char * file,
MRString ** errorStr )

detects the format from file extension and saves mesh to it if an error has occurred and errorStr is not NULL, returns NULL and allocates an error message to errorStr

◆ mrMultiwayICPCalculateTransformations()

MRMESHC_API MRVectorAffineXf3f * mrMultiwayICPCalculateTransformations ( MRMultiwayICP * mwicp,
MRProgressCallback cb )

runs ICP algorithm given input objects, transformations, and parameters;

Returns
adjusted transformations of all objects to reach registered state

◆ mrMultiwayICPNew()

MRMESHC_API MRMultiwayICP * mrMultiwayICPNew ( const MRMeshOrPointsXf * objects,
size_t objectsNum,
const MRMultiwayICPSamplingParameters * samplingParams )

This class allows you to register many objects having similar parts and known initial approximations of orientations/locations using Iterative Closest Points (ICP) point-to-point or point-to-plane algorithms

◆ mrMultiwayICPSetParams()

MRMESHC_API void mrMultiwayICPSetParams ( MRMultiwayICP * mwicp,
const MRICPProperties * prop )

tune algorithm params before run calculateTransformations()

◆ mrOffsetMesh()

MRMESHC_API MRMesh * mrOffsetMesh ( MRMeshPart mp,
float offset,
const MROffsetParameters * params,
MRString ** errorString )

Offsets mesh by converting it to distance field in voxels using OpenVDB library, signDetectionMode = Unsigned(from OpenVDB) | OpenVDB | HoleWindingRule, and then converts back using OpenVDB library (dual marching cubes), so result mesh is always closed if an error has occurred and errorString is not NULL, returns NULL and allocates an error message to errorStr

◆ mrPointCloudFromPoints()

MRMESHC_API MRPointCloud * mrPointCloudFromPoints ( const MRVector3f * points,
size_t pointsNum )

creates a new PointCloud object

◆ mrPointsLoadFromAnySupportedFormat()

MRMESHC_API MRPointCloud * mrPointsLoadFromAnySupportedFormat ( const char * filename,
MRString ** errorString )

detects the format from file extension and loads points from it

◆ mrPointsSaveToAnySupportedFormat()

MRMESHC_API void mrPointsSaveToAnySupportedFormat ( const MRPointCloud * pc,
const char * file,
MRString ** errorString )

detects the format from file extension and save points to it

◆ mrResolveMeshDegenerations()

MRMESHC_API bool mrResolveMeshDegenerations ( MRMesh * mesh,
const MRResolveMeshDegenSettings * settings )

Resolves degenerate triangles in given mesh This function performs decimation, so it can affect topology

Returns
true if the mesh has been changed