Class: SeasonalVariation

BIM.Plant. SeasonalVariation

Defines how the color and shading potential of a deciduous tree or bush changes throughout the year.


new SeasonalVariation(config)

Creates a new seasonal variation data object.

Parameters:
Name Type Description
config object

An optional configuration object.

Author:
  • drajmarsh

Members


:number

colorFadeEnd

The number of days after the start of autumn that the foliage color has changed, defaults to 61.

Type
  • number

:number

colorFadeStart

The number of days after the start of autumn that the foliage color starts to change, defaults to 14.

Type
  • number

:boolean

isSeasonalVariation <readonly>

A flag identifying this object as a seasonal variation instance.

Type
  • boolean

:number

leafDropEnd

The number of days after the start of autumn that there are no leaves left, defaults to 91.

Type
  • number

:number

leafDropStart

The number of days after the start of autumn that leaves beginning to fall, defaults to 45.

Type
  • number

:number

regrowthEnd

The number of days after the start of spring that the foliage is completely regrown, defaults to 75.

Type
  • number

:number

regrowthStart

The number of days after the start of spring that foliage begins to regrow, defaults to 14.

Type
  • number

:object

summer

Defines the state of the tree at the height of summer.

Type
  • object
Properties:
Name Type Description
shading number

The fractional shading offered by the canopy in summer (0 to 1), defaults to 1.

variegation number

The fraction of variegation in foliage color in summer (0 to 1), defaults to 0.25.

foliageColor number

The base color of the canopy foliage in summer as a hexadecimal number, defaults to 0x008000.

variegeColor number

The variegation color of the foliage in summer as a hexadecimal number, defaults to 0xCCFF00.

trunkColor number

The color of the tree trunk in summer as a hexadecimal number, defaults to 0x663300.


:object

winter

Defines the state of the tree the height of winter.

Type
  • object
Properties:
Name Type Description
shading number

The fractional shading offered by the canopy in winter (0 to 1), defaults to 1.

variegation number

The fraction of variegation in foliage color in winter (0 to 1), defaults to 0.25.

foliageColor number

The base color of the canopy foliage in winter as a hexadecimal number, defaults to 0x8C3304.

variegeColor number

The variegation color of the foliage in winter as a hexadecimal number, defaults to 0xFFA800.

trunkColor number

The color of the tree trunk in winter as a hexadecimal number, defaults to 0x663300.

Methods


fromJSON(data)

Safely copy properties from a source object.

See the PD.Base#fromJSON method for more details.

Parameters:
Name Type Description
data object

The source object containing data to copy.

Returns:

Returns this instance to support method chaining.

Type
BIM.Component

fromJSON_toSeason(source, recipient)

Safely copy properties from source to destination object.

Parameters:
Name Type Description
source object

The source object containing data to copy.

recipient object

The destination object to copy the data to.

Returns:

Returns this instance to support method chaining.

Type
BIM.Component

interpolatePlantParams(plant [, datetime] [, location])

Interpolates between seasonal states and checks if the tree needs updating.

Parameters:
Name Type Argument Description
plant BIM.Plant

The plant/tree to interpolate parameters for.

datetime PD.DateTime <optional>

The date and time to compute data for, defaults to PD.GlobalState.dateTime.

location PD.Location <optional>

The location to compute data for, defaults to PD.GlobalState.location.

Returns:

Returns true if the tree needs updating due to changing colors.

Type
boolean

toJSON( [data])

Converts the object instance to a simple POJO for JSON storage.

This method is used to copy, store and save the data for ths object, so the returned object must have all the properties required be able to rebuild this instance in its entirety when passed to the class constructor.

See the PD.Base#toJSON method for more details.

Parameters:
Name Type Argument Description
data object <optional>

An optional parent object to append this data to.

Returns:

Returns a JSON object.

Type
object