Table of Contents

Class DiscreteSpace<T>

Namespace
SearchAThing.Sci
Assembly
netcore-sci.dll

organize given item list into a discretized space to allow fast query of elements in a space region

public class DiscreteSpace<T>

Type Parameters

T
organize given item list into a discretized space to allow fast query of elements in a space region
Inheritance
DiscreteSpace<T>
Inherited Members

Constructors

DiscreteSpace(double, IEnumerable<T>, Func<T, Vector3D>, int)

Build discrete space

public DiscreteSpace(double _tol, IEnumerable<T> ents, Func<T, Vector3D> entPoint, int _spaceDim)

Parameters

_tol double

length tolerance

ents IEnumerable<T>

list of entities to discretize

entPoint Func<T, Vector3D>

function that retrieve relevant point from templated item

_spaceDim int

search space dimension (2=2D 3=3D)

DiscreteSpace(double, IEnumerable<T>, Func<T, IEnumerable<Vector3D>>, int)

Build discrete space

public DiscreteSpace(double _tol, IEnumerable<T> ents, Func<T, IEnumerable<Vector3D>> entPoints, int _spaceDim)

Parameters

_tol double

length tolerance

ents IEnumerable<T>

list of entities to discretize

entPoints Func<T, IEnumerable<Vector3D>>

function that retrieve relevant points from templated item

_spaceDim int

search space dimension (2=2D 3=3D)

Properties

Items

public IEnumerable<T> Items { get; }

Property Value

IEnumerable<T>

Methods

GetItemsAt(Vector3D, double)

retrieve items that resides in the space at given point with given extents max distance

public IEnumerable<T> GetItemsAt(Vector3D pt, double maxDist)

Parameters

pt Vector3D

point to query elements near

maxDist double

distance from the given pt to include queried items

Returns

IEnumerable<T>

list of items belonging to sphere centered at pt given radius equals to given maxDist

GetItemsAtBySubdiv(Vector3D, BBox3D, int, int)

public IEnumerable<T> GetItemsAtBySubdiv(Vector3D pt, BBox3D bbox, int maxRes = 1, int subDivs = 100)

Parameters

pt Vector3D
bbox BBox3D
maxRes int
subDivs int

Returns

IEnumerable<T>

GetItemsInBBox(BBox3D)

public IEnumerable<T> GetItemsInBBox(BBox3D bbox)

Parameters

bbox BBox3D

Returns

IEnumerable<T>

Search(Vector3D, Vector3D, int)

public IEnumerable<T> Search(Vector3D from, Vector3D to, int maxCnt = 10)

Parameters

from Vector3D
to Vector3D
maxCnt int

Returns

IEnumerable<T>