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{
11
13[[nodiscard]] MRMESH_API std::optional<VertScalars> computeRayThicknessAtVertices( const Mesh& mesh, const ProgressCallback & progress = {} );
14[[deprecated]] MRMESH_API MR_BIND_IGNORE VertScalars computeThicknessAtVertices( const Mesh& mesh );
15
17struct MeshPoint
18{
20 Vector3f pt;
22 FacePredicate notIncidentFaces;
23
24 MRMESH_API void set( const Mesh& mesh, const MeshTriPoint & p );
25};
26
28[[nodiscard]] MRMESH_API MeshIntersectionResult rayInsideIntersect( const Mesh& mesh, const MeshPoint & m, float rayEnd = FLT_MAX );
29[[nodiscard]] MRMESH_API MeshIntersectionResult rayInsideIntersect( const Mesh& mesh, VertId v, float rayEnd = FLT_MAX );
30
31// Shrinking sphere: A parallel algorithm for computing the thickness of 3D objects
32// https://www.cad-journal.net/files/vol_13/CAD_13(2)_2016_199-207.pdf
33
36{
40 bool insideAndOutside = false;
41
44 float maxRadius = 1;
45
47 int maxIters = 16;
48
50 float minShrinkage = 0.99999f;
51
57 float minAngleCos = -1;
58};
59
61struct InSphere
62{
63 Vector3f center;
64 float radius = 0;
65 MeshProjectionResult oppositeTouchPoint;
66};
67
69[[nodiscard]] MRMESH_API InSphere findInSphere( const Mesh& mesh, const MeshPoint & m, const InSphereSearchSettings & settings );
70[[nodiscard]] MRMESH_API InSphere findInSphere( const Mesh& mesh, VertId v, const InSphereSearchSettings & settings );
71
73[[nodiscard]] MRMESH_API std::optional<VertScalars> computeInSphereThicknessAtVertices( const Mesh& mesh,
74 const InSphereSearchSettings & settings, const ProgressCallback & progress = {} );
75
76} // namespace MR
#define MRMESH_API
Definition MRMeshFwd.h:80
Definition MRMeshThickness.h:36
new unsafe ref float minShrinkage
new unsafe ref float maxRadius
new unsafe ref float minAngleCos
new unsafe ref int maxIters
new unsafe ref bool insideAndOutside
Definition MRMeshThickness.h:62
new unsafe ref float radius
Definition MRMeshIntersect.h:18
Definition MRMeshThickness.h:18
new unsafe ref MR.Vector3f inDir
new unsafe MR.MeshTriPoint triPoint
unsafe void set(MR.Const_Mesh mesh, MR.Const_MeshTriPoint p)
new unsafe ref MR.Vector3f pt
Definition MRMeshTriPoint.h:23
Definition MRMesh/MRMesh.h:23
Definition MRCameraOrientationPlugin.h:8
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 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)