MeshLib Python Docs
Loading...
Searching...
No Matches
mrmeshpy.ConstDistanceMap Class Reference
Inheritance diagram for mrmeshpy.ConstDistanceMap:

Public Member Functions

 __init__ (self, *args, **kwargs)
DistanceMap __sub__ (self, ConstDistanceMap rhs)
float data (self)
float get (self, int x, int y)
float get (self, int i)
DistanceMap getDerivativeMap (self)
float getInterpolated (self, float x, float y)
std_vector_std_pair_unsigned_long_unsigned_long getLocalMaximums (self)
tuple[int, int] getMaxIndex (self)
tuple[int, int] getMinIndex (self)
tuple[float, float] getMinMaxValues (self)
float getValue (self, int x, int y)
float getValue (self, int i)
tuple[DistanceMap, DistanceMap] getXYDerivativeMaps (self)
int heapBytes (self)
bool isInBounds (self, int x, int y)
bool isInBounds (self, int i)
bool isValid (self, int x, int y)
bool isValid (self, int i)
DistanceMap max (self, ConstDistanceMap rhs)
DistanceMap min (self, ConstDistanceMap rhs)
int numPoints (self)
int resX (self)
int resY (self)
Vector3f unproject (self, int x, int y, ConstAffineXf3f toWorld)
Vector3f unprojectInterpolated (self, float x, float y, ConstAffineXf3f toWorld)
Public Member Functions inherited from mrmeshpy.ConstRectIndexer
 __init__ (self, *args, **kwargs)
bool areNeigbors (self, ConstPixelId v0, ConstPixelId v1)
bool areNeigbors (self, ConstVector2i pos0, ConstVector2i pos1)
ConstVector2i dims (self)
PixelId getNeighbor (self, ConstPixelId v, OutEdge2 toNei)
PixelId getNeighbor (self, ConstPixelId v, ConstVector2i pos, OutEdge2 toNei)
int size (self)
int toIndex (self, ConstVector2i pos)
PixelId toPixelId (self, ConstVector2i pos)
Vector2i toPos (self, ConstPixelId id)
Vector2i toPos (self, int id)

Static Public Attributes

typing NOT_VALID_VALUE = -3.4028234663852886e+38

Detailed Description

Generated from:  MR::DistanceMap
Aliases:  std_shared_ptr_DistanceMap

this class allows to store distances from the plane in particular pixels
validVerts keeps only pixels with mesh-intersecting rays from them

Constructor & Destructor Documentation

◆ __init__()

mrmeshpy.ConstDistanceMap.__init__ ( self,
* args,
** kwargs )
__init__(*args, **kwargs)
Overloaded function.

1. __init__(self: meshlib.mrmeshpy.ConstDistanceMap) -> None

2. __init__(self: meshlib.mrmeshpy.ConstDistanceMap, resX: int, resY: int) -> None

Preferable constructor with resolution arguments
Access by the index (i) is equal to (y*resX + x)

3. __init__(self: meshlib.mrmeshpy.ConstDistanceMap, m: meshlib.mrmeshpy.ConstMatrix_float) -> None

make from 2d array

4. __init__(self: meshlib.mrmeshpy.ConstDistanceMap, arg0: meshlib.mrmeshpy.ConstDistanceMap) -> None

Implicit copy constructor.

5. __init__(self: meshlib.mrmeshpy.ConstDistanceMap, : meshlib.mrmeshpy.ConstDistanceMap) -> None

Member Function Documentation

◆ __sub__()

DistanceMap mrmeshpy.ConstDistanceMap.__sub__ ( self,
ConstDistanceMap rhs )
returns new Distance Map with cell-wise subtracted values. Invalid values remain only if both corresponding cells are invalid

◆ data()

float mrmeshpy.ConstDistanceMap.data ( self)

◆ get() [1/2]

float mrmeshpy.ConstDistanceMap.get ( self,
int i )
returns value of index element, returns nullopt if not valid (see `isValid()`), UB if out of bounds.

◆ get() [2/2]

float mrmeshpy.ConstDistanceMap.get ( self,
int x,
int y )
returns value in (X,Y) element, returns nullopt if not valid (see `isValid()`), UB if out of bounds.

◆ getDerivativeMap()

DistanceMap mrmeshpy.ConstDistanceMap.getDerivativeMap ( self)
returns new derivatives map without directions

◆ getInterpolated()

