eradiate.scenes.biosphere.AbstractTree#

class eradiate.scenes.biosphere.AbstractTree(id='abstract_tree', leaf_cloud=None, trunk_height=<Quantity(1.0, 'meter')>, trunk_radius=<Quantity(0.1, 'meter')>, trunk_reflectance=0.5, leaf_cloud_extra_offset=_Nothing.NOTHING)[source]#

Bases: Tree

A container class for abstract trees in discrete canopies. Holds a LeafCloud and the parameters characterizing a cylindrical trunk. The entire tree is described in local coordinates and can be placed in the scene using InstancedCanopyElement.

The trunk starts at [0, 0, -0.1] and extends to [0, 0, trunk_height]. The trunk extends below z=0 to avoid intersection issues at the intersection of the trunk and the ground the tree is usually placed on.

The leaf cloud will by default be offset such that its local coordinate origin coincides with the upper end of the trunk. If this is not desired, e.g. the leaf cloud is centered around its coordinate origin and the trunk should not extend into it, the parameter leaf_cloud_extra_offset can be used to shift the leaf cloud in addition to the trunk’s extent.

Parameters:
  • id (str, optional, default: "abstract_tree") – Identifier of the current scene element.

  • leaf_cloud (LeafCloud or dict, optional) – Instanced leaf cloud. Can be specified as a dictionary, which will be interpreted by biosphere_factory. If the latter case, the "type" parameter, if omitted, will implicitly be set to "leaf_cloud".

  • trunk_height (quantity or float, default: 1.0 m) – Trunk height. Unit-enabled field (default: ucc[‘length’]).

  • trunk_radius (quantity or float, optional, default: 0.1 m) – Trunk radius. Unit-enabled field (default: ucc[‘length’]).

  • trunk_reflectance (Spectrum or dict, optional, default: 0.5) – Reflectance spectrum of the trunk. Must be a reflectance spectrum (dimensionless).

  • leaf_cloud_extra_offset (quantity or array-like, optional, default: [0, 0, 0]) – Additional offset for the leaf cloud. 3-vector. Unit-enabled field (default: ucc[‘length’])

Fields:
  • id (str or None) – Identifier of the current scene element.

  • leaf_cloud (LeafCloud or None) – Instanced leaf cloud.

  • trunk_height (quantity) – Trunk height.

  • trunk_radius (quantity) – Trunk radius.

  • trunk_reflectance (Spectrum) – Reflectance spectrum of the trunk.

  • leaf_cloud_extra_offset (quantity) – Additional offset for the leaf cloud.

traverse(callback)#

Traverse this scene element and collect kernel dictionary template and parameter update map contributions.

Parameters:

callback (SceneTraversal) – Callback data structure storing the collected data.

update()#

Enforce internal state consistency. This method should be called when fields are modified. It is automatically called as a post-init step.

property objects#

Map of child objects associated with this scene element.

Returns:

dict – A dictionary mapping object names to a corresponding object to be inserted in the Eradiate scene graph.

property params#
Returns:

dict[str, UpdateParameter] or None – A dictionary mapping parameter paths, consisting of dot-separated strings, to a corresponding update protocol.

property template#

Kernel dictionary template contents associated with this scene element.

Returns:

dict – A flat dictionary mapping dot-separated strings describing the path of an item in the nested scene dictionary to values. Values may be objects which can be directly used by the mitsuba.load_dict() function, or InitParameter instances which must be rendered.