Description
Partition a caller-supplied rectangular outline into grid patches and clip selected angle/spacing hatches to every patch boundary.
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.
Partition a caller-supplied rectangular outline into grid patches and clip selected angle/spacing hatches to every patch boundary.
When to use this tool
Use this generator to create reproducible geometric hatching patchwork 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 outline, rows, columns, angles, spacings 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 patches, bounds. Use the conventions below. Keep answer-bearing fields separate when presenting an exercise.
Split the supplied outline rectangle into rows and columns. For every patch, sample an angle in turns and a spacing, then clip its parallel hatch lines to that patch. Return patch rectangles and segments with overall outline bounds.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| outline | Outline | Required. Object; no unknown keys. |
| outline.x | X | Required. Finite number. |
| outline.y | Y | Required. Finite number. |
| outline.width | Width | Required. Finite number; strictly above 0. |
| outline.height | Height | Required. Finite number; strictly above 0. |
| rows | Rows | Required. Safe integer; minimum 1; maximum 8. |
| columns | Columns | Required. Safe integer; minimum 1; maximum 8. |
| angles | Angles | Required. Array of Finite number.; minimum items 1; maximum items 16. |
| spacings | Spacings | Required. Array of Finite number; strictly above 0.; minimum items 1; maximum items 16. |
| 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 |
|---|---|---|
| patches | Patches | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 32. |
| patches[].rect | Rect | Required. Object; no unknown keys. |
| patches[].rect.x | X | Required. Finite number. |
| patches[].rect.y | Y | Required. Finite number. |
| patches[].rect.width | Width | Required. Finite number; strictly above 0. |
| patches[].rect.height | Height | Required. Finite number; strictly above 0. |
| patches[].angle | Angle | Required. Finite number. |
| patches[].spacing | Spacing | Required. Finite number; strictly above 0. |
| patches[].lines | Lines | Required. Array of Object; no unknown keys.; minimum items 0; maximum items 128. |
| patches[].lines[].from | From | Required. Array of Finite number.; minimum items 2; maximum items 2. |
| patches[].lines[].to | To | Required. Array of Finite number.; minimum items 2; maximum items 2. |
| 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": {
"outline": {
"x": 0,
"y": 0,
"width": 4,
"height": 2
},
"rows": 1,
"columns": 2,
"angles": [
0
],
"spacings": [
1
],
"seed": 42
},
"output": {
"patches": [
{
"rect": {
"x": 0,
"y": 0,
"width": 2,
"height": 2
},
"angle": 0,
"spacing": 1,
"lines": [
{
"from": [
0,
0
],
"to": [
2,
0
]
},
{
"from": [
0,
1
],
"to": [
2,
1
]
},
{
"from": [
0,
2
],
"to": [
2,
2
]
}
]
},
{
"rect": {
"x": 2,
"y": 0,
"width": 2,
"height": 2
},
"angle": 0,
"spacing": 1,
"lines": [
{
"from": [
2,
0
],
"to": [
4,
0
]
},
{
"from": [
2,
1
],
"to": [
4,
1
]
},
{
"from": [
2,
2
],
"to": [
4,
2
]
}
]
}
],
"bounds": {
"minX": 0,
"minY": 0,
"maxX": 4,
"maxY": 2,
"width": 4,
"height": 2
},
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- The total candidate line count is bounded before line construction. Angles and spacings are literal drawing parameters; the tool does not optimize optical effects or check physical fabrication.
- 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 Color Pattern Generator
Generate one quarter-turn triangle, diamond or square in every bounded grid cell using reusable random hex palette slots, with explicit polygon vertices and portable SVG; palette slots may repeat and blank triangle/diamond corners stay transparent.
- 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.