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)[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 usingInstancedCanopyElement
.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
ordict
, optional) – Instanced leaf cloud. Can be specified as a dictionary, which will be interpreted bybiosphere_factory
. If the latter case, the"type"
parameter, if omitted, will implicitly be set to"leaf_cloud"
.trunk_height (
quantity
orfloat
, default:1.0 m
) – Trunk height. Unit-enabled field (default: ucc[‘length’]).trunk_radius (
quantity
orfloat
, optional, default:0.1 m
) – Trunk radius. Unit-enabled field (default: ucc[‘length’]).trunk_reflectance (
Spectrum
ordict
, 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:
- 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
] orNone
– A dictionary mapping parameter paths, consisting of dot-separated strings, to a corresponding update protocol.
See also
- 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 themitsuba.load_dict()
function, orInitParameter
instances which must be rendered.
See also