Octree for Voxel Outlines of a Triangular Mesh

The advantage of octrees is that they can subdivide the surrounding space into self-similar cells. Starting with a bounding cube we can then produce cells that can be thought of as a subset of a regular grid.

AABB Tree

When a sampling point is located near some part of a mesh, it is utterly useless to compute distances to triangles that are “on the other side” of the mesh. One might think that the concept of “closeness” to some triangles of the mesh is inseparable from the distance we intend to compute, but it turns out that there is another set of approaches utilizing a “friend” of programmers who want to accelerate a process handling arbitrarily large amounts of data – a binary tree