MeshLib C++ Docs
Loading...
Searching...
No Matches
MROffset.h
Go to the documentation of this file.
1#pragma once
2#include "MRVoxelsFwd.h"
3#include "MRMesh/MRMeshPart.h"
7#include "MRMesh/MRExpected.h"
8#include "MRMesh/MREnums.h"
9#include <optional>
10#include <string>
11
12namespace MR
13{
16
17
27
29[[nodiscard]] MRVOXELS_API float suggestVoxelSize( const MeshPart & mp, float approxNumVoxels );
30
63
65{
67 UndirectedEdgeBitSet* outSharpEdges = nullptr;
71 float minNewVertDev = 1.0f / 25;
82 bool voxelClamp = false;
83};
84
89[[nodiscard]] MRVOXELS_API Expected<Mesh> offsetMesh( const MeshPart& mp, float offset, const OffsetParameters& params = {} );
90
94[[nodiscard]] MRVOXELS_API Expected<Mesh> doubleOffsetMesh( const MeshPart& mp, float offsetA, float offsetB, const OffsetParameters& params = {} );
95
98{
101
103 Vector3i* dims = nullptr;
104
108 AffineXf3f* gridToMeshXf = nullptr;
109};
110
113[[nodiscard]] MRVOXELS_API Expected<Mesh> mcOffsetMesh( const MeshPart& mp, float offset,
114 const OffsetParameters& params = {}, const McOffsetMeshOutputs& outputs = {} );
115
119[[nodiscard]] MRVOXELS_API Expected<Mesh> mcShellMeshRegion( const Mesh& mesh, const FaceBitSet& region, float offset,
120 const BaseShellParameters& params, Vector<VoxelId, FaceId> * outMap = nullptr );
121
124[[nodiscard]] MRVOXELS_API Expected<Mesh> sharpOffsetMesh( const MeshPart& mp, float offset, const SharpOffsetParameters& params = {} );
125
132
135[[nodiscard]] MRVOXELS_API Expected<Mesh> generalOffsetMesh( const MeshPart& mp, float offset, const GeneralOffsetParameters& params );
136
141[[nodiscard]] MRVOXELS_API Expected<Mesh> thickenMesh( const Mesh& mesh, float offset, const GeneralOffsetParameters & params = {},
142 const PartMapping & map = {} );
143
148[[nodiscard]] MRVOXELS_API Expected<Mesh> offsetOneDirection( const MeshPart& mp, float offset, const GeneralOffsetParameters& params = {} );
149
154[[nodiscard]] MRVOXELS_API Expected<Mesh> offsetPolyline( const Polyline3& polyline, float offset, const OffsetParameters& params = {} );
155
156}
#define MRVOXELS_API
see explanation in MRMesh/MRMeshFwd.h
Definition MRVoxelsFwd.h:14
std::vector<T>-like container that requires specific indexing type,
Definition MRVector.h:23
std::function< bool(float)> ProgressCallback
Definition MRMeshFwd.h:759
SignDetectionMode
how to determine the sign of distances from a mesh
Definition MRSignDetectionMode.h:13
float voxelSize
Definition MROffset.h:22
bool closeHolesInHoleWindingNumber
whether to construct closed mesh in signMode = SignDetectionModeShort::HoleWindingNumber
Definition MROffset.h:38
struct MRMESH_CLASS PartMapping
Definition MRMeshFwd.h:640
ProgressCallback callBack
Progress callback.
Definition MROffset.h:25
Mode mode
Definition MROffset.h:130
Expected< Mesh > mcOffsetMesh(const MeshPart &mp, float offset, const OffsetParameters &params={}, const McOffsetMeshOutputs &outputs={})
float maxNewRank2VertDev
maximal surface deviation to introduce new rank 2 vertex (on intersection of 2 planes),...
Definition MROffset.h:73
float maxNewRank3VertDev
maximal surface deviation to introduce new rank 3 vertex (on intersection of 3 planes),...
Definition MROffset.h:75
Expected< Mesh > offsetPolyline(const Polyline3 &polyline, float offset, const OffsetParameters &params={})
Expected< Mesh > generalOffsetMesh(const MeshPart &mp, float offset, const GeneralOffsetParameters &params)
std::shared_ptr< IFastWindingNumber > fwn
Definition MROffset.h:52
UndirectedEdgeBitSet * outSharpEdges
if non-null then created sharp edges will be saved here
Definition MROffset.h:67
Expected< Mesh > doubleOffsetMesh(const MeshPart &mp, float offsetA, float offsetB, const OffsetParameters &params={})
tl::expected< T, E > Expected
Definition MRExpected.h:31
Vector< VoxelId, FaceId > * outVoxelPerFace
if non-null then for each output mesh face maps its voxel id
Definition MROffset.h:69
float suggestVoxelSize(const MeshPart &mp, float approxNumVoxels)
computes size of a cubical voxel to get approximately given number of voxels during rasterization
Expected< Mesh > offsetOneDirection(const MeshPart &mp, float offset, const GeneralOffsetParameters &params={})
Expected< Mesh > offsetMesh(const MeshPart &mp, float offset, const OffsetParameters &params={})
AffineXf3f * gridToMeshXf
Definition MROffset.h:108
SignDetectionMode signDetectionMode
Definition MROffset.h:35
float windingNumberThreshold
Definition MROffset.h:43
OffsetMode
Definition MREnums.h:77
Expected< Mesh > thickenMesh(const Mesh &mesh, float offset, const GeneralOffsetParameters &params={}, const PartMapping &map={})
mapping between original mesh and thicken result
MR::OffsetMode Mode
Definition MROffset.h:129
bool memoryEfficient
Definition MROffset.h:61
Vector< VoxelId, FaceId > * voxelPerFaceMap
optional output map FaceId->VoxelId
Definition MROffset.h:100
Expected< Mesh > sharpOffsetMesh(const MeshPart &mp, float offset, const SharpOffsetParameters &params={})
float windingNumberBeta
Definition MROffset.h:47
Expected< Mesh > mcShellMeshRegion(const Mesh &mesh, const FaceBitSet &region, float offset, const BaseShellParameters &params, Vector< VoxelId, FaceId > *outMap=nullptr)
bool voxelClamp
Definition MROffset.h:82
float minNewVertDev
minimal surface deviation to introduce new vertex in a voxel, measured in voxelSize
Definition MROffset.h:71
Vector3i * dims
optional output dimensions of the volume
Definition MROffset.h:103
float maxOldVertPosCorrection
Definition MROffset.h:78
@ OpenVDB
sign detection from OpenVDB library, which is good and fast if input geometry is closed
Definition MRSignDetectionMode.h:18
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MROffset.h:19
allows the user to select in the parameters which offset algorithm to call
Definition MROffset.h:128
optional outputs of mcOffsetMesh(...) describing the volume, from which the mesh was extracted
Definition MROffset.h:98
Definition MRMesh.h:24
Definition MROffset.h:32
Definition MROffset.h:65