Skip to content

Main content

Random Contour Line Art Field Generator

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.

Loading tool…

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

  1. Supply rows, columns, minimumHeight, maximumHeight, levels in the field shapes below. Set seed when you need an explicit replay.
  2. 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.
  3. 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 fieldMeaning and unitsAccepted input
rowsRowsRequired. Safe integer; minimum 2; maximum 8.
columnsColumnsRequired. Safe integer; minimum 2; maximum 8.
minimumHeightMinimum HeightRequired. Safe integer; minimum -128; maximum 128.
maximumHeightMaximum HeightRequired. Safe integer; minimum -128; maximum 128.
levelsLevelsRequired. Array of Finite number.; minimum items 1; maximum items 4.
seedOptional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed.Optional. Safe integer.
Output fieldInterpretationReturned shape
gridGridRequired. Array of Array of Finite number.; minimum items 2; maximum items 8.; minimum items 2; maximum items 8.
pathsPathsRequired. Array of Object; no unknown keys.; minimum items 0; maximum items 512.
paths[].levelLevelRequired. Finite number.
paths[].closedClosedRequired. Boolean.
paths[].pointsPointsRequired. Array of Array of Finite number.; minimum items 2; maximum items 2.; minimum items 2; maximum items 512.
boundsBoundsRequired. Object; no unknown keys.
bounds.minXMin XRequired. Finite number.
bounds.minYMin YRequired. Finite number.
bounds.maxXMax XRequired. Finite number.
bounds.maxYMax YRequired. Finite number.
bounds.widthWidthRequired. Finite number.
bounds.heightHeightRequired. Finite number.
randomnessReplay source and normalized 32-bit seed, or null seed for an advancing context source.Required. Object; no unknown keys.
randomness.seedOptional safe-integer replay seed; normalization and precedence are explained below.Required. Safe integer. or Null.
randomness.sourceSourceRequired. 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.

json
{
  "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

  1. Tool behavior and example: Random Contour Line Art Field Generator — tool.io

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.