MeshLib C++ Docs
Loading...
Searching...
No Matches
MRWeightedPointsShell.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRVoxelsFwd.h"
5#include "MRMarchingCubes.h"
6#include "MRMesh/MRExpected.h"
9#include "MRMesh/MRBitSet.h"
10#include "MRMesh/MRBox.h"
11#include "MRPch/MRBindingMacros.h"
12
14{
15
22
24[[nodiscard]] MRVOXELS_API FunctionVolume pointsToDistanceVolume( const PointCloud & cloud, const DistanceVolumeCreationParams& params );
25
27[[nodiscard]] MRVOXELS_API FunctionVolume meshToDistanceVolume( const Mesh & mesh, const DistanceVolumeCreationParams& params );
28using meshToDistanceVolumeT = std::function<FunctionVolume(const Mesh&, const DistanceVolumeCreationParams&)>;
29
31{
33 float offset = 0;
34
37 float voxelSize = 0;
38
40 float numLayers = 1.001f;
41
44
45
46 // To allow passing Python lambdas into `dist.pointWeight`.
47 MR_BIND_PREFER_UNLOCK_GIL_WHEN_USED_AS_PARAM
48};
49
55
57{
58 struct Region
59 {
60 VertBitSet verts;
61 float weight = 0.f;
62 };
63
66 std::vector<Region> regions;
67
71
74 bool bidirectionalMode = true;
75};
76
80// MR_BIND_IGNORE to hide this function in Python API because calling Python's Lambda will be extremely slow anyway
81[[nodiscard]] MR_BIND_IGNORE MRVOXELS_API Expected<Mesh> pointsShell( const PointCloud & cloud, const ParametersMetric& params );
82
86[[nodiscard]] MRVOXELS_API Expected<Mesh> pointsShell( const PointCloud & cloud, const VertScalars& pointWeights, const ParametersMetric& params );
87
91// MR_BIND_IGNORE to hide this function in Python API because calling Python's Lambda will be extremely slow anyway
92[[nodiscard]] MR_BIND_IGNORE MRVOXELS_API Expected<Mesh> meshShell( const Mesh & mesh, const ParametersMetric& params );
93
97[[nodiscard]] MRVOXELS_API Expected<Mesh> meshShell( const Mesh & mesh, const VertScalars& vertWeights, const ParametersMetric& params );
98
101 const Mesh& mesh, const std::vector<ParametersRegions::Region>& regions, float interpolationDist );
102
104[[nodiscard]] MRVOXELS_API Expected<Mesh> meshShell( const Mesh& mesh, const ParametersRegions& params );
105
107[[nodiscard]] MRVOXELS_API Expected<Mesh> meshShell( const Mesh& mesh, const ParametersRegions& params, meshToDistanceVolumeT volumeBuilder );
108
109} //namespace MR::WeightedShell
#define MRVOXELS_API
Definition MRVoxels/MRVoxelsFwd.h:13
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:663
Definition MRWeightedPointsShell.h:14
MRVOXELS_API FunctionVolume pointsToDistanceVolume(const PointCloud &cloud, const DistanceVolumeCreationParams &params)
makes FunctionVolume representing minimal distance to weighted points
MR_BIND_IGNORE MRVOXELS_API Expected< Mesh > pointsShell(const PointCloud &cloud, const ParametersMetric &params)
MRVOXELS_API FunctionVolume meshToDistanceVolume(const Mesh &mesh, const DistanceVolumeCreationParams &params)
makes FunctionVolume representing minimal distance to mesh with weighted vertices
MRVOXELS_API VertScalars calculateShellWeightsFromRegions(const Mesh &mesh, const std::vector< ParametersRegions::Region > &regions, float interpolationDist)
interpolate set of regions and assign weight to each vertex of the mesh
MR_BIND_IGNORE MRVOXELS_API Expected< Mesh > meshShell(const Mesh &mesh, const ParametersMetric &params)
std::function< FunctionVolume(const Mesh &, const DistanceVolumeCreationParams &)> meshToDistanceVolumeT
Definition MRWeightedPointsShell.h:28
tl::expected< T, E > Expected
Definition MRExpected.h:25
Definition MRClosestWeightedPoint.h:98
Definition MRClosestWeightedPoint.h:75
Definition MRDistanceVolumeParams.h:10
Definition MRMesh/MRMesh.h:22
Definition MRMesh/MRPointCloud.h:16
Definition MRWeightedPointsShell.h:17
DistanceVolumeParams vol
Definition MRWeightedPointsShell.h:18
DistanceFromWeightedPointsComputeParams dist
Definition MRWeightedPointsShell.h:20
Definition MRWeightedPointsShell.h:31
float numLayers
number of voxels to compute near the offset (should be left default unless used for debugging)
Definition MRWeightedPointsShell.h:40
ProgressCallback progress
Progress callback.
Definition MRWeightedPointsShell.h:43
float offset
build iso-surface of minimal distance to points corresponding to this value
Definition MRWeightedPointsShell.h:33
float voxelSize
Definition MRWeightedPointsShell.h:37
Definition MRWeightedPointsShell.h:51
DistanceFromWeightedPointsParams dist
parameters of distance finding
Definition MRWeightedPointsShell.h:53
Definition MRWeightedPointsShell.h:59
VertBitSet verts
Definition MRWeightedPointsShell.h:60
float weight
Definition MRWeightedPointsShell.h:61
Definition MRWeightedPointsShell.h:57
float interpolationDist
Definition MRWeightedPointsShell.h:70
bool bidirectionalMode
Definition MRWeightedPointsShell.h:74
std::vector< Region > regions
Definition MRWeightedPointsShell.h:66