MeshLib Documentation
Loading...
Searching...
No Matches
MRMeshDistance.h
Go to the documentation of this file.
1#pragma once
2
3// distance queries to one mesh only, please see MRMeshMeshDistance.h for queries involving two meshes
4
5#include "MRMeshPart.h"
7#include <cfloat>
8#include <functional>
9#include <optional>
10
11namespace MR
12{
13
16
17enum class ProcessOneResult : bool
18{
19 StopProcessing = false,
21};
22
29using TriangleCallback = std::function<ProcessOneResult( const Vector3f & p, FaceId f, const Vector3f & q, float distSq )>;
30
33MRMESH_API void processCloseTriangles( const MeshPart& mp, const Triangle3f & t, float rangeSq, const TriangleCallback & call );
34
55
58[[nodiscard]] MRMESH_API std::optional<float> signedDistanceToMesh( const MeshPart& mp, const Vector3f& p, const DistanceToMeshOptions& op );
59
61
62} // namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
MRMESH_API std::optional< float > signedDistanceToMesh(const MeshPart &mp, const Vector3f &p, const DistanceToMeshOptions &op)
std::function< ProcessOneResult(const Vector3f &p, FaceId f, const Vector3f &q, float distSq)> TriangleCallback
Definition MRMeshDistance.h:29
ProcessOneResult
Definition MRMeshDistance.h:18
MRMESH_API void processCloseTriangles(const MeshPart &mp, const Triangle3f &t, float rangeSq, const TriangleCallback &call)
Definition MRCameraOrientationPlugin.h:8
SignDetectionMode
how to determine the sign of distances from a mesh
Definition MRMesh/MRSignDetectionMode.h:10
@ ProjectionNormal
the sign is determined based on pseudonormal in closest mesh point (unsafe in case of self-intersecti...
Triangle3< float > Triangle3f
Definition MRMesh/MRMeshFwd.h:337
Definition MRMeshDistance.h:36
float windingNumberThreshold
Definition MRMeshDistance.h:49
float windingNumberBeta
Definition MRMeshDistance.h:53
SignDetectionMode signMode
the method to compute distance sign
Definition MRMeshDistance.h:44
float minDistSq
minimum squared distance from a point to mesh
Definition MRMeshDistance.h:38
float maxDistSq
maximum squared distance from a point to mesh
Definition MRMeshDistance.h:41