MeshLib C++ Docs
Loading...
Searching...
No Matches
MRVoxels/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{
14
24
26[[nodiscard]] MRVOXELS_API float suggestVoxelSize( const MeshPart & mp, float approxNumVoxels );
27
59
61{
63 UndirectedEdgeBitSet* outSharpEdges = nullptr;
65 float minNewVertDev = 1.0f / 25;
73};
74
79[[nodiscard]] MRVOXELS_API Expected<Mesh> offsetMesh( const MeshPart& mp, float offset, const OffsetParameters& params = {} );
80
84[[nodiscard]] MRVOXELS_API Expected<Mesh> doubleOffsetMesh( const MeshPart& mp, float offsetA, float offsetB, const OffsetParameters& params = {} );
85
88[[nodiscard]] MRVOXELS_API Expected<Mesh> mcOffsetMesh( const MeshPart& mp, float offset,
89 const OffsetParameters& params = {}, Vector<VoxelId, FaceId>* outMap = nullptr );
90
94[[nodiscard]] MRVOXELS_API Expected<Mesh> mcShellMeshRegion( const Mesh& mesh, const FaceBitSet& region, float offset,
95 const BaseShellParameters& params, Vector<VoxelId, FaceId> * outMap = nullptr );
96
99[[nodiscard]] MRVOXELS_API Expected<Mesh> sharpOffsetMesh( const MeshPart& mp, float offset, const SharpOffsetParameters& params = {} );
100
107
110[[nodiscard]] MRVOXELS_API Expected<Mesh> generalOffsetMesh( const MeshPart& mp, float offset, const GeneralOffsetParameters& params );
111
116[[nodiscard]] MRVOXELS_API Expected<Mesh> thickenMesh( const Mesh& mesh, float offset, const GeneralOffsetParameters & params = {},
117 const PartMapping & map = {} );
118
123[[nodiscard]] MRVOXELS_API Expected<Mesh> offsetOneDirection( const MeshPart& mp, float offset, const GeneralOffsetParameters& params = {} );
124
129[[nodiscard]] MRVOXELS_API Expected<Mesh> offsetPolyline( const Polyline3& polyline, float offset, const OffsetParameters& params = {} );
130
131}
#define MRVOXELS_API
Definition MRVoxels/MRVoxelsFwd.h:13
std::vector<T>-like container that requires specific indexing type,
Definition MRMesh/MRVector.h:19
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:729
Definition MRCameraOrientationPlugin.h:8
SignDetectionMode
how to determine the sign of distances from a mesh
Definition MRMesh/MRSignDetectionMode.h:10
@ OpenVDB
sign detection from OpenVDB library, which is good and fast if input geometry is closed
struct MRMESH_CLASS PartMapping
Definition MRMesh/MRMeshFwd.h:626
MRVOXELS_API Expected< Mesh > mcShellMeshRegion(const Mesh &mesh, const FaceBitSet &region, float offset, const BaseShellParameters &params, Vector< VoxelId, FaceId > *outMap=nullptr)
MRVOXELS_API Expected< Mesh > mcOffsetMesh(const MeshPart &mp, float offset, const OffsetParameters &params={}, Vector< VoxelId, FaceId > *outMap=nullptr)
MRVOXELS_API float suggestVoxelSize(const MeshPart &mp, float approxNumVoxels)
computes size of a cubical voxel to get approximately given number of voxels during rasterization
MRVOXELS_API Expected< Mesh > generalOffsetMesh(const MeshPart &mp, float offset, const GeneralOffsetParameters &params)
tl::expected< T, E > Expected
Definition MRExpected.h:25
MRVOXELS_API Expected< Mesh > thickenMesh(const Mesh &mesh, float offset, const GeneralOffsetParameters &params={}, const PartMapping &map={})
mapping between original mesh and thicken result
MRVOXELS_API Expected< Mesh > offsetOneDirection(const MeshPart &mp, float offset, const GeneralOffsetParameters &params={})
MRVOXELS_API Expected< Mesh > offsetPolyline(const Polyline3 &polyline, float offset, const OffsetParameters &params={})
MRVOXELS_API Expected< Mesh > offsetMesh(const MeshPart &mp, float offset, const OffsetParameters &params={})
OffsetMode
Definition MREnums.h:47
MRVOXELS_API Expected< Mesh > sharpOffsetMesh(const MeshPart &mp, float offset, const SharpOffsetParameters &params={})
MRVOXELS_API Expected< Mesh > doubleOffsetMesh(const MeshPart &mp, float offsetA, float offsetB, const OffsetParameters &params={})
Definition MRVoxels/MROffset.h:16
float voxelSize
Definition MRVoxels/MROffset.h:19
ProgressCallback callBack
Progress callback.
Definition MRVoxels/MROffset.h:22
allows the user to select in the parameters which offset algorithm to call
Definition MRVoxels/MROffset.h:103
Mode mode
Definition MRVoxels/MROffset.h:105
Definition MRMesh/MRMesh.h:23
Definition MRVoxels/MROffset.h:29
bool closeHolesInHoleWindingNumber
whether to construct closed mesh in signMode = SignDetectionModeShort::HoleWindingNumber
Definition MRVoxels/MROffset.h:34
std::shared_ptr< IFastWindingNumber > fwn
Definition MRVoxels/MROffset.h:48
SignDetectionMode signDetectionMode
determines the method to compute distance sign
Definition MRVoxels/MROffset.h:31
float windingNumberThreshold
Definition MRVoxels/MROffset.h:39
bool memoryEfficient
Definition MRVoxels/MROffset.h:57
float windingNumberBeta
Definition MRVoxels/MROffset.h:43
Definition MRVoxels/MROffset.h:61
float maxNewRank2VertDev
maximal surface deviation to introduce new rank 2 vertex (on intersection of 2 planes),...
Definition MRVoxels/MROffset.h:67
float maxNewRank3VertDev
maximal surface deviation to introduce new rank 3 vertex (on intersection of 3 planes),...
Definition MRVoxels/MROffset.h:69
UndirectedEdgeBitSet * outSharpEdges
if non-null then created sharp edges will be saved here
Definition MRVoxels/MROffset.h:63
float minNewVertDev
minimal surface deviation to introduce new vertex in a voxel, measured in voxelSize
Definition MRVoxels/MROffset.h:65
float maxOldVertPosCorrection
Definition MRVoxels/MROffset.h:72