Skip to content

Feature Sizes

A FeatureSize is the tree’s minimum size and determines how much space needs to be available for a tree to be able to place. This is done by checking a square area of varying widths at each vertical position of the tree; the available free height is calculated as the height until all squares are free.

Every feature size shares an optional minClippedHeight. If specified and lower than the trunk height, it sets the minimum free height required for the tree to generate; otherwise the trunk height is used.

Examples.java Java
// A two-layer feature size with a thin trunk at every height.
FeatureSize.twoLayers()
  .limit(1)
  .lowerSize(0)
  .upperSize(0)
  .minClippedHeight(0)
  .build();

// A three-layer feature size that widens through the middle of the trunk.
FeatureSize.threeLayers()
  .limit(1)
  .upperLimit(2)
  .lowerSize(0)
  .middleSize(1)
  .upperSize(0)
  .build();