mymesh.octree.Surface2Octree#

mymesh.octree.Surface2Octree(NodeCoords, SurfConn, minsize=None, maxdepth=5)[source]#

Generate an octree representation of a triangular surface mesh. The octree will be refined until each node contains only one triangle or the maximum depth or minimum size criteria are met. Each node contains a list of element ids corresponding to the elements that are contained within that node in the OctreeNode.data field.

Parameters:
  • NodeCoords (array_like) – Node coordinates of the surface mesh

  • SurfConn (array_like) – Node connectivity of the triangular surface mesh. This must be an nx3 array or list.

  • minsize (float, optional) – Minimum size for an octree node, by default None. If supplied, octree nodes will not be divided to be smaller than this size.

  • maxdepth (int, optional) – Maximum depth of the octree, by default 5

Returns:

root – Root node of the generate octree

Return type:

octree.OctreeNode