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
17{
19
21};
22
25
28using meshToDistanceVolumeT = std::function<FunctionVolume(const Mesh&, const DistanceVolumeCreationParams&)>;
29
30struct ParametersBase
31{
33 float offset = 0;
34
37 float voxelSize = 0;
38
40 float numLayers = 1.001f;
41
43 ProgressCallback progress;
44
45
46 // To allow passing Python lambdas into `dist.pointWeight`.
47 MR_BIND_PREFER_UNLOCK_GIL_WHEN_USED_AS_PARAM
48};
49
50struct ParametersMetric : ParametersBase
51{
54};
55
56struct ParametersRegions : ParametersBase
57{
58 struct Region
59 {
61 float weight = 0.f;
62 };
63
66 std::vector<Region> regions;
67
70 float interpolationDist = 0;
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 MRVoxelsFwd.h:14
Definition MRClosestWeightedPoint.h:102
Definition MRClosestWeightedPoint.h:75
Definition MRDistanceVolumeParams.h:10
Definition MRMesh/MRMesh.h:23
Definition MRMesh/MRPointCloud.h:17
Definition MRWeightedPointsShell.h:17
Definition MRWeightedPointsShell.h:31
new unsafe ref float voxelSize
new unsafe MR.Std.Function_BoolFuncFromFloat progress
new unsafe ref float numLayers
Definition MRWeightedPointsShell.h:51
new unsafe MR.DistanceFromWeightedPointsParams dist
Definition MRWeightedPointsShell.h:57
new unsafe ref float interpolationDist
new unsafe MR.Std.Vector_MRWeightedShellParametersRegionsRegion regions
new unsafe ref bool bidirectionalMode
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)
Definition MRWeightedPointsShell.h:59
VertBitSet verts
Definition MRWeightedPointsShell.h:60
float weight
Definition MRWeightedPointsShell.h:61