Class GeoBvh3
- Namespace
- GeometryHelper.Spatial
- Assembly
- GeometryHelper.dll
A bounding volume hierarchy over a triangle mesh: a tree of nested axis-aligned boxes that makes queries against the mesh cost time in the logarithm of its size rather than in its size.
Every operation on a mesh without an index has to look at every triangle, because nothing rules any of them out in advance. A tree of boxes rules them out wholesale: a ray that misses a box misses everything inside it, and a box already farther away than the best answer so far cannot hold anything nearer. One traversal replaces the scan.
Building the tree costs a sort of the triangles, so it pays for itself over repeated queries rather than on the first one. Build it once and keep it for as long as the mesh does not change — which, since every geometry type here is immutable, is for as long as the mesh exists.
public sealed class GeoBvh3
- Inheritance
-
GeoBvh3
- Inherited Members
Constructors
- GeoBvh3(IEnumerable<GeoTriangle3>)
Initializes a hierarchy over a set of triangles.
Properties
- Bounds
Gets the box enclosing every triangle, or the empty box when the tree holds none.
- TriangleCount
Gets how many triangles the tree holds.
- Triangles
Gets the triangles the tree was built over, in the order they were given.
Methods
- CollidesWith(GeoBvh3)
Checks whether any triangle of this mesh touches any triangle of another, using the default tolerance.
- CollidesWith(GeoBvh3, Tolerance)
Checks whether any triangle of this mesh touches any triangle of another, within a tolerance.
- DistanceTo(GeoPoint3)
Calculates the shortest distance from the mesh to a point, using the default tolerance.
- DistanceTo(GeoPoint3, Tolerance)
Calculates the shortest distance from the mesh to a point, within a tolerance.
- DistanceTo(GeoBvh3)
Calculates the shortest distance between this mesh and another, using the default tolerance.
- DistanceTo(GeoBvh3, Tolerance)
Calculates the shortest distance between this mesh and another, within a tolerance.
- FromFace(GeoFace3)
Creates a hierarchy over the surface of a face.
- FromFace(GeoFace3, Tolerance)
Creates a hierarchy over the surface of a face, within a tolerance.
- FromSolid(GeoSolid3)
Builds a hierarchy over the surface of a solid, using the default tolerance.
- FromSolid(GeoSolid3, Tolerance)
Builds a hierarchy over the surface of a solid, within a tolerance.
- GetClosestPoint(GeoPoint3)
Gets the point of the mesh closest to a target point, using the default tolerance.
- GetClosestPoint(GeoPoint3, Tolerance)
Gets the point of the mesh closest to a target point, within a tolerance.
- GetIntersections(GeoRay3)
Finds every point where a ray crosses the mesh, using the default tolerance.
- GetIntersections(GeoRay3, Tolerance)
Finds every point where a ray crosses the mesh, within a tolerance.
- ToString()
Returns a string that represents the current hierarchy.