MeshLib Python Docs
Loading...
Searching...
No Matches
meshlib.mrmeshpy.MeshOrPoints Class Reference

Classes

class  ProjectionResult
 

Public Member Functions

None __init__ (self, Mesh mesh)
 
None __init__ (self, MeshPart mp)
 
None __init__ (self, PointCloud pc)
 
None __init__ (self, MeshOrPoints arg0)
 
None accumulate (self, PointAccumulator accum, AffineXf3f xf=None)
 
MeshPart asMeshPart (self)
 
PointCloud asPointCloud (self)
 
None cacheAABBTree (self)
 
Box3f computeBoundingBox (self, AffineXf3f toWorld=None)
 
Box3f getObjBoundingBox (self)
 
func_void_from_Vector3_float_MeshOrPoints_ProjectionResult limitedProjector (self)
 
func_Vector3_float_from_Id_VertTag normals (self)
 
VertCoords points (self)
 
VertBitSet pointsGridSampling (self, float voxelSize, int maxVoxels=500000, func_bool_from_float cb='MR::ProgressCallback{}')
 
func_MeshOrPoints_ProjectionResult_from_Vector3_float projector (self)
 
VertBitSet validPoints (self)
 
func_float_from_Id_VertTag weights (self)
 

Detailed Description

Generated from:  MR::MeshOrPoints

This class can hold either mesh part or point cloud.
It is used for generic algorithms operating with either of them

Constructor & Destructor Documentation

◆ __init__() [1/4]

None meshlib.mrmeshpy.MeshOrPoints.__init__ ( self,
Mesh mesh )

◆ __init__() [2/4]

None meshlib.mrmeshpy.MeshOrPoints.__init__ ( self,
MeshPart mp )

◆ __init__() [3/4]

None meshlib.mrmeshpy.MeshOrPoints.__init__ ( self,
PointCloud pc )

◆ __init__() [4/4]

None meshlib.mrmeshpy.MeshOrPoints.__init__ ( self,
MeshOrPoints arg0 )
Implicit copy constructor.

Member Function Documentation

◆ accumulate()

None meshlib.mrmeshpy.MeshOrPoints.accumulate ( self,
PointAccumulator accum,
AffineXf3f xf = None )
Adds in existing PointAccumulator the elements of the contained object

◆ asMeshPart()

MeshPart meshlib.mrmeshpy.MeshOrPoints.asMeshPart ( self)
if this object holds a mesh part then returns pointer on it, otherwise returns nullptr

◆ asPointCloud()

PointCloud meshlib.mrmeshpy.MeshOrPoints.asPointCloud ( self)
if this object holds a point cloud then returns pointer on it, otherwise returns nullptr

◆ cacheAABBTree()

None meshlib.mrmeshpy.MeshOrPoints.cacheAABBTree ( self)
if AABBTree is already built does nothing otherwise builds and caches it

◆ computeBoundingBox()

Box3f meshlib.mrmeshpy.MeshOrPoints.computeBoundingBox ( self,
AffineXf3f toWorld = None )
passes through all valid vertices and finds the minimal bounding box containing all of them;
if toWorld transformation is given then returns minimal bounding box in world space

◆ getObjBoundingBox()

Box3f meshlib.mrmeshpy.MeshOrPoints.getObjBoundingBox ( self)
returns the minimal bounding box containing all valid vertices of the object (and not only part of mesh);
implemented via obj.getAABBTree()

◆ limitedProjector()

func_void_from_Vector3_float_MeshOrPoints_ProjectionResult meshlib.mrmeshpy.MeshOrPoints.limitedProjector ( self)
returns a function that updates projection (closest) points on this,
the update takes place only if res.distSq on input is more than squared distance to the closest point

◆ normals()

func_Vector3_float_from_Id_VertTag meshlib.mrmeshpy.MeshOrPoints.normals ( self)
returns normals generating function: VertId->normal (or empty for point cloud without normals)

◆ points()

VertCoords meshlib.mrmeshpy.MeshOrPoints.points ( self)
gives access to points-vector (which can include invalid points as well)

◆ pointsGridSampling()

VertBitSet meshlib.mrmeshpy.MeshOrPoints.pointsGridSampling ( self,
float voxelSize,
int maxVoxels = 500000,
func_bool_from_float cb = 'MR::ProgressCallback{}' )
performs sampling of vertices or points;
subdivides bounding box of the object on voxels of approximately given size and returns at most one vertex per voxel;
voxelSize is automatically increased to avoid more voxels than \\param maxVoxels;
returns std::nullopt if it was terminated by the callback

◆ projector()

func_MeshOrPoints_ProjectionResult_from_Vector3_float meshlib.mrmeshpy.MeshOrPoints.projector ( self)
returns a function that finds projection (closest) points on this: Vector3f->ProjectionResult

◆ validPoints()

VertBitSet meshlib.mrmeshpy.MeshOrPoints.validPoints ( self)
gives access to bit set of valid points

◆ weights()

func_float_from_Id_VertTag meshlib.mrmeshpy.MeshOrPoints.weights ( self)
returns weights generating function: VertId->float:
for mesh it is double area of surrounding triangles, and for point cloud - nothing

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