TreeLod

from acron.proctree import TreeLod
class TreeLod

Bases:

Bases: TypedReferenceCount

Levels of detail from one skeleton, each under a triangle budget.

A level is the cheapest of a fixed ladder of reductions that fits its budget, and always coarser than the level before: fewer rings along a stem (`ring_stride`), fewer sides (`radial_scale`), thin wood pruned on a copy (`min_radius`; the leaves of a pruned twig move to the branch it grew from) and fewer leaf cards (`leaf_keep`, the outer cards first, the rest scaled up so the crown keeps its area). A level added with `cards > 0` is a billboard cloud instead: the leaves clustered (k-means) into that many big crossed cards over the trunk and the thickest limbs.

Inheritance diagram

digraph inheritance8e6c48d01e { 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=""]; "TreeLod" [URL="acron.proctree.TreeLod.html#acron.proctree.TreeLod",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedReferenceCount" -> "TreeLod" [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=""]; }
__init__()
add_level()

A level under `triangle_budget`; `cards > 0` makes it a billboard cloud of that many cards.

static billboard_cloud()

The leaves clustered into `cards` big crossed cards (deterministic k-means: farthest-point seeds from the top, six rounds), over the wood thicker than `min_radius`.

build()

Builds every level from the skeleton (each the first step of the ladder, past the previous level’s, that meets its budget).

clear_levels()
get_budget()
static get_class_type()
get_geom()
get_leaf_keep()
get_min_radius()
get_num_levels()
get_radial_scale()
get_ring_stride()
get_skeleton()

The (reduced) skeleton the level was meshed from.

get_triangles()
static reduce()

A copy without the wood thinner than `min_radius` (or deeper than `max_level`) and with `leaf_keep` of the leaves – the outer ones first, in a nested order (a smaller keep is a subset of a larger), scaled up so the crown keeps its leaf area. Leaves of pruned twigs move to the branch the twig grew from.