MeshLib Documentation
Loading...
Searching...
No Matches
MROffset.h File Reference
#include "MRMeshFwd.h"
#include "MRMeshPart.h"
#include "MRSignDetectionMode.h"
#include <MRMesh/config.h>

Go to the source code of this file.

Classes

struct  MROffsetParameters
 
struct  MRGeneralOffsetParameters
 

Typedefs

typedef MR_EXTERN_C_BEGIN struct MROffsetParameters MROffsetParameters
 
typedef enum MRGeneralOffsetParametersMode MRGeneralOffsetParametersMode
 allows the user to select in the parameters which offset algorithm to call
 
typedef struct MRGeneralOffsetParameters MRGeneralOffsetParameters
 

Enumerations

enum  MRGeneralOffsetParametersMode { MRGeneralOffsetParametersModeSmooth = 0 , MRGeneralOffsetParametersModeStandard , MRGeneralOffsetParametersModeSharpening }
 allows the user to select in the parameters which offset algorithm to call More...
 

Functions

MRMESHC_API MROffsetParameters mrOffsetParametersNew (void)
 initializes a default instance
 
MRMESHC_API float mrSuggestVoxelSize (MRMeshPart mp, float approxNumVoxels)
 computes size of a cubical voxel to get approximately given number of voxels during rasterization
 
MRMESHC_API MRMeshmrOffsetMesh (MRMeshPart mp, float offset, const MROffsetParameters *params, MRString **errorString)
 
MRMESHC_API MRMeshmrDoubleOffsetMesh (MRMeshPart mp, float offsetA, float offsetB, const MROffsetParameters *params, MRString **errorString)
 
MRMESHC_API MRMeshmrMcOffsetMesh (MRMeshPart mp, float offset, const MROffsetParameters *params, MRString **errorString)
 
MRMESHC_API MRMeshmrMcShellMeshRegion (const MRMesh *mesh, const MRFaceBitSet *region, float offset, const MROffsetParameters *params, MRString **errorString)
 
MRMESHC_API MRGeneralOffsetParameters mrGeneralOffsetParametersNew (void)
 initializes a default instance
 
MRMESHC_API MRMeshmrSharpOffsetMesh (MRMeshPart mp, float offset, const MROffsetParameters *params, const MRGeneralOffsetParameters *generalParams, MRString **errorString)
 
MRMESHC_API MRMeshmrGeneralOffsetMesh (MRMeshPart mp, float offset, const MROffsetParameters *params, const MRGeneralOffsetParameters *generalParams, MRString **errorString)
 
MRMESHC_API MRMeshmrThickenMesh (const MRMesh *mesh, float offset, const MROffsetParameters *params, const MRGeneralOffsetParameters *generalParams, MRString **errorString)
 

Typedef Documentation

◆ MRGeneralOffsetParameters

typedef struct MRGeneralOffsetParameters MRGeneralOffsetParameters

◆ MRGeneralOffsetParametersMode

allows the user to select in the parameters which offset algorithm to call

◆ MROffsetParameters

typedef MR_EXTERN_C_BEGIN struct MROffsetParameters MROffsetParameters

Enumeration Type Documentation

◆ MRGeneralOffsetParametersMode

allows the user to select in the parameters which offset algorithm to call

Enumerator
MRGeneralOffsetParametersModeSmooth 

create mesh using dual marching cubes from OpenVDB library

MRGeneralOffsetParametersModeStandard 

create mesh using standard marching cubes implemented in MeshLib

MRGeneralOffsetParametersModeSharpening 

create mesh using standard marching cubes with additional sharpening implemented in MeshLib

Function Documentation

◆ mrDoubleOffsetMesh()

MRMESHC_API MRMesh * mrDoubleOffsetMesh ( MRMeshPart mp,
float offsetA,
float offsetB,
const MROffsetParameters * params,
MRString ** errorString )

Offsets mesh by converting it to voxels and back two times only closed meshes allowed (only Offset mode) typically offsetA and offsetB have distinct signs if an error has occurred and errorString is not NULL, returns NULL and allocates an error message to errorStr

◆ mrGeneralOffsetMesh()

MRMESHC_API MRMesh * mrGeneralOffsetMesh ( MRMeshPart mp,
float offset,
const MROffsetParameters * params,
const MRGeneralOffsetParameters * generalParams,
MRString ** errorString )

Offsets mesh by converting it to voxels and back using one of three modes specified in the parameters if an error has occurred and errorString is not NULL, returns NULL and allocates an error message to errorStr

◆ mrGeneralOffsetParametersNew()

MRMESHC_API MRGeneralOffsetParameters mrGeneralOffsetParametersNew ( void )

initializes a default instance

◆ mrMcOffsetMesh()

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

Offsets mesh by converting it to distance field in voxels (using OpenVDB library if SignDetectionMode::OpenVDB or our implementation otherwise) and back using standard Marching Cubes, as opposed to Dual Marching Cubes in offsetMesh(...) if an error has occurred and errorString is not NULL, returns NULL and allocates an error message to errorStr

◆ mrMcShellMeshRegion()

MRMESHC_API MRMesh * mrMcShellMeshRegion ( const MRMesh * mesh,
const MRFaceBitSet * region,
float offset,
const MROffsetParameters * params,
MRString ** errorString )

Constructs a shell around selected mesh region with the properties that every point on the shall must

  1. be located not further than given distance from selected mesh part,
  2. be located not closer to not-selected mesh part than to selected mesh part. if an error has occurred and errorString is not NULL, returns NULL and allocates an error message to errorStr

◆ 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

◆ mrOffsetParametersNew()

MRMESHC_API MROffsetParameters mrOffsetParametersNew ( void )

initializes a default instance

◆ mrSharpOffsetMesh()

MRMESHC_API MRMesh * mrSharpOffsetMesh ( MRMeshPart mp,
float offset,
const MROffsetParameters * params,
const MRGeneralOffsetParameters * generalParams,
MRString ** errorString )

Offsets mesh by converting it to voxels and back post process result using reference mesh to sharpen features if an error has occurred and errorString is not NULL, returns NULL and allocates an error message to errorStr

◆ mrSuggestVoxelSize()

MRMESHC_API float mrSuggestVoxelSize ( MRMeshPart mp,
float approxNumVoxels )

computes size of a cubical voxel to get approximately given number of voxels during rasterization

◆ mrThickenMesh()

MRMESHC_API MRMesh * mrThickenMesh ( const MRMesh * mesh,
float offset,
const MROffsetParameters * params,
const MRGeneralOffsetParameters * generalParams,
MRString ** errorString )

in case of positive offset, returns the mesh consisting of offset mesh merged with inversed original mesh (thickening mode); in case of negative offset, returns the mesh consisting of inversed offset mesh merged with original mesh (hollowing mode); if your input mesh is open then please specify params.signDetectionMode = SignDetectionMode::Unsigned, and you will get open mesh (with several components) on output if your input mesh is closed then please specify another sign detection mode, and you will get closed mesh (with several components) on output; if an error has occurred and errorString is not NULL, returns NULL and allocates an error message to errorStr