Description
Partition a rectangular artwork into colored nonoverlapping guillotine cells with middle-half random cuts, area evidence, and shared-edge adjacency.
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 rectangular artwork into colored nonoverlapping guillotine cells with middle-half random cuts, area evidence, and shared-edge adjacency.
When to use this tool
Use this generator to create reproducible stained glass panel 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 width, height, cellCount, palette 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 artworkOnly, cells, adjacency, totalArea, cellAreaSum. Use the conventions below and keep answer-bearing fields separate when presenting an exercise.
Repeatedly choose a rectangular cell, a cut orientation, and a cut in its middle half, producing a guillotine partition. Assign supplied colors, calculate cell areas, and report adjacency only for positive-length shared edges, together with area totals.1
Delegated operations used for this result: rectangle area. Their calculation or parsing conventions apply to the corresponding result fields.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| width | Width | Required. Finite number; strictly above 0. |
| height | Height | Required. Finite number; strictly above 0. |
| cellCount | Cell Count | Required. Safe integer; minimum 1; maximum 64. |
| palette | Palette | Required. Array of Text; minimum UTF-16 length 7; maximum UTF-16 length 7.; minimum items 1; maximum items 32. |
| 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 |
|---|---|---|
| artworkOnly | Artwork Only | Required. Boolean; exactly true. |
| cells | Cells | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 64. |
| cells[].id | Literal identifier used to match records, independently of their display labels. | Required. Safe integer; minimum 1; maximum 64. |
| cells[].x | X | Required. Finite number. |
| cells[].y | Y | Required. Finite number. |
| cells[].width | Width | Required. Finite number; strictly above 0. |
| cells[].height | Height | Required. Finite number; strictly above 0. |
| cells[].area | Area | Required. Finite number; strictly above 0. |
| cells[].color | Color | Required. Text; minimum UTF-16 length 7; maximum UTF-16 length 7. |
| adjacency | Adjacency | Required. Array of Object; no unknown keys.; minimum items 0; maximum items 2016. |
| adjacency[].a | A | Required. Safe integer; minimum 1; maximum 64. |
| adjacency[].b | B | Required. Safe integer; minimum 1; maximum 64. |
| adjacency[].sharedEdgeLength | Shared Edge Length | Required. Finite number; strictly above 0. |
| totalArea | Total Area | Required. Finite number; strictly above 0. |
| cellAreaSum | Cell Area Sum | Required. Finite number; strictly above 0. |
| randomness | Replay metadata: source is seed or context; seed is the normalized 32-bit seed or null for a context source. | Required. Object; no unknown keys. |
| randomness.seed | Optional numeric 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": {
"width": 6,
"height": 4,
"cellCount": 2,
"palette": [
"#d09030",
"#3060b0"
],
"seed": 42
},
"output": {
"artworkOnly": true,
"cells": [
{
"id": 1,
"x": 0,
"y": 0,
"width": 4.0573973804712296,
"height": 4,
"area": 16.229589521884918,
"color": "#3060b0"
},
{
"id": 2,
"x": 4.0573973804712296,
"y": 0,
"width": 1.9426026195287704,
"height": 4,
"area": 7.770410478115082,
"color": "#d09030"
}
],
"adjacency": [
{
"a": 1,
"b": 2,
"sharedEdgeLength": 4
}
],
"totalArea": 24,
"cellAreaSum": 24,
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- Corner contact is not adjacency. Floating-point limits can prevent further splitting, and the artwork does not specify glass thickness, leadwork, fabrication tolerances, or structural safety.
- A replay requires the same complete input and implementation. Randomized construction does not guarantee uniform coverage of every feasible output; finite samples can repeat unless a distinct-selection rule is explicitly stated.
- 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 Greeting Card Fold Layout Generator
Draw a supplied equal-panel card template and return dimensioned roles and alternating fold labels in right/down sheet coordinates; print imposition is external.
- Random Lacing Card Hole Layout Generator
Number equally spaced perimeter holes on a supplied simple orthogonal outline, sample a phase and verify every Euclidean pair distance; material safety and physical usability remain caller-reviewed.