Table of Contents

Method BuildIndex

Namespace
GeometryHelper.Geometry
Assembly
GeometryHelper.dll

BuildIndex()

Builds a spatial index over the edges of this loop, arcs and all, for asking it many questions.

public GeoBvh2 BuildIndex()

Returns

GeoBvh2

The hierarchy; it is a snapshot and holds no reference back to this shape.

Remarks

An index is worth building when the same shape is asked many questions. Building it costs a sort of the edges, so it pays for itself over repeated queries and never on the first one; below a few dozen edges the plain walk wins outright. Every shape here is immutable, so a tree stays valid for as long as the shape exists — build it once, keep it, throw it away with the shape.

It is Build and not Get because it does work. Calling it inside a loop is slower than not having it at all, which is exactly the mistake the name is there to prevent.