TreeOp

class TreeOp

Bases: TypedReferenceCount

One step of a tree recipe, with the settings of its own (the species’ shape is the recipe’s TreeParams).

Every op draws from its own random stream, splitmix64(seed, op id), so editing one op leaves what the others grow alone; inside an op, a stem draws its children after itself (each stem from a stream of its own, keyed by its place in the tree), so a change near the tips does not reshuffle the whole crown.

Kinds and their settings (`set(name, value)`):

  • `T_trunk` – the trunk(s): base splits and the low fork from the params. No settings.

  • `T_weber_penn` – the branch levels by Weber & Penn: `first_level` (1), `last_level` (-1: the params’ last).

  • `T_space_colonization` – Runions et al. 2007: attraction points in the crown envelope pull new wood out of the existing stems. `attractors` (400), `influence` (1.6 m), `kill` (0.5 m), `step` (0.3 m), `iterations` (60), `from_level` (0: grow off stems up to this level), `crown_base` (0.35), `crown_top` (1.0, fractions of the height), `crown_width` (0.35 of the height, the radius), `tip_radius` (0.012 m), `pipe_power` (2.2), `up` (0.15: a pull upwards added to each step), `envelope` (0 ellipsoid, 1 the params’ pruning envelope).

  • `T_roots` – surface roots: `count` (5), `length` (0.12 of the height), `radius` (0.55 of the trunk’s), `down` (12 degrees), `segments` (5), `spread` (25 degrees of random azimuth).

  • `T_leaves` – leaf cards on the leaf-bearing stems (params `leaves`, `leaf_*`). No settings.

  • `T_prune` – cuts after growth: `min_radius` (0 m: thinner stems go, with their subtrees), `envelope` (0; 1 cuts stems where they leave the params’ envelope), `max_level` (-1: deeper stems go), `keep` (1: the fraction of leaves kept).

Inheritance diagram

digraph inheritanceafc231269c { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "ReferenceCount" [URL="acron.core.ReferenceCount.html#acron.core.ReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ReferenceCount" [arrowsize=0.75,style=""]; "TreeOp" [URL="acron.proctree.TreeOp.html#acron.proctree.TreeOp",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedReferenceCount" -> "TreeOp" [arrowsize=0.75,style=""]; "TypedObject" [URL="acron.core.TypedObject.html#acron.core.TypedObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "TypedObject" [arrowsize=0.75,style=""]; "TypedReferenceCount" [URL="acron.core.TypedReferenceCount.html#acron.core.TypedReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedObject" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; "ReferenceCount" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; }
enum Type
enumerator T_trunk = 0
enumerator T_weber_penn = 1
enumerator T_space_colonization = 2
enumerator T_roots = 3
enumerator T_leaves = 4
enumerator T_prune = 5
TreeOp.__init__()
TreeOp.get()
static TreeOp.get_class_type()
TreeOp.get_hash()
TreeOp.get_num_settings()
TreeOp.get_op_id()
TreeOp.get_op_type()
TreeOp.get_setting_name()
TreeOp.has()
TreeOp.is_enabled()
TreeOp.output()
static TreeOp.parse_type()

The inverse of type_name() (an unknown name raises).

TreeOp.set()

Sets one of the op’s settings (an unknown name raises).

TreeOp.set_enabled()
TreeOp.set_op_id()
static TreeOp.type_name()

The op kind’s name as presets write it: trunk, weber_penn, space_colonization, roots, leaves, prune.