Table of Contents

Class GeoBvh2

Namespace
GeometryHelper.Spatial
Assembly
GeometryHelper.dll

A bounding volume hierarchy over the edges of a shape in the plane, the counterpart of GeoBvh3 in space.

It is built over GeoEdge2, so one index serves a straight chain and a curved one alike: an arc is held as an arc and measured as an arc, and nothing is flattened to get it into the tree. Building costs a walk over the edges; after that, asking what is nearest a point, or where a segment crosses, stops looking at whole branches that cannot reach.

It is worth building when the same shape is asked many questions. For a handful of questions the plain methods on the shape are quicker, because they do not build anything.

public sealed class GeoBvh2
Inheritance
GeoBvh2
Inherited Members

Constructors

GeoBvh2(IEnumerable<GeoEdge2>)

Initializes a hierarchy over a run of edges.

Properties

Bounds

Gets the box round everything indexed, as a rectangle square to the axes.

EdgeCount

Gets the number of edges indexed.

Edges

Gets the edges the hierarchy was built over, in the order they were given.

Methods

CollidesWith(GeoBvh2)

Determines whether the edges of two hierarchies touch or cross.

CollidesWith(GeoBvh2, Tolerance)

Determines whether the edges of two hierarchies touch or cross, within a tolerance.

DistanceTo(GeoPoint2)

Gets the distance from a point to the nearest indexed edge.

DistanceTo(GeoPoint2, Tolerance)

Gets the distance from a point to the nearest indexed edge, within a tolerance.

DistanceTo(GeoBvh2)

Gets the distance between two hierarchies, measured between the edges they hold.

DistanceTo(GeoBvh2, Tolerance)

Gets the distance between two hierarchies, within a tolerance.

FromFace(GeoFace2)

Creates a hierarchy over the boundary of a face: its outline together with the rim of every hole.

FromPolygon(GeoPolygon2)

Builds a hierarchy over the edges of a straight loop.

FromPolygonArc(GeoPolygonArc2)

Builds a hierarchy over the edges of a loop that may curve.

FromPolyline(GeoPolyline2)

Builds a hierarchy over the edges of a straight chain.

FromPolylineArc(GeoPolylineArc2)

Builds a hierarchy over the edges of a chain that may curve.

GetClosestPoint(GeoPoint2)

Gets the point of the indexed edges nearest a point.

GetClosestPoint(GeoPoint2, Tolerance)

Gets the point of the indexed edges nearest a point, within a tolerance.

GetIntersections(GeoLine2)

Gets the points where a straight segment crosses the indexed edges.

GetIntersections(GeoLine2, Tolerance)

Gets the points where a straight segment crosses the indexed edges, within a tolerance.

ToString()

Describes the hierarchy.