MeshLib C Docs
Loading...
Searching...
No Matches
MRFillContours2D.h File Reference
#include <MRCMesh/MRAffineXf.h>
#include <MRCMesh/MRId.h>
#include <MRCMisc/exports.h>
#include <stddef.h>

Go to the source code of this file.

Typedefs

typedef struct MR_expected_MR_HoleFillPlan_std_string MR_expected_MR_HoleFillPlan_std_string
typedef struct MR_IFillContours2DPlanCache MR_IFillContours2DPlanCache

Functions

MRC_API MR_expected_void_std_stringMR_fillContours2D (MR_Mesh *mesh, const MR_std_vector_MR_EdgeId *holeRepresentativeEdges)
 fill holes with border in same plane (i.e. after cut by plane)
MRC_API void MR_IFillContours2DPlanCache_Destroy (const MR_IFillContours2DPlanCache *_this)
 Destroys a heap-allocated instance of MR_IFillContours2DPlanCache. Does nothing if the pointer is null.
MRC_API void MR_IFillContours2DPlanCache_DestroyArray (const MR_IFillContours2DPlanCache *_this)
 Destroys a heap-allocated array of MR_IFillContours2DPlanCache. Does nothing if the pointer is null.
MRC_API const MR_IFillContours2DPlanCacheMR_IFillContours2DPlanCache_OffsetPtr (const MR_IFillContours2DPlanCache *ptr, ptrdiff_t i)
MRC_API MR_IFillContours2DPlanCacheMR_IFillContours2DPlanCache_OffsetMutablePtr (MR_IFillContours2DPlanCache *ptr, ptrdiff_t i)
MRC_API MR_expected_MR_HoleFillPlan_std_stringMR_fillContours2DPlan (const MR_Mesh *mesh, MR_EdgeId holeEdgeId, MR_IFillContours2DPlanCache *cache)
 prepare filling plan for hole with border in same plane (i.e. after cut by plane)
MRC_API MR_AffineXf3f MR_getXfFromOxyPlane_1 (const MR_std_vector_std_vector_MR_Vector3f *contours)
 computes the transformation that maps O into center mass of contours' points OXY into best plane containing the points Generated from function MR::getXfFromOxyPlane. Parameter contours can not be null. It is a single object.
MRC_API MR_AffineXf3f MR_getXfFromOxyPlane_2 (const MR_Mesh *mesh, const MR_std_vector_std_vector_MR_EdgeId *paths)
 Generated from function MR::getXfFromOxyPlane. Parameter mesh can not be null. It is a single object. Parameter paths can not be null. It is a single object.
MRC_API MR_expected_void_std_stringMR_fillPlanarHole (MR_ObjectMeshData *data, MR_std_vector_std_vector_MR_EdgeId *holeContours)
 given an ObjectMeshData and the contours of a planar hole in it, fills the hole using fillContours2D function and updates all per-element attributes; if some contours were not closed on input, then it closes them by adding a bridge edge in each Generated from function MR::fillPlanarHole. Parameter data can not be null. It is a single object. Parameter holeContours can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_expected_void_std_string_Destroy() to free it when you're done using it. */

Typedef Documentation

◆ MR_expected_MR_HoleFillPlan_std_string

Stores either a MR::HoleFillPlan that represents success or a std::string that represents an error. Supported MR_PassBy modes: MR_PassBy_DefaultConstruct, MR_PassBy_Copy, MR_PassBy_Move (and MR_PassBy_DefaultArgument and MR_PassBy_NoObject if supported by the callee).

◆ MR_IFillContours2DPlanCache

