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:
TreeA container class for abstract trees in discrete canopies. Holds a
LeafCloudand 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=0to 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_offsetcan 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 (
LeafCloudordict, 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 (
quantityorfloat, default:1.0 m) – Trunk height. Unit-enabled field (default: ucc[‘length’]).trunk_radius (
quantityorfloat, optional, default:0.1 m) – Trunk radius. Unit-enabled field (default: ucc[‘length’]).trunk_reflectance (
Spectrumordict, optional, default:0.5) – Reflectance spectrum of the trunk. Must be a reflectance spectrum (dimensionless).leaf_cloud_extra_offset (
quantityor 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,SceneParameter] 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, orDictParameterinstances which must be rendered.
See also