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

Public Member Functions

None __init__ (self)
None __init__ (self, ConstMeshPart mp)
None __init__ (self, ConstTriMesh tmesh, ConstFaceBitSet region=None)
None addSplitFaces (self, ConstMesh mesh, Const_phmap_flat_hash_map_Id_FaceTag_Id_FaceTag_phmap_Hash_Id_FaceTag_phmap_EqualTo_Id_FaceTag_Allocator_std_pair_Id_FaceTag_const_Id_FaceTag new2Old)
None flipOrientation (self, ConstFaceBitSet region=None)
None refit (self, ConstMesh mesh, ConstVertBitSet changedVerts)
None renumber (self, ConstFaceBMap faceMap, ConstVertBMap vertMap)
Public Member Functions inherited from mrmeshpy.ConstAABBTree
 __init__ (self, *args, **kwargs)
bool empty (self)
Box3f getBoundingBox (self)
None getLeafOrder (self, FaceBMap faceMap)
Vector_Box3f_NodeId getNodeBoxes (self)
NodeBitSet getNodesFromFaces (self, ConstFaceBitSet faces)
FaceBitSet getSubtreeFaces (self, ConstNodeId subtreeRoot)
std_vector_Id_NodeTag getSubtrees (self, int minNum)
int heapBytes (self)
Box3f leafBox (self, int i)
ConstVector_AABBTreeWideLeafTri leafTris (self)
NodeId nodeId (self, int ref)
int nodeRef (self, ConstNodeId n)
int numLeafTris (self, int leaf)
int numLeaves (self)
int numNodes (self)
int numTris (self)
int rootRef (self)

Additional Inherited Members

Static Public Attributes inherited from mrmeshpy.ConstAABBTree
typing MaxChildren = 4
typing MaxDepth = 16
typing MaxLeafTris = 4
 ConstLeafTri = ConstAABBTreeWideLeafTri
 LeafTri = AABBTreeWideLeafTri

Detailed Description

Generated from:  MR::AABBTree

bounding volume hierarchy of mesh triangles with up to 4 children per node and up to 4 triangles per leaf
in SIMD layout: every internal node keeps the boxes of its children, and every leaf the boxes of its triangles;
the triangles of leaf l are in slots [4 * l, 4 * l + 4) of leafTris(), its unused slots have invalid faces;
a node is referenced as in AABBTreeSimdNode::child, or by NodeId: the internal nodes first, then the leaves

Constructor & Destructor Documentation

◆ __init__() [1/3]

None mrmeshpy.AABBTree.__init__ ( self)

◆ __init__() [2/3]

None mrmeshpy.AABBTree.__init__ ( self,
ConstMeshPart mp )
creates tree for given mesh or its part

◆ __init__() [3/3]

None mrmeshpy.AABBTree.__init__ ( self,
ConstTriMesh tmesh,
ConstFaceBitSet region = None )
creates tree for the triangles of tmesh (all if region is nullptr), faster than from a mesh;
it is the tree of a mesh with tmesh.points and mesh.topology.getTriVerts( f ) == tmesh.tris[f] for all its triangles

Member Function Documentation

◆ addSplitFaces()

adds to the tree the faces that appeared after splitting some of its faces into parts (e.g. by Mesh::splitFace or Mesh::splitEdge):
the leaf of each split face gets a subtree with its old triangles and the new parts;
this is a faster alternative to full tree rebuild (but the tree after the update might be less efficient)
\\param mesh same mesh for which this tree was constructed, but after the splits
\\param new2Old maps every new face (not present in the tree) to the face of this tree it was split from;
it must contain only the splits made since the tree was built or last updated

◆ flipOrientation()

None mrmeshpy.AABBTree.flipOrientation ( self,
ConstFaceBitSet region = None )
changes the order of the vertices of the triangles of given faces (all if nullptr) as MeshTopology::flipOrientation() does;
shall be called after MeshTopology::flipOrientation() if this tree is kept

◆ refit()

None mrmeshpy.AABBTree.refit ( self,
ConstMesh mesh,
ConstVertBitSet changedVerts )
updates the boxes of the triangles with changed vertices and of their ancestors;
this is a faster alternative to full tree rebuild (but the tree after refit might be less efficient)
\\param mesh same mesh for which this tree was constructed but with updated coordinates;
\\param changedVerts vertex ids with modified coordinates (since tree construction or last refit), nullptr means all vertices

◆ renumber()

None mrmeshpy.AABBTree.renumber ( self,
ConstFaceBMap faceMap,
ConstVertBMap vertMap )
renumbers the triangles and their vertices after the mesh was packed with given maps from old to new ids

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