keeps the buffers of fillContours2DPlan alive between calls (the sweep-line triangulation's own cache among them), so a caller preparing plans for many holes one by one avoids re-allocating them on every call; one cache must not be used by several threads at once Generated from class MR::IFillContours2DPlanCache.

Function Documentation

◆ MR_fillContours2D()

MRC_API MR_expected_void_std_string * MR_fillContours2D ( MR_Mesh * mesh,
const MR_std_vector_MR_EdgeId * holeRepresentativeEdges )

fill holes with border in same plane (i.e. after cut by plane)

Parameters
mesh- mesh with holes
holeRepresentativeEdges- each edge here represents a hole borders that should be filled should be not empty edges should have invalid left face (FaceId == -1)
Returns
Expected with has_value()=true if holes filled, otherwise - string error Generated from function MR::fillContours2D. Parameter mesh can not be null. It is a single object. Parameter holeRepresentativeEdges can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_expected_void_std_string_Destroy() to free it when you're done using it.

◆ MR_fillContours2DPlan()

MRC_API MR_expected_MR_HoleFillPlan_std_string * MR_fillContours2DPlan ( const MR_Mesh * mesh,
MR_EdgeId holeEdgeId,
MR_IFillContours2DPlanCache * cache )

prepare filling plan for hole with border in same plane (i.e. after cut by plane)

creates a cache for fillContours2DPlan Generated from function MR::makeFillContours2DPlanCache. The returned pointer is owning! If not null, it must be deallocated using `MR_IFillContours2DPlanCache_Destroy(). MRC_API MR_IFillContours2DPlanCache *MR_makeFillContours2DPlanCache(void);

/**

Parameters
mesh- mesh with hole
holeEdgeId- the edge here represents a hole borders that should be filled edge should have invalid left face (FaceId == -1)
cache- if not null, keeps the buffers of this call in it, see IFillContours2DPlanCache
Returns
Expected with has_value()=true if hole plan is prepared, otherwise - string error Generated from function MR::fillContours2DPlan. Parameter mesh can not be null. It is a single object. Parameter cache defaults to a null pointer in C++. Never returns null. Returns an instance allocated on the heap! Must call MR_expected_MR_HoleFillPlan_std_string_Destroy() to free it when you're done using it.

◆ MR_fillPlanarHole()

given an ObjectMeshData and the contours of a planar hole in it, fills the hole using fillContours2D function and updates all per-element attributes; if some contours were not closed on input, then it closes them by adding a bridge edge in each Generated from function MR::fillPlanarHole. Parameter data can not be null. It is a single object. Parameter holeContours can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_expected_void_std_string_Destroy() to free it when you're done using it. */

◆ MR_getXfFromOxyPlane_1()

MRC_API MR_AffineXf3f MR_getXfFromOxyPlane_1 ( const MR_std_vector_std_vector_MR_Vector3f * contours)

computes the transformation that maps O into center mass of contours' points OXY into best plane containing the points Generated from function MR::getXfFromOxyPlane. Parameter contours can not be null. It is a single object.

◆ MR_getXfFromOxyPlane_2()

MRC_API MR_AffineXf3f MR_getXfFromOxyPlane_2 ( const MR_Mesh * mesh,
const MR_std_vector_std_vector_MR_EdgeId * paths )

Generated from function MR::getXfFromOxyPlane. Parameter mesh can not be null. It is a single object. Parameter paths can not be null. It is a single object.

◆ MR_IFillContours2DPlanCache_Destroy()

MRC_API void MR_IFillContours2DPlanCache_Destroy ( const MR_IFillContours2DPlanCache * _this)

Destroys a heap-allocated instance of MR_IFillContours2DPlanCache. Does nothing if the pointer is null.

◆ MR_IFillContours2DPlanCache_DestroyArray()

MRC_API void MR_IFillContours2DPlanCache_DestroyArray ( const MR_IFillContours2DPlanCache * _this)

Destroys a heap-allocated array of MR_IFillContours2DPlanCache. Does nothing if the pointer is null.

◆ MR_IFillContours2DPlanCache_OffsetMutablePtr()

MRC_API MR_IFillContours2DPlanCache * MR_IFillContours2DPlanCache_OffsetMutablePtr ( MR_IFillContours2DPlanCache * ptr,
ptrdiff_t i )

Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element. The reference to the parameter ptr might be preserved in the return value.

◆ MR_IFillContours2DPlanCache_OffsetPtr()

MRC_API const MR_IFillContours2DPlanCache * MR_IFillContours2DPlanCache_OffsetPtr ( const MR_IFillContours2DPlanCache * ptr,
ptrdiff_t i )

Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element. The reference to the parameter ptr might be preserved in the return value.