new KDTreeOrientation(facets)
Creates a new KDTree instance from an array of shell facets.
Parameters:
| Name | Type | Description |
|---|---|---|
facets |
PD.Shell | Array.<PD.Polygon> | A shell or array of polygonal facets to search through. |
Methods
-
matchOrientation(normal [, k])
-
Finds the k-nearest neighbors to the given query normal.
Parameters:
Name Type Argument Default Description normalTHREE.Vector3 The query {x,y,z} normalised direction vector to match.
knumber <optional>
1 Number of nearest neighbors to return.
Returns:
Array of the
kclosest facets.- Type
- Array.<PD.Polygon>
-
matchOrientationRange(normal [, tolerance])
-
Finds all facets within a given threshold tolerance from the query normal.
Parameters:
Name Type Argument Default Description normalTHREE.Vector3 The query normal to match {x, y, z}.
tolerancenumber <optional>
0.035 The tolerance radius within which to search, defaults to 0.035 [sin(2deg)].
Returns:
Array of facets within the given radius.
- Type
- Array.<PD.Polygon>