cape.splitzones: Mesh zone splitting utilities¶
This module provides utilities for splitting mesh zones for efficient spatial searching.
- class cape.splitzones.SplitZones(tri_obj, splits=10, overlap_factor=0.2)¶
Bases:
objectA bounding volume data structure that splits a mesh into sub-regions to quickly find triangles near a point. If a mesh has a large number of triangles (e.g. 10000), and we need to search for triangles at a certain location within the mesh, this data structure allows us to find a much-reduced subset of the triangles (~1% full number of triangles) near a certain point.
- Parameters:
tri_obj – TriBase mesh object
splits – The number of sub-regions along each axis. For example, split=8 will split the mesh into an 8x8x8 grid for a total of 512 sub-regions.
overlap_factor – Expand each sub-region’s dimensions by this percentage, to prevent edge cases where a triangle bordering one sub-region is not found in a search for a point in an adjacent sub-region.
- get_near(pt)¶
Find triangles near a point. This function is guaranteed to return all triangles whose axis-aligned bou nding box (AABB) encloses the point.