Classes | |
class | MR::DistanceMap |
struct | MR::ContoursDistanceMapOffset |
Structure with parameters for optional offset in distanceMapFromContours function. More... | |
struct | MR::ContoursDistanceMapOptions |
struct | MR::MeshToDistanceMapParams |
struct | MR::ContourToDistanceMapParams |
Structure with parameters to generate DistanceMap by Contours. More... | |
struct | MR::DistanceMapToWorld |
This structure store data to transform distance map to world coordinates. More... | |
class | MR::RectIndexer |
a class for converting 2D integer coordinates into 1D linear coordinates and backward More... | |
Enumerations | |
enum class | MR::OutEdge2 : signed char { MR::OutEdge2::Invalid = -1 , MR::OutEdge2::PlusY , MR::OutEdge2::MinusY , MR::OutEdge2::PlusX , MR::OutEdge2::MinusX , MR::OutEdge2::Count } |
Functions | |
MRMESH_API DistanceMap | MR::combineXYderivativeMaps (std::pair< DistanceMap, DistanceMap > XYderivativeMaps) |
fill another distance map pair with gradients across X and Y axes of the argument map | |
MRMESH_API DistanceMap | MR::computeDistanceMap (const MeshPart &mp, const MeshToDistanceMapParams ¶ms, ProgressCallback cb={}, std::vector< MeshTriPoint > *outSamples=nullptr) |
MRMESH_API DistanceMap | MR::computeDistanceMapD (const MeshPart &mp, const MeshToDistanceMapParams ¶ms, ProgressCallback cb={}, std::vector< MeshTriPoint > *outSamples=nullptr) |
MRMESH_API DistanceMap | MR::distanceMapFromContours (const Polyline2 &contours, const ContourToDistanceMapParams ¶ms, const ContoursDistanceMapOptions &options={}) |
Computes distance of 2d contours according ContourToDistanceMapParams. | |
MRMESH_API void | MR::distanceMapFromContours (DistanceMap &distMap, const Polyline2 &polyline, const ContourToDistanceMapParams ¶ms, const ContoursDistanceMapOptions &options={}) |
Computes distance of 2d contours according ContourToDistanceMapParams. | |
MRMESH_API std::vector< Vector3f > | MR::edgePointsFromContours (const Polyline2 &polyline, float pixelSize, float threshold) |
MRMESH_API Polyline2 | MR::distanceMapTo2DIsoPolyline (const DistanceMap &distMap, float isoValue) |
MRMESH_API Polyline2 | MR::distanceMapTo2DIsoPolyline (const DistanceMap &distMap, const ContourToDistanceMapParams ¶ms, float isoValue) |
iso-lines are created in real space ( plane OXY with parameters according ContourToDistanceMapParams ) | |
MRMESH_API std::pair< Polyline2, AffineXf3f > | MR::distanceMapTo2DIsoPolyline (const DistanceMap &distMap, const AffineXf3f &xf, float isoValue, bool useDepth=false) |
MRMESH_API Polyline2 | MR::distanceMapTo2DIsoPolyline (const DistanceMap &distMap, float pixelSize, float isoValue) |
MRMESH_API Polyline2 | MR::polylineOffset (const Polyline2 &polyline, float pixelSize, float offset) |
constructs an offset contour for given polyline | |
MRMESH_API Polyline2 | MR::contourUnion (const Polyline2 &contoursA, const Polyline2 &contoursB, const ContourToDistanceMapParams ¶ms, float offsetInside=0) |
computes the union of the shapes bounded by input 2d contours | |
MRMESH_API Polyline2 | MR::contourIntersection (const Polyline2 &contoursA, const Polyline2 &contoursB, const ContourToDistanceMapParams ¶ms, float offsetInside=0.f) |
computes the intersection of the shapes bounded by input 2d contours | |
MRMESH_API Polyline2 | MR::contourSubtract (const Polyline2 &contoursA, const Polyline2 &contoursB, const ContourToDistanceMapParams ¶ms, float offsetInside=0.f) |
computes the difference between the shapes bounded by contoursA and the shapes bounded by contoursB | |
MRMESH_API Expected< Mesh > | MR::distanceMapToMesh (const DistanceMap &distMap, const AffineXf3f &toWorld, ProgressCallback cb={}) |
converts distance map into mesh and applies a transformation to all points | |
MRMESH_API Image | MR::convertDistanceMapToImage (const DistanceMap &distMap, float threshold=1.f/255) |
MRMESH_API Expected< DistanceMap > | MR::convertImageToDistanceMap (const Image &image, float threshold=1.f/255) |
OutEdge2 | MR::opposite (OutEdge2 e) |
MRMESH_API void | MR::expandPixelMask (PixelBitSet &mask, const RectIndexer &indexer, int expansion=1) |
expands PixelBitSet with given number of steps | |
MRMESH_API void | MR::shrinkPixelMask (PixelBitSet &mask, const RectIndexer &indexer, int shrinkage=1) |
shrinks PixelBitSet with given number of steps | |
MR::RectIndexer::RectIndexer (const Vector2i &dims) | |
void | MR::RectIndexer::resize (const Vector2i &dims) |
Vector2i | MR::RectIndexer::toPos (size_t id) const |
size_t | MR::RectIndexer::toIndex (const Vector2i &pos) const |
|
strong |
MRMESH_API DistanceMap MR::combineXYderivativeMaps | ( | std::pair< DistanceMap, DistanceMap > | XYderivativeMaps | ) |
fill another distance map pair with gradients across X and Y axes of the argument map
MRMESH_API DistanceMap MR::computeDistanceMap | ( | const MeshPart & | mp, |
const MeshToDistanceMapParams & | params, | ||
ProgressCallback | cb = {}, | ||
std::vector< MeshTriPoint > * | outSamples = nullptr ) |
computes distance (height) map for given projection parameters using float-precision for finding ray-mesh intersections, which is faster but less reliable
MRMESH_API DistanceMap MR::computeDistanceMapD | ( | const MeshPart & | mp, |
const MeshToDistanceMapParams & | params, | ||
ProgressCallback | cb = {}, | ||
std::vector< MeshTriPoint > * | outSamples = nullptr ) |
computes distance (height) map for given projection parameters using double-precision for finding ray-mesh intersections, which is slower but more reliable
|
nodiscard |
computes the intersection of the shapes bounded by input 2d contours
input contours must be closed within the area of distance map and be consistently oriented (clockwise, that is leaving the bounded shapes from the left). the value of params.withSign must be true (checked with assert() inside the function)
|
nodiscard |
computes the difference between the shapes bounded by contoursA and the shapes bounded by contoursB
input contours must be closed within the area of distance map and be consistently oriented (clockwise, that is leaving the bounded shapes from the left). the value of params.withSign must be true (checked with assert() inside the function)
|
nodiscard |
computes the union of the shapes bounded by input 2d contours
input contours must be closed within the area of distance map and be consistently oriented (clockwise, that is leaving the bounded shapes from the left). the value of params.withSign must be true (checked with assert() inside the function)
|
nodiscard |
export distance map to a grayscale image
threshold | - threshold of valid values [0.; 1.]. pixel with color less then threshold set invalid |
|
nodiscard |
load distance map from a grayscale image:
threshold | - threshold of valid values [0.; 1.]. pixel with color less then threshold set invalid |
|
nodiscard |
Computes distance of 2d contours according ContourToDistanceMapParams.
options | - optional input and output options for distance map calculation, find more ContoursDistanceMapOptions |
MRMESH_API void MR::distanceMapFromContours | ( | DistanceMap & | distMap, |
const Polyline2 & | polyline, | ||
const ContourToDistanceMapParams & | params, | ||
const ContoursDistanceMapOptions & | options = {} ) |
Computes distance of 2d contours according ContourToDistanceMapParams.
distMap | - preallocated distance map |
options | - optional input and output options for distance map calculation, find more ContoursDistanceMapOptions |
|
nodiscard |
computes iso-lines of distance map corresponding to given iso-value; in second returns the transformation from 0XY plane to world;
useDepth | true - the isolines will be located on distance map surface, false - isolines for any iso-value will be located on the common plane xf(0XY) |
|
nodiscard |
iso-lines are created in real space ( plane OXY with parameters according ContourToDistanceMapParams )
|
nodiscard |
converts distance map to 2d iso-lines: iso-lines are created in space DistanceMap ( plane OXY with pixelSize = (1, 1) )
|
nodiscard |
|
nodiscard |
converts distance map into mesh and applies a transformation to all points
|
nodiscard |
Makes distance map and filter out pixels with large (>threshold) distance between closest points on contour in neighbor pixels Converts such points back in 3d space and return
MRMESH_API void MR::expandPixelMask | ( | PixelBitSet & | mask, |
const RectIndexer & | indexer, | ||
int | expansion = 1 ) |
expands PixelBitSet with given number of steps
|
nodiscard |
constructs an offset contour for given polyline
|
inline |
|
inline |
MRMESH_API void MR::shrinkPixelMask | ( | PixelBitSet & | mask, |
const RectIndexer & | indexer, | ||
int | shrinkage = 1 ) |
shrinks PixelBitSet with given number of steps
|
inline |
|
inline |