MeshLib Documentation
Loading...
Searching...
No Matches
Planar Path

Functions

template<typename T >
Vector2< T > MR::unfoldOnPlane (const Vector3< T > &b, const Vector3< T > &c, const Vector2< T > &d, bool toLeftFrom0d)
 
template<typename T >
MR::shortestPathInQuadrangle (const Vector3< T > &a, const Vector3< T > &b, const Vector3< T > &c, const Vector3< T > &d)
 
template<typename T >
bool MR::isUnfoldQuadrangleConvex (const Vector3< T > &a, const Vector3< T > &b, const Vector3< T > &c, const Vector3< T > &d)
 
MRMESH_API bool MR::reducePathViaVertex (const Mesh &mesh, const MeshTriPoint &start, VertId v, const MeshTriPoint &end, SurfacePath &outPath, std::vector< Vector2f > &tmp, SurfacePath &cachePath)
 
MRMESH_API int MR::reducePath (const Mesh &mesh, const MeshTriPoint &start, SurfacePath &path, const MeshTriPoint &end, int maxIter=5)
 

Detailed Description

Function Documentation

◆ isUnfoldQuadrangleConvex()

template<typename T >
bool MR::isUnfoldQuadrangleConvex ( const Vector3< T > & a,
const Vector3< T > & b,
const Vector3< T > & c,
const Vector3< T > & d )

given two 3D triangles ABC and ACD with shared edge AC, returns true if after unfolding into plane they form a convex quadrangle

◆ reducePath()

MRMESH_API int MR::reducePath ( const Mesh & mesh,
const MeshTriPoint & start,
SurfacePath & path,
const MeshTriPoint & end,
int maxIter = 5 )

converts any input surface path into geodesic path (so reduces its length): start-path-end; returns actual number of iterations performed

◆ reducePathViaVertex()

MRMESH_API bool MR::reducePathViaVertex ( const Mesh & mesh,
const MeshTriPoint & start,
VertId v,
const MeshTriPoint & end,
SurfacePath & outPath,
std::vector< Vector2f > & tmp,
SurfacePath & cachePath )

given path s-v-e, tries to decrease its length by moving away from v

Parameters
outPathintermediate locations between s and e will be added here
tmpelements will be temporary allocated here
cachePathas far as we need two sides unfold, cache one to reduce allocations

◆ shortestPathInQuadrangle()

template<typename T >
T MR::shortestPathInQuadrangle ( const Vector3< T > & a,
const Vector3< T > & b,
const Vector3< T > & c,
const Vector3< T > & d )

given two 3D triangles ABC and ACD with shared edge AC, returns the relative position x in [0,1] on edge AC (x=0 means A and x=1 means C), where the shortest path from B to D crosses edge AC

◆ unfoldOnPlane()

template<typename T >
Vector2< T > MR::unfoldOnPlane ( const Vector3< T > & b,
const Vector3< T > & c,
const Vector2< T > & d,
bool toLeftFrom0d )

given triangle 0bc in 3D and line segment 0d in 2D, and |0b|=|0d|; finds e, such that triangle 0bc is equal to 0de; returns (0,0) if |0b|=0