Description
Generate illustrative heights and joined piecewise-linear contour trails on diagonal triangles; equality uses the high side and vertex junctions follow triangle order, not terrain-survey semantics.
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.
Generate illustrative heights and joined piecewise-linear contour trails on diagonal triangles; equality uses the high side and vertex junctions follow triangle order, not terrain-survey semantics.
When to use this tool
Use this generator to create reproducible contour line art field 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 rows, columns, minimumHeight, maximumHeight, levels 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 grid, paths, bounds. Use the conventions below. Keep answer-bearing fields separate when presenting an exercise.
Draw an integer height grid, split each cell along a fixed diagonal, and intersect contour levels with the resulting linear triangles. Join segments using shared vertex/edge identifiers and return open or closed contour paths.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| rows | Rows | Required. Safe integer; minimum 2; maximum 8. |
| columns | Columns | Required. Safe integer; minimum 2; maximum 8. |
| minimumHeight | Minimum Height | Required. Safe integer; minimum -128; maximum 128. |
| maximumHeight | Maximum Height | Required. Safe integer; minimum -128; maximum 128. |
| levels | Levels | Required. Array of Finite number.; minimum items 1; maximum items 4. |
| 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 |
|---|---|---|
| grid | Grid | Required. Array of Array of Finite number.; minimum items 2; maximum items 8.; minimum items 2; maximum items 8. |
| paths | Paths | Required. Array of Object; no unknown keys.; minimum items 0; maximum items 512. |
| paths[].level | Level | Required. Finite number. |
| paths[].closed | Closed | Required. Boolean. |
| paths[].points | Points | Required. Array of Array of Finite number.; minimum items 2; maximum items 2.; minimum items 2; maximum items 512. |
| 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": {
"rows": 2,
"columns": 2,
"minimumHeight": 0,
"maximumHeight": 1,
"levels": [
0.5
],
"seed": 42
},
"output": {
"grid": [
[
1,
0
],
[
1,
1
]
],
"paths": [
{
"level": 0.5,
"closed": false,
"points": [
[
0.5,
0
],
[
1,
0.5
]
]
}
],
"bounds": {
"minX": 0,
"minY": 0,
"maxX": 1,
"maxY": 1,
"width": 1,
"height": 1
},
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- This is triangulated interpolation, not bilinear marching squares or terrain measurements. Flat level edges follow the implementation's greater-or-equal classification; sampled grids and contour-work counts are bounded.
- 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 Geometric Op Art Grid Generator
Displace interior grid vertices with disk-uniform capped vectors while fixing the boundary and retaining vector edges; cells may fold and rendering is external.
- 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.