Description
Assign unique supplied legend symbols to thread inventory and fill a bounded stitch grid while counting and respecting available stitches.
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.
Assign unique supplied legend symbols to thread inventory and fill a bounded stitch grid while counting and respecting available stitches.
When to use this tool
Use this generator to create reproducible cross stitch chart 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, symbols, threads 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 threadGrid, symbolGrid, legend, totalStitches. Use the conventions below. Keep answer-bearing fields separate when presenting an exercise.
Assign a distinct symbol to each thread and fill every grid cell from thread types with stitch capacity remaining. Return aligned thread and symbol grids and a legend with used and residual stitch counts.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| rows | Rows | Required. Safe integer; minimum 1; maximum 32. |
| columns | Columns | Required. Safe integer; minimum 1; maximum 32. |
| symbols | Symbols | Required. Array of Text; minimum UTF-16 length 1; maximum UTF-16 length 8.; minimum items 1; maximum items 64. |
| threads | Threads | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 32. |
| threads[].id | Literal identifier used independently of display labels. | Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 64. |
| threads[].color | Color | Required. Text; maximum UTF-16 length 2048. |
| threads[].availableStitches | Available Stitches | Required. Safe integer; minimum 0; maximum 1024. |
| 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 |
|---|---|---|
| threadGrid | Thread Grid | Required. Array of Array of Text; minimum UTF-16 length 1; maximum UTF-16 length 64.; minimum items 1; maximum items 32.; minimum items 1; maximum items 32. |
| symbolGrid | Symbol Grid | Required. Array of Array of Text; minimum UTF-16 length 1; maximum UTF-16 length 8.; minimum items 1; maximum items 32.; minimum items 1; maximum items 32. |
| legend | Legend | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 32. |
| legend[].id | Literal identifier used independently of display labels. | Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 64. |
| legend[].color | Color | Required. Text; maximum UTF-16 length 2048. |
| legend[].symbol | Symbol | Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 8. |
| legend[].stitches | Stitches | Required. Safe integer; minimum 0; maximum 1024. |
| legend[].remainingStitches | Remaining Stitches | Required. Safe integer; minimum 0; maximum 1024. |
| totalStitches | Total Stitches | Required. Safe integer; minimum 1; maximum 1024. |
| 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": 3,
"symbols": [
"X",
"O"
],
"threads": [
{
"id": "red",
"color": "#c04040",
"availableStitches": 3
},
{
"id": "blue",
"color": "#4060c0",
"availableStitches": 3
}
],
"seed": 42
},
"output": {
"threadGrid": [
[
"blue",
"blue",
"red"
],
[
"blue",
"red",
"red"
]
],
"symbolGrid": [
[
"X",
"X",
"O"
],
[
"X",
"O",
"O"
]
],
"legend": [
{
"id": "red",
"color": "#c04040",
"symbol": "O",
"stitches": 3,
"remainingStitches": 0
},
{
"id": "blue",
"color": "#4060c0",
"symbol": "X",
"stitches": 3,
"remainingStitches": 0
}
],
"totalStitches": 6,
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- Capacities are stitch counts, not yarn length estimates. Thread colors and symbols are supplied and not checked for contrast or stitchability. The result is a symbolic chart rather than physical embroidery guidance.
- 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 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.
- Random Bilinear Heightmap Tile Generator
Draw corner heights with optional consistent shared linear edges and delegate a bounded bilinear grid, returning both unrounded and inherited core values.