MeshLib Documentation
Loading...
Searching...
No Matches
MRMesh/MRPrecisePredicates3.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRVector3.h"
4#include "MRId.h"
5
6#include <array>
7
8namespace MR
9{
10
13
16MRMESH_API bool orient3d( const Vector3i & a, const Vector3i & b, const Vector3i & c );
17
20inline bool orient3d( const Vector3i & a, const Vector3i & b, const Vector3i & c, const Vector3i & d )
21 { return orient3d( a - d, b - d, c - d ); }
22
24{
25 VertId id;
26 Vector3i pt;
27};
28
30MRMESH_API bool orient3d( const std::array<PreciseVertCoords, 4> & vs );
32
34{
35 bool doIntersect = false;
36 bool dIsLeftFromABC = false;
37
38 explicit operator bool() const { return doIntersect; }
39};
40
44 const std::array<PreciseVertCoords, 5> & vs );
45
47using ConvertToIntVector = std::function<Vector3i( const Vector3f& )>;
49using ConvertToFloatVector = std::function<Vector3f( const Vector3i& )>;
56
61
65 const Vector3f& a, const Vector3f& b, const Vector3f& c,
66 const Vector3f& d, const Vector3f& e,
67 CoordinateConverters converters );
68
70
71}
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
MRMESH_API bool orient3d(const Vector3i &a, const Vector3i &b, const Vector3i &c)
Definition MRCameraOrientationPlugin.h:8
MRMESH_API TriangleSegmentIntersectResult doTriangleSegmentIntersect(const std::array< PreciseVertCoords, 5 > &vs)
MRMESH_API ConvertToFloatVector getToFloatConverter(const Box3d &box)
creates converter from Vector3i to Vector3f in Box range (int diapason is mapped to box range)
std::function< Vector3f(const Vector3i &)> ConvertToFloatVector
int-to-float coordinate converter
Definition MRMesh/MRPrecisePredicates3.h:49
MRMESH_API Vector3f findTriangleSegmentIntersectionPrecise(const Vector3f &a, const Vector3f &b, const Vector3f &c, const Vector3f &d, const Vector3f &e, CoordinateConverters converters)
MRMESH_API ConvertToIntVector getToIntConverter(const Box3d &box)
creates converter from Vector3f to Vector3i in Box range (int diapason is mapped to box range)
std::function< Vector3i(const Vector3f &)> ConvertToIntVector
float-to-int coordinate converter
Definition MRMesh/MRPrecisePredicates3.h:47
this struct contains coordinate converters float-int-float
Definition MRMesh/MRPrecisePredicates3.h:52
ConvertToFloatVector toFloat
Definition MRMesh/MRPrecisePredicates3.h:54
ConvertToIntVector toInt
Definition MRMesh/MRPrecisePredicates3.h:53
Definition MRMesh/MRPrecisePredicates3.h:24
Vector3i pt
integer coordinates of the vertex
Definition MRMesh/MRPrecisePredicates3.h:26
VertId id
unique id of the vertex (in both meshes)
Definition MRMesh/MRPrecisePredicates3.h:25
Definition MRMesh/MRPrecisePredicates3.h:34
bool doIntersect
whether triangle and segment intersect
Definition MRMesh/MRPrecisePredicates3.h:35
bool dIsLeftFromABC
whether the plane with orientated triangle ABC has D point at the left
Definition MRMesh/MRPrecisePredicates3.h:36