MeshLib
 
Loading...
Searching...
No Matches
MRMesh/MROffset.h
Go to the documentation of this file.
1#pragma once
2#include "MRMeshFwd.h"
3#include "MRMeshPart.h"
6#include "MRExpected.h"
7#include <optional>
8#include <string>
9
10namespace MR
11{
12
22
24[[nodiscard]] MRMESH_API float suggestVoxelSize( const MeshPart & mp, float approxNumVoxels );
25
27{
30
35
39
41 std::shared_ptr<IFastWindingNumber> fwn;
42
50 bool memoryEfficient = true;
51};
52
54{
56 UndirectedEdgeBitSet* outSharpEdges = nullptr;
58 float minNewVertDev = 1.0f / 25;
66};
67
68#ifndef MRMESH_NO_OPENVDB
73[[nodiscard]] MRMESH_API Expected<Mesh> offsetMesh( const MeshPart& mp, float offset, const OffsetParameters& params = {} );
74
78[[nodiscard]] MRMESH_API Expected<Mesh> doubleOffsetMesh( const MeshPart& mp, float offsetA, float offsetB, const OffsetParameters& params = {} );
79#endif
80
83[[nodiscard]] MRMESH_API Expected<Mesh> mcOffsetMesh( const MeshPart& mp, float offset,
84 const OffsetParameters& params = {}, Vector<VoxelId, FaceId>* outMap = nullptr );
85
89[[nodiscard]] MRMESH_API Expected<Mesh> mcShellMeshRegion( const Mesh& mesh, const FaceBitSet& region, float offset,
90 const BaseShellParameters& params, Vector<VoxelId, FaceId> * outMap = nullptr );
91
94[[nodiscard]] MRMESH_API Expected<Mesh> sharpOffsetMesh( const MeshPart& mp, float offset, const SharpOffsetParameters& params = {} );
95
98{
99 enum class Mode : int
100 {
101#ifndef MRMESH_NO_OPENVDB
102 Smooth,
103#endif
104 Standard,
106 };
108};
109
111[[nodiscard]] MRMESH_API Expected<Mesh> generalOffsetMesh( const MeshPart& mp, float offset, const GeneralOffsetParameters& params );
112
117[[nodiscard]] MRMESH_API Expected<Mesh> thickenMesh( const Mesh& mesh, float offset, const GeneralOffsetParameters & params = {} );
118
119#ifndef MRMESH_NO_OPENVDB
124[[nodiscard]] MRMESH_API Expected<Mesh> offsetPolyline( const Polyline3& polyline, float offset, const OffsetParameters& params = {} );
125#endif
126
127}
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
Definition MRDotNet/MRBitSet.h:39
std::vector<T>-like container that requires specific indexing type,
Definition MRMesh/MRVector.h:19
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:589
Definition MRCameraOrientationPlugin.h:7
SignDetectionMode
how to determine the sign of distances from a mesh
Definition MRMesh/MRSignDetectionMode.h:8
@ OpenVDB
sign detection from OpenVDB library, which is good and fast if input geometry is closed
MRMESH_API Expected< Mesh > sharpOffsetMesh(const MeshPart &mp, float offset, const SharpOffsetParameters &params={})
MRMESH_API Expected< Mesh > offsetMesh(const MeshPart &mp, float offset, const OffsetParameters &params={})
MRMESH_API float suggestVoxelSize(const MeshPart &mp, float approxNumVoxels)
computes size of a cubical voxel to get approximately given number of voxels during rasterization
MRMESH_API Expected< Mesh > thickenMesh(const Mesh &mesh, float offset, const GeneralOffsetParameters &params={})
MRMESH_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...
MRMESH_API Expected< Mesh > offsetPolyline(const Polyline3 &polyline, float offset, const OffsetParameters &params={})
tl::expected< T, E > Expected
Definition MRExpected.h:49
MRMESH_API Expected< Mesh > mcShellMeshRegion(const Mesh &mesh, const FaceBitSet &region, float offset, const BaseShellParameters &params, Vector< VoxelId, FaceId > *outMap=nullptr)
MRMESH_API Expected< Mesh > doubleOffsetMesh(const MeshPart &mp, float offsetA, float offsetB, const OffsetParameters &params={})
MRMESH_API Expected< Mesh > mcOffsetMesh(const MeshPart &mp, float offset, const OffsetParameters &params={}, Vector< VoxelId, FaceId > *outMap=nullptr)
Definition MRMesh/MROffset.h:14
float voxelSize
Definition MRMesh/MROffset.h:17
ProgressCallback callBack
Progress callback.
Definition MRMesh/MROffset.h:20
allows the user to select in the parameters which offset algorithm to call
Definition MRMesh/MROffset.h:98
Mode mode
Definition MRMesh/MROffset.h:107
Mode
Definition MRMesh/MROffset.h:100
@ Sharpening
create mesh using standard marching cubes with additional sharpening implemented in MeshLib
@ Smooth
create mesh using dual marching cubes from OpenVDB library
@ Standard
create mesh using standard marching cubes implemented in MeshLib
Definition MRMesh/MRMeshPart.h:11
Definition MRMesh/MRMesh.h:23
Definition MRMesh/MROffset.h:27
std::shared_ptr< IFastWindingNumber > fwn
defines particular implementation of IFastWindingNumber interface that will compute windings....
Definition MRMesh/MROffset.h:41
SignDetectionMode signDetectionMode
determines the method to compute distance sign
Definition MRMesh/MROffset.h:29
float windingNumberThreshold
Definition MRMesh/MROffset.h:34
bool memoryEfficient
Definition MRMesh/MROffset.h:50
float windingNumberBeta
Definition MRMesh/MROffset.h:38
Definition MRMesh/MROffset.h:54
float maxNewRank2VertDev
maximal surface deviation to introduce new rank 2 vertex (on intersection of 2 planes),...
Definition MRMesh/MROffset.h:60
float maxNewRank3VertDev
maximal surface deviation to introduce new rank 3 vertex (on intersection of 3 planes),...
Definition MRMesh/MROffset.h:62
UndirectedEdgeBitSet * outSharpEdges
if non-null then created sharp edges will be saved here
Definition MRMesh/MROffset.h:56
float minNewVertDev
minimal surface deviation to introduce new vertex in a voxel, measured in voxelSize
Definition MRMesh/MROffset.h:58
float maxOldVertPosCorrection
Definition MRMesh/MROffset.h:65