Global

Methods

deinstantiate(object, materialMap)

Recursive function to replace instanced objects (cohort trees) with ordinary meshes
Parameters:
Name Type Description
object THREE.Object3D Root object to deinstantiate
materialMap Map.<number, THREE.Material> (optional) Avoids duplicate materials
Source:
Returns:
A clone of the object, with all instanced objects replaced with ordinary meshes

drawInstances(geometry, elements, material) → {THREE.InstancedMesh}

Parameters:
Name Type Description
geometry THREE.BufferGeometry Base geometry to use
elements Array.<any>
material function Constructor for a THREE.Material (default THREE.MeshLambertMaterial)
Source:
Returns:
Three.js Object containing the instanced objects
Type
THREE.InstancedMesh

idFromData(data) → {string}

Get a unique string for a cohort, patch, and stand
Parameters:
Name Type Description
data Object
Source:
Returns:
Unique string identifying the cohort, patch, and stand
Type
string

(async) itemsFromFile(file)

Parse csv-like files with a header line and float values where the separator is whitespace of variable length.
Parameters:
Name Type Description
file File Text file
Source:
Returns:
List of items with float properties

(async) loadData(files, patchManager)

Loads data from files. Expects one file to have a name containing "veg_struct". Other files are loaded as yearly data (with no cohort information)
Parameters:
Name Type Description
files FileList
patchManager PatchManager
Source:
Returns:
The populated patch manager