TreeCreate is a tool for generating synthetic tree files with procedural parameters and random seeds. It can create individual trees or entire forests for testing, algorithm development, and research purposes.
treecreate tree <seed> [options]
treecreate forest <seed> [options]
<seed>: Random seed (0-100) for reproducible generation
--random_factor <value>or-r <value>: Degree of randomness (0-100, default: 0.25)--max_trunk_radius <value>or-m <value>: Maximum trunk radius in meters (default: 0.2)
--width <value>or-w <value>: Width of square forest section in meters (default: 20)--dimension <value>or-d <value>: Scaling exponent for tree distribution (default: 2.0)--tree_density <value>or-t <value>: Number of mature trees per m² (default: 0.01)
--max_trunk_radius <value>or-m <value>: Maximum trunk radius in meters (default: 0.2)--random_factor <value>or-r <value>: Degree of randomness in construction (default: 0.25)
Generate a simple tree:
treecreate tree 42
Create a tree with specific trunk radius:
treecreate tree 15 --max_trunk_radius 0.3
Generate a highly random tree:
treecreate tree 7 --random_factor 0.8
Generate a default forest:
treecreate forest 123
Create a dense forest plot:
treecreate forest 50 --width 30 --tree_density 0.02
Generate a sparse, large forest:
treecreate forest 99 --width 100 --tree_density 0.005
Create forest with large trees:
treecreate forest 33 --max_trunk_radius 0.4 --dimension 2.5
Controls the variability in tree generation:
- Low values (0.1-0.3): More regular, geometric trees
- Medium values (0.3-0.6): Balanced natural appearance
- High values (0.6-1.0): Highly irregular, organic forms
Forest density in trees per square meter:
- Sparse (0.001-0.005): Open woodland
- Medium (0.005-0.015): Typical forest
- Dense (0.015-0.050): Dense forest or plantation
Controls tree size distribution (higher = more small trees):
- Low (1.5-2.0): More uniform tree sizes
- Medium (2.0-2.5): Natural size distribution
- High (2.5-4.0): Many small trees, few large ones
- Filename:
tree.txt - Content: Single tree with full branch structure
- Filename:
forest.txt - Content: Multiple trees with realistic spatial distribution
Each generated tree includes:
- Spatial coordinates (x, y, z)
- Branch radii and segments
- Parent-child relationships (topology)
- Realistic branch angles and lengths
- Natural tapering from trunk to branches
- Realistic branch angle distributions
- Natural tapering ratios
- Appropriate branch length relationships
- Botanically plausible structures
- Variable branching patterns
- Different tree heights and shapes
- Diverse crown architectures
- Natural variation in trunk sizes
- Generate consistent test datasets
- Create controlled experimental conditions
- Test processing algorithms on known structures
- Prototype tree analysis methods
- Validate measurement techniques
- Generate training data for machine learning
- Demonstrate tree structure concepts
- Provide example datasets for tutorials
- Support forestry education
- Create standardized test cases
- Compare different analysis methods
- Validate reconstruction algorithms
Using the same seed and parameters guarantees identical output:
treecreate forest 42 --width 25 --tree_density 0.01
This ensures reproducible results across different runs and systems.
Generated trees work seamlessly with other treetools:
- Process with
treeinfofor statistics - Visualize with
treemeshortreerender - Modify with
treeprune,treesmooth, etc. - Analyze growth with
treegrow
- Use consistent seeds for reproducibility
- Start with default parameters
- Adjust one parameter at a time
- Use random_factor 0.2-0.4
- Set appropriate tree_density for ecosystem type
- Match max_trunk_radius to target species
- Large forests: increase width and density
- Simple structures: reduce random_factor
- Complex trees: increase random_factor
- Minimum branch radius is fixed at 0.01m
- Branch angle distributions use biological lookup tables
- Forest generation includes realistic spatial clustering
- For more detailed information on generation algorithms, refer to the
TreeCreatesource code attreetools/treetools/treecreate/treecreate.cpp.