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{
14
15struct BaseShellParameters
16{
19 float voxelSize = 0;
20
22 ProgressCallback callBack;
23};
24
26[[nodiscard]] MRVOXELS_API float suggestVoxelSize( const MeshPart & mp, float approxNumVoxels );
27
29{
31 SignDetectionMode signDetectionMode = SignDetectionMode::OpenVDB;
32
35
39 float windingNumberThreshold = 0.5f;
40
43 float windingNumberBeta = 2;
44
48 std::shared_ptr<IFastWindingNumber> fwn;
49
57 bool memoryEfficient = true;
58};
59
60struct SharpOffsetParameters : OffsetParameters
61{
63 UndirectedEdgeBitSet* outSharpEdges = nullptr;
65 float minNewVertDev = 1.0f / 25;
67 float maxNewRank2VertDev = 5;
69 float maxNewRank3VertDev = 2;
72 float maxOldVertPosCorrection = 0.5f;
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
102struct GeneralOffsetParameters : SharpOffsetParameters
103{
104 using Mode = MR::OffsetMode;
105 Mode mode = Mode::Standard;
106};
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 MRVoxelsFwd.h:14
Definition MROffset.h:16
new unsafe MR.Std.Function_BoolFuncFromFloat callBack
new unsafe ref float voxelSize
Definition MROffset.h:103
Definition MRMesh/MRMesh.h:23
Definition MROffset.h:29
new unsafe ref bool closeHolesInHoleWindingNumber
new unsafe ref float windingNumberBeta
new unsafe ref bool memoryEfficient
new unsafe MR.IFastWindingNumber fwn
new unsafe ref MR.SignDetectionMode signDetectionMode
new unsafe ref float windingNumberThreshold
Definition MROffset.h:61
new unsafe ref float minNewVertDev
new unsafe ref float maxOldVertPosCorrection
new unsafe MR.? UndirectedEdgeBitSet outSharpEdges
new unsafe ref float maxNewRank2VertDev
new unsafe ref float maxNewRank3VertDev
std::vector<T>-like container that requires specific indexing type,
Definition MRVector.h:19
Definition MRCameraOrientationPlugin.h:8
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)
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={})
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={})