EdgeData
Implements:
Stores edge data separately for each dimension.
With a grid resolution N, there are 3 * (N + 1)² * N
edges in total, but
the number of edges that actually contain the volume's surface is usually
much lower.
Static Method Summary
Static Public Methods | ||
public static |
Calculates the amount of edges for one axis based on a given resolution. |
Constructor Summary
Public Constructor | ||
public |
constructor(n: Number, x: Number, y: Number, z: Number) Constructs new edge data. |
Member Summary
Public Members | ||
public |
The edges. |
|
public |
The surface intersection normals. |
|
public |
The material grid resolution. |
|
public |
The Zero Crossing interpolation values. |
Method Summary
Public Methods | ||
public |
createTransferList(transferList: Array): Transferable[] Creates a list of transferable items. |
|
public |
deserialize(object: Object): Deserializable Adopts the given serialised data. |
|
public |
edges(cellPosition: Vector3, cellSize: Number): EdgeIterator Returns a new edge iterator. |
|
public |
edgesX(cellPosition: Vector3, cellSize: Number): EdgeIterator Creates a new edge iterator that only returns edges along the X-axis. |
|
public |
edgesY(cellPosition: Vector3, cellSize: Number): EdgeIterator Creates a new edge iterator that only returns edges along the Y-axis. |
|
public |
edgesZ(cellPosition: Vector3, cellSize: Number): EdgeIterator Creates a new edge iterator that only returns edges along the Z-axis. |
|
public |
Serialises this data. |
Static Public Methods
Public Constructors
public constructor(n: Number, x: Number, y: Number, z: Number) source
Constructs new edge data.
Params:
Name | Type | Attribute | Description |
n | Number | The material grid resolution. |
|
x | Number |
|
The amount of edges along the X-axis. If <= 0, no memory will be allocated. |
y | Number |
|
The amount of edges along the Y-axis. If omitted, this will be the same as x. |
z | Number |
|
The amount of edges along the Z-axis. If omitted, this will be the same as x. |
Public Members
public indices: Uint32Array[] source
The edges.
Edges are stored as starting grid point indices in ascending order. The ending point indices are implicitly defined through the dimension split:
Given a starting point index A, the ending point index B for the X-, Y-
and Z-axis is defined as A + 1
, A + N
and A + N²
respectively where
N is the grid resolution + 1.
public normals: Float32Array[] source
The surface intersection normals.
The vectors are stored as [x, y, z] float triples and correspond to the order of the edges.
public zeroCrossings: Float32Array[] source
The Zero Crossing interpolation values.
Each value describes the relative surface intersection position on the respective edge. The values correspond to the order of the edges.
Public Methods
public createTransferList(transferList: Array): Transferable[] source
Creates a list of transferable items.
Params:
Name | Type | Attribute | Description |
transferList | Array |
|
An optional target list. The transferable items will be added to this list. |
Return:
Transferable[] | The transfer list. |
public deserialize(object: Object): Deserializable source
Adopts the given serialised data.
Params:
Name | Type | Attribute | Description |
object | Object | Serialised edge data. Can be null. |
public edges(cellPosition: Vector3, cellSize: Number): EdgeIterator source
Returns a new edge iterator.
Params:
Name | Type | Attribute | Description |
cellPosition | Vector3 | The position of the volume data cell. |
|
cellSize | Number | The size of the volume data cell. |
public edgesX(cellPosition: Vector3, cellSize: Number): EdgeIterator source
Creates a new edge iterator that only returns edges along the X-axis.
Params:
Name | Type | Attribute | Description |
cellPosition | Vector3 | The position of the volume data cell. |
|
cellSize | Number | The size of the volume data cell. |
public edgesY(cellPosition: Vector3, cellSize: Number): EdgeIterator source
Creates a new edge iterator that only returns edges along the Y-axis.
Params:
Name | Type | Attribute | Description |
cellPosition | Vector3 | The position of the volume data cell. |
|
cellSize | Number | The size of the volume data cell. |
public edgesZ(cellPosition: Vector3, cellSize: Number): EdgeIterator source
Creates a new edge iterator that only returns edges along the Z-axis.
Params:
Name | Type | Attribute | Description |
cellPosition | Vector3 | The position of the volume data cell. |
|
cellSize | Number | The size of the volume data cell. |