MeshLib Documentation
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"
6#include "MRMesh/MRExpected.h"
7#include "MRMesh/MREnums.h"
8#include <optional>
9#include <string>
10
11namespace MR
12{
13
23
25[[nodiscard]] MRVOXELS_API float suggestVoxelSize( const MeshPart & mp, float approxNumVoxels );
26
28{
31
36
40
42 std::shared_ptr<IFastWindingNumber> fwn;
43
51 bool memoryEfficient = true;
52};
53
55{
57 UndirectedEdgeBitSet* outSharpEdges = nullptr;
59 float minNewVertDev = 1.0f / 25;
67};
68
73[[nodiscard]] MRVOXELS_API Expected<Mesh> offsetMesh( const MeshPart& mp, float offset, const OffsetParameters& params = {} );
74
78[[nodiscard]] MRVOXELS_API Expected<Mesh> doubleOffsetMesh( const MeshPart& mp, float offsetA, float offsetB, const OffsetParameters& params = {} );
79
82[[nodiscard]] MRVOXELS_API Expected<Mesh> mcOffsetMesh( const MeshPart& mp, float offset,
83 const OffsetParameters& params = {}, Vector<VoxelId, FaceId>* outMap = nullptr );
84
88[[nodiscard]] MRVOXELS_API Expected<Mesh> mcShellMeshRegion( const Mesh& mesh, const FaceBitSet& region, float offset,
89 const BaseShellParameters& params, Vector<VoxelId, FaceId> * outMap = nullptr );
90
93[[nodiscard]] MRVOXELS_API Expected<Mesh> sharpOffsetMesh( const MeshPart& mp, float offset, const SharpOffsetParameters& params = {} );
94
101
103[[nodiscard]] MRVOXELS_API Expected<Mesh> generalOffsetMesh( const MeshPart& mp, float offset, const GeneralOffsetParameters& params );
104
109[[nodiscard]] MRVOXELS_API Expected<Mesh> thickenMesh( const Mesh& mesh, float offset, const GeneralOffsetParameters & params = {} );
110
115[[nodiscard]] MRVOXELS_API Expected<Mesh> offsetOneDirection( const MeshPart& mp, float offset, const GeneralOffsetParameters& params = {} );
116
121[[nodiscard]] MRVOXELS_API Expected<Mesh> offsetPolyline( const Polyline3& polyline, float offset, const OffsetParameters& params = {} );
122
123}
#define MRVOXELS_API
Definition MRVoxelsFwd.h:13
std::vector<T>-like container that requires specific indexing type,
Definition MRMesh/MRVector.h:20
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:576
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
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 > thickenMesh(const Mesh &mesh, float offset, const GeneralOffsetParameters &params={})
MRVOXELS_API Expected< Mesh > generalOffsetMesh(const MeshPart &mp, float offset, const GeneralOffsetParameters &params)
Offsets mesh by converting it to voxels and back using one of three modes specified in the parameters...
tl::expected< T, E > Expected
Definition MRExpected.h:58
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:38
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:15
float voxelSize
Definition MRVoxels/MROffset.h:18
ProgressCallback callBack
Progress callback.
Definition MRVoxels/MROffset.h:21
allows the user to select in the parameters which offset algorithm to call
Definition MRVoxels/MROffset.h:97
Mode mode
Definition MRVoxels/MROffset.h:99
Definition MRMesh/MRMesh.h:23
Definition MRVoxels/MROffset.h:28
std::shared_ptr< IFastWindingNumber > fwn
defines particular implementation of IFastWindingNumber interface that will compute windings....
Definition MRVoxels/MROffset.h:42
SignDetectionMode signDetectionMode
determines the method to compute distance sign
Definition MRVoxels/MROffset.h:30
float windingNumberThreshold
Definition MRVoxels/MROffset.h:35
bool memoryEfficient
Definition MRVoxels/MROffset.h:51
float windingNumberBeta
Definition MRVoxels/MROffset.h:39
Definition MRVoxels/MROffset.h:55
float maxNewRank2VertDev
maximal surface deviation to introduce new rank 2 vertex (on intersection of 2 planes),...
Definition MRVoxels/MROffset.h:61
float maxNewRank3VertDev
maximal surface deviation to introduce new rank 3 vertex (on intersection of 3 planes),...
Definition MRVoxels/MROffset.h:63
UndirectedEdgeBitSet * outSharpEdges
if non-null then created sharp edges will be saved here
Definition MRVoxels/MROffset.h:57
float minNewVertDev
minimal surface deviation to introduce new vertex in a voxel, measured in voxelSize
Definition MRVoxels/MROffset.h:59
float maxOldVertPosCorrection
Definition MRVoxels/MROffset.h:66