MeshLib
 
Loading...
Searching...
No Matches
Surface Path

Classes

struct  MR::ComputeSteepestDescentPathSettings
 

Enumerations

enum class  MR::PathError { MR::PathError::StartEndNotConnected , MR::PathError::InternalError }
 
enum class  MR::GeodesicPathApprox : char { MR::GeodesicPathApprox::DijkstraBiDir , MR::GeodesicPathApprox::DijkstraAStar , MR::GeodesicPathApprox::FastMarching }
 the algorithm to compute approximately geodesic path More...
 
enum class  MR::ExtremeEdgeType { MR::ExtremeEdgeType::Ridge , MR::ExtremeEdgeType::Gorge }
 

Functions

std::string MR::toString (PathError error)
 
MRMESH_API Expected< SurfacePath, PathErrorMR::computeSurfacePath (const MeshPart &mp, const MeshTriPoint &start, const MeshTriPoint &end, int maxGeodesicIters=5, const VertBitSet *vertRegion=nullptr, VertScalars *outSurfaceDistances=nullptr)
 
MRMESH_API Expected< SurfacePath, PathErrorMR::computeGeodesicPath (const Mesh &mesh, const MeshTriPoint &start, const MeshTriPoint &end, GeodesicPathApprox atype, int maxGeodesicIters=100)
 the maximum number of iterations to reduce approximate path length and convert it in geodesic path
 
MRMESH_API Expected< SurfacePath, PathErrorMR::computeGeodesicPathApprox (const Mesh &mesh, const MeshTriPoint &start, const MeshTriPoint &end, GeodesicPathApprox atype)
 
MRMESH_API Expected< SurfacePath, PathErrorMR::computeFastMarchingPath (const MeshPart &mp, const MeshTriPoint &start, const MeshTriPoint &end, const VertBitSet *vertRegion=nullptr, VertScalars *outSurfaceDistances=nullptr)
 
MRMESH_API SurfacePath MR::computeSteepestDescentPath (const MeshPart &mp, const VertScalars &field, const MeshTriPoint &start, const ComputeSteepestDescentPathSettings &settings={})
 
MRMESH_API void MR::computeSteepestDescentPath (const MeshPart &mp, const VertScalars &field, const MeshTriPoint &start, SurfacePath *outPath, const ComputeSteepestDescentPathSettings &settings={})
 
MRMESH_API MeshEdgePoint MR::findSteepestDescentPoint (const MeshPart &mp, const VertScalars &field, VertId v)
 finds the point along minus maximal gradient on the boundary of first ring boundary around given vertex
 
MRMESH_API MeshEdgePoint MR::findSteepestDescentPoint (const MeshPart &mp, const VertScalars &field, const MeshEdgePoint &ep)
 finds the point along minus maximal gradient on the boundary of triangles around given point (the boundary of left and right edge triangles' union in case (ep) is inner edge point)
 
MRMESH_API MeshEdgePoint MR::findSteepestDescentPoint (const MeshPart &mp, const VertScalars &field, const MeshTriPoint &tp)
 finds the point along minus maximal gradient on the boundary of triangles around given point (the boundary of the triangle itself in case (tp) is inner triangle point)
 
MRMESH_API UndirectedEdgeBitSet MR::findExtremeEdges (const Mesh &mesh, const VertScalars &field, ExtremeEdgeType type)
 computes all edges in the mesh, where the field not-increases both in left and right triangles
 
MRMESH_API HashMap< VertId, VertIdMR::computeClosestSurfacePathTargets (const Mesh &mesh, const VertBitSet &starts, const VertBitSet &ends, const VertBitSet *vertRegion=nullptr, VertScalars *outSurfaceDistances=nullptr)
 
MRMESH_API SurfacePaths MR::getSurfacePathsViaVertices (const Mesh &mesh, const VertBitSet &vs)
 
MRMESH_API float MR::surfacePathLength (const Mesh &mesh, const SurfacePath &surfacePath)
 computes the length of surface path
 
MRMESH_API Contour3f MR::surfacePathToContour3f (const Mesh &mesh, const SurfacePath &line)
 converts lines on mesh in 3D contours by computing coordinate of each point
 
MRMESH_API Contours3f MR::surfacePathsToContours3f (const Mesh &mesh, const SurfacePaths &lines)
 

Detailed Description

Enumeration Type Documentation

◆ ExtremeEdgeType

enum class MR::ExtremeEdgeType
strong
Enumerator
Ridge 
Gorge 

◆ GeodesicPathApprox

enum class MR::GeodesicPathApprox : char
strong

the algorithm to compute approximately geodesic path

Enumerator
DijkstraBiDir 

compute edge-only path by building it from start and end simultaneously

DijkstraAStar 

compute edge-only path using A*-search algorithm

FastMarching 

use Fast Marching algorithm

◆ PathError

enum class MR::PathError
strong
Enumerator
StartEndNotConnected 

no path can be found from start to end, because they are not from the same connected component

InternalError 

report to developers for investigation

Function Documentation

◆ computeClosestSurfacePathTargets()

MRMESH_API HashMap< VertId, VertId > MR::computeClosestSurfacePathTargets ( const Mesh & mesh,
const VertBitSet & starts,
const VertBitSet & ends,
const VertBitSet * vertRegion = nullptr,
VertScalars * outSurfaceDistances = nullptr )

for each vertex from (starts) finds the closest vertex from (ends) in geodesic sense

Parameters
vertRegionconsider paths going in this region only

◆ computeFastMarchingPath()

MRMESH_API Expected< SurfacePath, PathError > MR::computeFastMarchingPath ( const MeshPart & mp,
const MeshTriPoint & start,
const MeshTriPoint & end,
const VertBitSet * vertRegion = nullptr,
VertScalars * outSurfaceDistances = nullptr )

computes by Fast Marching method and returns intermediate points of approximately geodesic path from start to end, where it crosses mesh edges; the path can be limited to given region: in face-format inside mp, or in vert-format in vertRegion argument

◆ computeGeodesicPath()

MRMESH_API Expected< SurfacePath, PathError > MR::computeGeodesicPath ( const Mesh & mesh,
const MeshTriPoint & start,
const MeshTriPoint & end,
GeodesicPathApprox atype,
int maxGeodesicIters = 100 )

the maximum number of iterations to reduce approximate path length and convert it in geodesic path

returns intermediate points of the geodesic path from start to end, where it crosses mesh edges; It is the same as calling computeGeodesicPathApprox() then reducePath()

◆ computeGeodesicPathApprox()

MRMESH_API Expected< SurfacePath, PathError > MR::computeGeodesicPathApprox ( const Mesh & mesh,
const MeshTriPoint & start,
const MeshTriPoint & end,
GeodesicPathApprox atype )

computes by given method and returns intermediate points of approximately geodesic path from start to end, every next point is located in the same triangle with the previous point

◆ computeSteepestDescentPath() [1/2]

MRMESH_API SurfacePath MR::computeSteepestDescentPath ( const MeshPart & mp,
const VertScalars & field,
const MeshTriPoint & start,
const ComputeSteepestDescentPathSettings & settings = {} )
nodiscard

computes the path (edge points crossed by the path) staring in given point and moving in each triangle in minus gradient direction of given field; the path stops when it reaches a local minimum in the field or one of stop conditions in settings

◆ computeSteepestDescentPath() [2/2]

MRMESH_API void MR::computeSteepestDescentPath ( const MeshPart & mp,
const VertScalars & field,
const MeshTriPoint & start,
SurfacePath * outPath,
const ComputeSteepestDescentPathSettings & settings = {} )

computes the path (edge points crossed by the path) staring in given point and moving in each triangle in minus gradient direction of given field, and outputs the path in

Parameters
outPathif requested; the path stops when it reaches a local minimum in the field or one of stop conditions in settings

◆ computeSurfacePath()

MRMESH_API Expected< SurfacePath, PathError > MR::computeSurfacePath ( const MeshPart & mp,
const MeshTriPoint & start,
const MeshTriPoint & end,
int maxGeodesicIters = 5,
const VertBitSet * vertRegion = nullptr,
VertScalars * outSurfaceDistances = nullptr )

returns intermediate points of the geodesic path from start to end, where it crosses mesh edges; the path can be limited to given region: in face-format inside mp, or in vert-format in vertRegion argument. It is the same as calling computeFastMarchingPath() then reducePath()

Parameters
maxGeodesicItersthe maximum number of iterations to reduce approximate path length and convert it in geodesic path

◆ findExtremeEdges()

MRMESH_API UndirectedEdgeBitSet MR::findExtremeEdges ( const Mesh & mesh,
const VertScalars & field,
ExtremeEdgeType type )
nodiscard

computes all edges in the mesh, where the field not-increases both in left and right triangles

◆ findSteepestDescentPoint() [1/3]

MRMESH_API MeshEdgePoint MR::findSteepestDescentPoint ( const MeshPart & mp,
const VertScalars & field,
const MeshEdgePoint & ep )
nodiscard

finds the point along minus maximal gradient on the boundary of triangles around given point (the boundary of left and right edge triangles' union in case (ep) is inner edge point)

◆ findSteepestDescentPoint() [2/3]

MRMESH_API MeshEdgePoint MR::findSteepestDescentPoint ( const MeshPart & mp,
const VertScalars & field,
const MeshTriPoint & tp )
nodiscard

finds the point along minus maximal gradient on the boundary of triangles around given point (the boundary of the triangle itself in case (tp) is inner triangle point)

◆ findSteepestDescentPoint() [3/3]

MRMESH_API MeshEdgePoint MR::findSteepestDescentPoint ( const MeshPart & mp,
const VertScalars & field,
VertId v )
nodiscard

finds the point along minus maximal gradient on the boundary of first ring boundary around given vertex

◆ getSurfacePathsViaVertices()

MRMESH_API SurfacePaths MR::getSurfacePathsViaVertices ( const Mesh & mesh,
const VertBitSet & vs )

returns a set of mesh lines passing via most of given vertices in auto-selected order; the lines try to avoid sharp turns in the vertices

◆ surfacePathLength()

MRMESH_API float MR::surfacePathLength ( const Mesh & mesh,
const SurfacePath & surfacePath )

computes the length of surface path

◆ surfacePathsToContours3f()

MRMESH_API Contours3f MR::surfacePathsToContours3f ( const Mesh & mesh,
const SurfacePaths & lines )

◆ surfacePathToContour3f()

MRMESH_API Contour3f MR::surfacePathToContour3f ( const Mesh & mesh,
const SurfacePath & line )

converts lines on mesh in 3D contours by computing coordinate of each point

◆ toString()

std::string MR::toString ( PathError error)
inline