MeshLib C++ Docs
Loading...
Searching...
No Matches
MRAlphaShape.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
5#include "MRFastInt128.h"
6#include "MRVector.h"
7#include "MRPch/MRBindingMacros.h"
8#include <cstddef>
9#include <optional>
10
11namespace MR
12{
15
16
19
24{
27
31
35 std::int64_t intRadiusSq = 0;
36
39 float searchRadius = 0;
40
43 [[nodiscard]] MRMESH_API PreciseVertCoords coords( const PointCloud & cloud, VertId v ) const;
44};
45
49[[nodiscard]] MRMESH_API AlphaShapeData getAlphaShapeData( const PointCloud & cloud, float radius, bool allPoints );
50
55{
59 std::size_t collectedNeis = 0;
60
63 std::size_t redundancyTests = 0;
64
66 std::size_t redundantNeis = 0;
67
70 std::size_t consideredTris = 0;
71
74 std::size_t touchableTris = 0;
75
79 std::size_t inBallTests = 0;
80
82 std::size_t shadowTests = 0;
83
86 std::size_t exactShadowTests = 0;
87
89 std::size_t shadowedNeis = 0;
90
104};
105
115
122 const AlphaShapeData & data,
123 Triangulation & appendTris,
124 std::vector<AlphaShapeNei> & neis,
125 bool onlyLargerVids,
126 AlphaShapeStats * stats = nullptr );
127
129[[nodiscard]] MRMESH_API std::optional<Triangulation> findAlphaShapeAllTriangles( const PointCloud & cloud, float radius,
130 const ProgressCallback & cb, AlphaShapeStats * stats = nullptr );
131[[nodiscard]] MRMESH_API Triangulation findAlphaShapeAllTriangles( const PointCloud & cloud, float radius,
132 AlphaShapeStats * stats = nullptr );
133
136[[nodiscard]] MRMESH_API std::optional<Triangulation> findAlphaShapeAllTriangles( const PointCloud & cloud,
137 const AlphaShapeData & data, const ProgressCallback & cb, AlphaShapeStats * stats = nullptr );
138
142[[nodiscard]] MRMESH_API std::optional<Mesh> findAlphaShape( const PointCloud & cloud, float radius,
143 const ProgressCallback & cb, std::vector<MeshBuilder::VertDuplication> * dups = nullptr, AlphaShapeStats * stats = nullptr );
144[[nodiscard]] MRMESH_API Mesh findAlphaShape( const PointCloud & cloud, float radius,
145 std::vector<MeshBuilder::VertDuplication> * dups = nullptr, AlphaShapeStats * stats = nullptr );
146
147}
#define MRMESH_API
Definition MRMeshFwd.h:85
std::vector<T>-like container that requires specific indexing type,
Definition MRVector.h:23
std::function< bool(float)> ProgressCallback
Definition MRMeshFwd.h:759
std::size_t collectedNeis
Definition MRAlphaShape.h:59
std::size_t redundancyTests
Definition MRAlphaShape.h:63
std::size_t redundantNeis
the number of neighbours found redundant by those checks and excluded from the search
Definition MRAlphaShape.h:66
AlphaShapeData getAlphaShapeData(const PointCloud &cloud, float radius, bool allPoints)
std::size_t consideredTris
Definition MRAlphaShape.h:70
__int128_t FastInt128
Definition MRFastInt128.h:25
void findAlphaShapeNeiTriangles(const PointCloud &cloud, VertId v, const AlphaShapeData &data, Triangulation &appendTris, std::vector< AlphaShapeNei > &neis, bool onlyLargerVids, AlphaShapeStats *stats=nullptr)
optional statistics of the work done, which is increased here
std::size_t inBallTests
Definition MRAlphaShape.h:79
ConvertToIntVector toInt
converts cloud's points in integer coordinates
Definition MRAlphaShape.h:26
Vector< Vector3i, VertId > intPoints
Definition MRAlphaShape.h:30
std::size_t touchableTris
Definition MRAlphaShape.h:74
AlphaShapeStats & operator+=(const AlphaShapeStats &r)
Definition MRAlphaShape.h:91
MR_BIND_IGNORE FastInt128 distSq
the exact squared distance from v in the units of the same integer grid
Definition MRAlphaShape.h:113
PreciseVertCoords coords
the neighbour's id together with its integer coordinates
Definition MRAlphaShape.h:110
std::int64_t intRadiusSq
Definition MRAlphaShape.h:35
std::size_t shadowTests
the number of neighbours tested for being shadowed by the balls of a touchable triangle
Definition MRAlphaShape.h:82
PreciseVertCoords coords(const PointCloud &cloud, VertId v) const
std::size_t shadowedNeis
the number of neighbours found shadowed, which are excluded from the search
Definition MRAlphaShape.h:89
std::array< Vector3f, 3 > MR_BIND_IGNORE
Definition MRMeshBuilderTypes.h:13
std::optional< Mesh > findAlphaShape(const PointCloud &cloud, float radius, const ProgressCallback &cb, std::vector< MeshBuilder::VertDuplication > *dups=nullptr, AlphaShapeStats *stats=nullptr)
float searchRadius
Definition MRAlphaShape.h:39
std::size_t exactShadowTests
Definition MRAlphaShape.h:86
std::optional< Triangulation > findAlphaShapeAllTriangles(const PointCloud &cloud, float radius, const ProgressCallback &cb, AlphaShapeStats *stats=nullptr)
finds all triangles of alpha-shape with negative alpha = -1/radius
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRAlphaShape.h:24
a neighbour of the point v in the search of alpha-shape triangles around it
Definition MRAlphaShape.h:108
Definition MRAlphaShape.h:55
translate then scale float-to-int coordinate converter
Definition MRPrecisePredicates3.h:99
Definition MRMesh.h:24
Definition MRPointCloud.h:17
Definition MRPrecisePredicates3.h:37