MeshLib C++ Docs
Loading...
Searching...
No Matches

Classes

struct  MR::GeodesicPath
struct  MR::ComputeSteepestDescentPathSettings

Enumerations

enum class  MR::PathError { MR::PathError::StartEndNotConnected , MR::PathError::InternalError }
enum class  MR::ExtremeEdgeType { MR::ExtremeEdgeType::Ridge , MR::ExtremeEdgeType::Gorge }

Functions

std::string MR::toString (PathError error)
Expected< SurfacePath, PathError > MR::computeSurfacePath (const MeshPart &mp, const MeshTriPoint &start, const MeshTriPoint &end, int maxGeodesicIters=5, const VertBitSet *vertRegion=nullptr, VertScalars *outSurfaceDistances=nullptr)
Expected< SurfacePath, PathError > MR::computeGeodesicPath (const Mesh &mesh, const MeshTriPoint &start, const MeshTriPoint &end, GeodesicPathApprox atype=GeodesicPathApprox::FastMarching, int maxGeodesicIters=100)
 the maximum number of iterations to reduce approximate path length and convert it in geodesic path
Expected< SurfacePath, PathError > MR::computeShortestEdgePath (const MeshPart &mp, const MeshTriPoint &start, const MeshTriPoint &end, const VertBitSet *vertRegion=nullptr)
Expected< SurfacePath, PathError > MR::computeGeodesicPathApprox (const Mesh &mesh, const MeshTriPoint &start, const MeshTriPoint &end, GeodesicPathApprox atype)
Expected< SurfacePath, PathError > MR::computeFastMarchingPath (const MeshPart &mp, const MeshTriPoint &start, const MeshTriPoint &end, const VertBitSet *vertRegion=nullptr, VertScalars *outSurfaceDistances=nullptr)
SurfacePath MR::computeSteepestDescentPath (const MeshPart &mp, const VertScalars &field, const MeshTriPoint &start, const ComputeSteepestDescentPathSettings &settings={})
void MR::computeSteepestDescentPath (const MeshPart &mp, const VertScalars &field, const MeshTriPoint &start, SurfacePath *outPath, const ComputeSteepestDescentPathSettings &settings={})
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
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)
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)
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
HashMap< VertId, VertId > MR::computeClosestSurfacePathTargets (const Mesh &mesh, const VertBitSet &starts, const VertBitSet &ends, const VertBitSet *vertRegion=nullptr, VertScalars *outSurfaceDistances=nullptr)
SurfacePaths MR::getSurfacePathsViaVertices (const Mesh &mesh, const VertBitSet &vs)
bool MR::isConnectedPath (const MeshTopology &topology, const MeshTriPoint &start, const SurfacePath &path, const MeshTriPoint &end)
float MR::surfacePathLength (const Mesh &mesh, const SurfacePath &surfacePath)
 computes the length of the given surface path
float MR::geodesicPathLength (const Mesh &mesh, const GeodesicPath &path)
 computes the length of the given geodesic path
Contour3f MR::surfacePathToContour3f (const Mesh &mesh, const SurfacePath &line)
 converts lines on mesh in 3D contours by computing coordinate of each point
Contours3f MR::surfacePathsToContours3f (const Mesh &mesh, const SurfacePaths &lines)
Contour3f MR::geodesicPathToContour3f (const Mesh &mesh, const GeodesicPath &path)
 returns coordinates of all vertices of the given path

Detailed Description

Enumeration Type Documentation

◆ ExtremeEdgeType

enum class MR::ExtremeEdgeType
strong

#include <MRMesh/MRSurfacePath.h>

Enumerator
Ridge 
Gorge 

where the field not-increases both in left and right triangles

where the field not-decreases both in left and right triangles

◆ PathError

enum class MR::PathError
strong

#include <MRMesh/MRSurfacePath.h>

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()

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

#include <MRMesh/MRSurfacePath.h>

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

Parameters
vertRegionconsider paths going in this region only

◆ computeFastMarchingPath()

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

#include <MRMesh/MRSurfacePath.h>

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; returns PathError::InternalError if the steepest descent stops before reaching end, which is not expected; the distances in outSurfaceDistances are computed with SurfaceDistanceBuilder::setNoLocalMinima( true )

◆ computeGeodesicPath()

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

#include <MRMesh/MRSurfacePath.h>

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()

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

#include <MRMesh/MRSurfacePath.h>

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; if FastMarching fails with PathError::InternalError, then falls back to DijkstraBiDir

◆ computeShortestEdgePath()

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

#include <MRMesh/MRSurfacePath.h>

returns intermediate points of the shortest path along mesh edges (by DijkstraBiDir) from start to end, every next point is located in the same triangle with the previous point; the path can be limited to given region: in face-format inside mp (only the edges with a region face on a side are passed), or in vert-format in vertRegion argument (only the edges with both ends in it are passed)

◆ computeSteepestDescentPath() [1/2]

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

#include <MRMesh/MRSurfacePath.h>

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]

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

#include <MRMesh/MRSurfacePath.h>

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()

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

#include <MRMesh/MRSurfacePath.h>

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(), but if the steepest descent stops before reaching end then the shortest path along edges in the same region is taken, and it is reduced in at least 100 iterations (unless maxGeodesicIters is 0); the distances in outSurfaceDistances are computed with SurfaceDistanceBuilder::setNoLocalMinima( true )

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

◆ findExtremeEdges()

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

#include <MRMesh/MRSurfacePath.h>

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

◆ findSteepestDescentPoint() [1/3]

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

#include <MRMesh/MRSurfacePath.h>

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]

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

#include <MRMesh/MRSurfacePath.h>

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]

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

#include <MRMesh/MRSurfacePath.h>

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

◆ geodesicPathLength()

float MR::geodesicPathLength ( const Mesh & mesh,
const GeodesicPath & path )
nodiscard

#include <MRMesh/MRSurfacePath.h>

computes the length of the given geodesic path

◆ geodesicPathToContour3f()

Contour3f MR::geodesicPathToContour3f ( const Mesh & mesh,
const GeodesicPath & path )
nodiscard

#include <MRMesh/MRSurfacePath.h>

returns coordinates of all vertices of the given path

◆ getSurfacePathsViaVertices()

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

#include <MRMesh/MRSurfacePath.h>

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

◆ isConnectedPath()

bool MR::isConnectedPath ( const MeshTopology & topology,
const MeshTriPoint & start,
const SurfacePath & path,
const MeshTriPoint & end )
nodiscard

#include <MRMesh/MRSurfacePath.h>

returns true if every two consecutive points among start, path points and end share a triangle; an empty path is connected only if start and end share a triangle

◆ surfacePathLength()

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

#include <MRMesh/MRSurfacePath.h>

computes the length of the given surface path

◆ surfacePathsToContours3f()

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

◆ surfacePathToContour3f()

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

#include <MRMesh/MRSurfacePath.h>

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

◆ toString()

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