float mrmeshpy.ConstDistanceMap.getInterpolated ( self,
float x,
float y )
\\brief finds interpolated value.
\\details https://en.wikipedia.org/wiki/Bilinear_interpolation
getInterpolated( 0.5f, 0.5f ) == get( 0, 0 )
see https://docs.microsoft.com/en-us/windows/win32/direct3d10/d3d10-graphics-programming-guide-resources-coordinates for details
all 4 elements around this point should be valid, returns nullopt if at least one is not valid
\\param x,y should be in resolution range [0;resX][0;resY].
If x,y are out of bounds, returns nullopt.

◆ getLocalMaximums()

std_vector_std_pair_unsigned_long_unsigned_long mrmeshpy.ConstDistanceMap.getLocalMaximums ( self)
computes single derivative map from XY spaces combined. Returns local maximums then

◆ getMaxIndex()

tuple[int, int] mrmeshpy.ConstDistanceMap.getMaxIndex ( self)
finds maximum value X,Y
returns [-1.-1] if all values are invalid

◆ getMinIndex()

tuple[int, int] mrmeshpy.ConstDistanceMap.getMinIndex ( self)
finds minimum value X,Y
returns [-1.-1] if all values are invalid

◆ getMinMaxValues()

tuple[float, float] mrmeshpy.ConstDistanceMap.getMinMaxValues ( self)
finds minimum and maximum values
returns min_float and max_float if all values are invalid

◆ getValue() [1/2]

float mrmeshpy.ConstDistanceMap.getValue ( self,
int i )

◆ getValue() [2/2]

float mrmeshpy.ConstDistanceMap.getValue ( self,
int x,
int y )

◆ getXYDerivativeMaps()

tuple[DistanceMap, DistanceMap] mrmeshpy.ConstDistanceMap.getXYDerivativeMaps ( self)
returns new derivative maps with X and Y axes direction

◆ heapBytes()

int mrmeshpy.ConstDistanceMap.heapBytes ( self)
returns the amount of memory this object occupies on heap

◆ isInBounds() [1/2]

bool mrmeshpy.ConstDistanceMap.isInBounds ( self,
int i )
Returns true if a flattened coordinate is in bounds.

◆ isInBounds() [2/2]

bool mrmeshpy.ConstDistanceMap.isInBounds ( self,
int x,
int y )
Returns true if (X,Y) coordinates are in bounds.

◆ isValid() [1/2]

bool mrmeshpy.ConstDistanceMap.isValid ( self,
int i )
checks if index element is valid (i.e. not `NOT_VALID_VALUE`; passing an invalid coord to this is UB)

◆ isValid() [2/2]

bool mrmeshpy.ConstDistanceMap.isValid ( self,
int x,
int y )
checks if X,Y element is valid (i.e. not `NOT_VALID_VALUE`; passing invalid coords to this is UB)

◆ max()

DistanceMap mrmeshpy.ConstDistanceMap.max ( self,
ConstDistanceMap rhs )
boolean operators
returns new Distance Map with cell-wise maximum values. Invalid values remain only if both corresponding cells are invalid

◆ min()

DistanceMap mrmeshpy.ConstDistanceMap.min ( self,
ConstDistanceMap rhs )
returns new Distance Map with cell-wise minimum values. Invalid values remain only if both corresponding cells are invalid

◆ numPoints()

int mrmeshpy.ConstDistanceMap.numPoints ( self)
returns the number of pixels

◆ resX()

int mrmeshpy.ConstDistanceMap.resX ( self)
returns X resolution

◆ resY()

int mrmeshpy.ConstDistanceMap.resY ( self)
returns Y resolution

◆ unproject()

Vector3f mrmeshpy.ConstDistanceMap.unproject ( self,
int x,
int y,
ConstAffineXf3f toWorld )
finds 3d coordinates of the Point on the model surface for the (x,y) pixel
Use the same params with distance map creation
(x,y) must be in bounds, the behavior is undefined otherwise.

◆ unprojectInterpolated()

Vector3f mrmeshpy.ConstDistanceMap.unprojectInterpolated ( self,
float x,
float y,
ConstAffineXf3f toWorld )
\\brief finds 3d coordinates of the Point on the model surface for the (x,y) interpolated value
\\param x,y should be in resolution range [0;resX][0;resY].
\\details getInterpolated( 0.5f, 0.5f ) == get( 0, 0 )
see https://docs.microsoft.com/en-us/windows/win32/direct3d10/d3d10-graphics-programming-guide-resources-coordinates for details
all 4 elements around this point should be valid, returns nullopt if at least one is not valid
If x,y are out of bounds, returns nullopt.

Member Data Documentation

◆ NOT_VALID_VALUE

typing mrmeshpy.ConstDistanceMap.NOT_VALID_VALUE = -3.4028234663852886e+38
static

The documentation for this class was generated from the following file: