Description
Construct a depth-bounded binary branch tree from explicit length and angle rules with parent traces; no botanical realism is inferred.
Procedural artwork expresses a visual idea through coordinates, repeated motifs, colors, or explicit placement constraints. A coordinate plan can be checked and reproduced before rendering, while physical material behavior and fabrication require separate information.
Construct a depth-bounded binary branch tree from explicit length and angle rules with parent traces; no botanical realism is inferred.
When to use this tool
Use this generator to create reproducible fractal tree branch layout cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.
How to use the tool and how it works
- Supply depth, rootLength, headingTurns, lengthRatio, minimumAngleTurns, maximumAngleTurns in the field shapes below. Set seed when you need an explicit replay.
- Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
- Read branches, bounds. Use the conventions below. Keep answer-bearing fields separate when presenting an exercise.
Grow a binary branch tree from the origin. Compute each endpoint from length and heading in turns; at every nonterminal branch, draw independent left and right angular deviations and scale child lengths by lengthRatio.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| depth | Depth | Required. Safe integer; minimum 0; maximum 5. |
| rootLength | Root Length | Required. Finite number; strictly above 0. |
| headingTurns | Heading Turns | Required. Finite number. |
| lengthRatio | Length Ratio | Required. Finite number; maximum 1; strictly above 0. |
| minimumAngleTurns | Minimum Angle Turns | Required. Finite number; minimum 0; maximum 0.5. |
| maximumAngleTurns | Maximum Angle Turns | Required. Finite number; minimum 0; maximum 0.5. |
| seed | Optional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed. | Optional. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| branches | Branches | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 63. |
| branches[].id | Literal identifier used independently of display labels. | Required. Safe integer; minimum 0; maximum 62. |
| branches[].parent | Parent | Required. Safe integer; minimum -1; maximum 62. |
| branches[].depth | Depth | Required. Safe integer; minimum 0; maximum 5. |
| branches[].from | From | Required. Array of Finite number.; minimum items 2; maximum items 2. |
| branches[].to | To | Required. Array of Finite number.; minimum items 2; maximum items 2. |
| branches[].length | Length | Required. Finite number; strictly above 0. |
| branches[].headingTurns | Heading Turns | Required. Finite number. |
| bounds | Bounds | Required. Object; no unknown keys. |
| bounds.minX | Min X | Required. Finite number. |
| bounds.minY | Min Y | Required. Finite number. |
| bounds.maxX | Max X | Required. Finite number. |
| bounds.maxY | Max Y | Required. Finite number. |
| bounds.width | Width | Required. Finite number. |
| bounds.height | Height | Required. Finite number. |
| randomness | Replay source and normalized 32-bit seed, or null seed for an advancing context source. | Required. Object; no unknown keys. |
| randomness.seed | Optional safe-integer replay seed; normalization and precedence are explained below. | Required. Safe integer. or Null. |
| randomness.source | Source | Required. Text; one of "context", "seed". |
An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.
{
"input": {
"depth": 1,
"rootLength": 4,
"headingTurns": 0,
"lengthRatio": 0.5,
"minimumAngleTurns": 0.25,
"maximumAngleTurns": 0.25,
"seed": 42
},
"output": {
"branches": [
{
"id": 0,
"parent": -1,
"depth": 0,
"from": [
0,
0
],
"to": [
4,
0
],
"length": 4,
"headingTurns": 0
},
{
"id": 1,
"parent": 0,
"depth": 1,
"from": [
4,
0
],
"to": [
4,
-2
],
"length": 2,
"headingTurns": -0.25
},
{
"id": 2,
"parent": 0,
"depth": 1,
"from": [
4,
0
],
"to": [
4,
2
],
"length": 2,
"headingTurns": 0.25
}
],
"bounds": {
"minX": 0,
"minY": -2,
"maxX": 4,
"maxY": 2,
"width": 4,
"height": 4
},
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- The root has parent minus one and depth zero. Branches can overlap or cross. Depth expands output exponentially, and lengths or displacements below numeric resolution are rejected; no botanical growth model is implied.
- A replay requires the same complete input and implementation. The stated sampling convention applies within its eligible space. A finite draw does not exhaust all possible outputs; repeats remain possible unless a distinct-selection rule is explicit.
- The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.
Alternative or Complementary methods
For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.
References
Similar or alternative tools
- Random Bullet Journal Spread Layout Generator
Stack supplied tracker, note and calendar blocks on two dimensioned pages with gutter and legal-side constraints, without accessing journal content.
- Random Bead Loom Row Chart Generator
Construct an exact numeric-index bead chart from finite caller color stock under per-row repeat bounds, retaining compact matrix JSON and inventory conservation.