MeshLib C++ Docs
Loading...
Searching...
No Matches
MRMeshThickness.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRPch/MRBindingMacros.h"
4#include "MRMeshFwd.h"
5#include "MRMeshProject.h"
6#include <cfloat>
7#include <optional>
8
9namespace MR
10{
13
14
16[[nodiscard]] MRMESH_API std::optional<VertScalars> computeRayThicknessAtVertices( const Mesh& mesh, const ProgressCallback & progress = {} );
17[[deprecated]] MRMESH_API MR_BIND_IGNORE VertScalars computeThicknessAtVertices( const Mesh& mesh );
18
21{
23 Vector3f pt;
24 Vector3f inDir;
25 FacePredicate notIncidentFaces;
26
27 MRMESH_API void set( const Mesh& mesh, const MeshTriPoint & p );
28};
29
31[[nodiscard]] MRMESH_API MeshIntersectionResult rayInsideIntersect( const Mesh& mesh, const MeshPoint & m, float rayEnd = FLT_MAX );
32[[nodiscard]] MRMESH_API MeshIntersectionResult rayInsideIntersect( const Mesh& mesh, VertId v, float rayEnd = FLT_MAX );
33
36
39{
43 bool insideAndOutside = false;
44
47 float maxRadius = 1;
48
50 int maxIters = 16;
51
53 float minShrinkage = 0.99999f;
54
60 float minAngleCos = -1;
61};
62
70
72[[nodiscard]] MRMESH_API InSphere findInSphere( const Mesh& mesh, const MeshPoint & m, const InSphereSearchSettings & settings );
73[[nodiscard]] MRMESH_API InSphere findInSphere( const Mesh& mesh, VertId v, const InSphereSearchSettings & settings );
74
76[[nodiscard]] MRMESH_API std::optional<VertScalars> computeInSphereThicknessAtVertices( const Mesh& mesh,
77 const InSphereSearchSettings & settings, const ProgressCallback & progress = {} );
78
79}
bool insideAndOutside
Definition MRMeshThickness.h:43
int maxIters
maximum number of shrinking iterations for one triangle
Definition MRMeshThickness.h:50
MRMESH_API InSphere findInSphere(const Mesh &mesh, const MeshPoint &m, const InSphereSearchSettings &settings)
finds maximal sphere inscribed in the mesh touching point (p) with center along the normal at (p)
MRMESH_API std::optional< VertScalars > computeInSphereThicknessAtVertices(const Mesh &mesh, const InSphereSearchSettings &settings, const ProgressCallback &progress={})
returns the thickness at each vertex as the diameter of the maximal inscribed sphere
MRMESH_API void set(const Mesh &mesh, const MeshTriPoint &p)
Vector3f pt
3d coordinates
Definition MRMeshThickness.h:23
float minShrinkage
iterations stop if next radius is larger than minShrinkage times previous radius
Definition MRMeshThickness.h:53
float maxRadius
Definition MRMeshThickness.h:47
float radius
Definition MRMeshThickness.h:67
MRMESH_API std::optional< VertScalars > computeRayThicknessAtVertices(const Mesh &mesh, const ProgressCallback &progress={})
returns the distance from each vertex along minus normal to the nearest mesh intersection (or FLT_MAX...
MRMESH_API MeshIntersectionResult rayInsideIntersect(const Mesh &mesh, const MeshPoint &m, float rayEnd=FLT_MAX)
returns the nearest intersection between the mesh and the ray from given point along minus normal (in...
MRMESH_API MR_BIND_IGNORE VertScalars computeThicknessAtVertices(const Mesh &mesh)
MeshProjectionResult oppositeTouchPoint
excluding input point and incident triangles, distSq - squared distance to sphere's center
Definition MRMeshThickness.h:68
MeshTriPoint triPoint
relative position on mesh
Definition MRMeshThickness.h:22
FacePredicate notIncidentFaces
predicate that returns true for mesh faces not-incident to the point
Definition MRMeshThickness.h:25
float minAngleCos
Definition MRMeshThickness.h:60
std::array< Vector3f, 3 > MR_BIND_IGNORE
Definition MRMeshBuilderTypes.h:13
Vector3f center
Definition MRMeshThickness.h:66
Vector3f inDir
unit direction inside the mesh = minus normal
Definition MRMeshThickness.h:24
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
controls the finding of maximal inscribed sphere in mesh
Definition MRMeshThickness.h:39
found maximal inscribed sphere touching input point with center along given direction
Definition MRMeshThickness.h:65
Definition MRMeshIntersect.h:18
describes the point of measurement on mesh
Definition MRMeshThickness.h:21
Definition MRMeshProject.h:18
Definition MRMeshTriPoint.h:26
Definition MRMesh.h:23