MeshLib Documentation
Loading...
Searching...
No Matches
MRGeodesicPath.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4#include <vector>
5
6namespace MR
7{
8
12
16template<typename T>
17Vector2<T> unfoldOnPlane( const Vector3<T>& b, const Vector3<T>& c, const Vector2<T>& d, bool toLeftFrom0d );
18
22template<typename T>
23T shortestPathInQuadrangle( const Vector3<T>& a, const Vector3<T>& b, const Vector3<T>& c, const Vector3<T>& d );
24
27template<typename T>
28bool isUnfoldQuadrangleConvex( const Vector3<T>& a, const Vector3<T>& b, const Vector3<T>& c, const Vector3<T>& d )
29{
30 auto x = shortestPathInQuadrangle( a, b, c, d );
31 return x > 0 && x < 1; // if path goes via vertices A or C then the quadrangle is concave or degenerated to triangle
32}
33
38MRMESH_API bool reducePathViaVertex( const Mesh & mesh, const MeshTriPoint & start, VertId v, const MeshTriPoint & end,
39 SurfacePath & outPath, std::vector<Vector2f> & tmp, SurfacePath& cachePath );
40
43MRMESH_API int reducePath( const Mesh & mesh, const MeshTriPoint & start, SurfacePath & path, const MeshTriPoint & end, int maxIter = 5 );
44
46
47} // namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
auto end(const BitSet &)
Definition MRMesh/MRBitSet.h:282
MRMESH_API int reducePath(const Mesh &mesh, const MeshTriPoint &start, SurfacePath &path, const MeshTriPoint &end, int maxIter=5)
MRMESH_API bool reducePathViaVertex(const Mesh &mesh, const MeshTriPoint &start, VertId v, const MeshTriPoint &end, SurfacePath &outPath, std::vector< Vector2f > &tmp, SurfacePath &cachePath)
T shortestPathInQuadrangle(const Vector3< T > &a, const Vector3< T > &b, const Vector3< T > &c, const Vector3< T > &d)
bool isUnfoldQuadrangleConvex(const Vector3< T > &a, const Vector3< T > &b, const Vector3< T > &c, const Vector3< T > &d)
Definition MRGeodesicPath.h:28
Vector2< T > unfoldOnPlane(const Vector3< T > &b, const Vector3< T > &c, const Vector2< T > &d, bool toLeftFrom0d)
Definition MRCameraOrientationPlugin.h:8
std::vector< MeshEdgePoint > SurfacePath
Definition MRMesh/MRMeshFwd.h:350
Definition MRMesh/MRMeshTriPoint.h:23
Definition MRMesh/MRMesh.h:23
Definition MRVector2.h:18
Definition MRMesh/MRVector3.h:19