Description
Generate a bounded simple radial percentage polygon with verified area and serialize clip-path CSS.
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 a bounded simple radial percentage polygon with verified area and serialize clip-path CSS.
When to use this tool
Use this generator to create reproducible css clip path shape 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 vertexCount, radiusPercent, areaPercentSquared, maximumAttempts 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 vertices, areaPercentSquared, css, attempts. Use the conventions below. Keep answer-bearing fields separate when presenting an exercise.
Place vertices at evenly spaced angles around 50 percent center with sampled radii. Repeatedly check polygon simplicity and positive area within supplied bounds, then return the first acceptable percentage-coordinate polygon and clip-path CSS.1
Delegated operations used for this result: clip path polygon vertex validator; polygon area. Their calculation or parsing conventions apply to the corresponding result fields.2, 3
| Input field | Meaning and units | Accepted input |
|---|---|---|
| vertexCount | Vertex Count | Required. Safe integer; minimum 3; maximum 32. |
| radiusPercent | Radius Percent | Required. Object; no unknown keys. |
| radiusPercent.minimum | Minimum | Required. Safe integer; minimum 1; maximum 50. |
| radiusPercent.maximum | Maximum | Required. Safe integer; minimum 1; maximum 50. |
| areaPercentSquared | Area Percent Squared | Required. Object; no unknown keys. |
| areaPercentSquared.minimum | Minimum | Required. Finite number; minimum 0; maximum 10000. |
| areaPercentSquared.maximum | Maximum | Required. Finite number; minimum 0; maximum 10000. |
| maximumAttempts | Maximum Attempts | Required. Safe integer; minimum 1; maximum 128. |
| 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 |
|---|---|---|
| vertices | Vertices | Required. Array of Object; no unknown keys.; minimum items 3; maximum items 32. |
| vertices[].x | X | Required. Finite number; minimum 0; maximum 100. |
| vertices[].y | Y | Required. Finite number; minimum 0; maximum 100. |
| areaPercentSquared | Area Percent Squared | Required. Finite number. |
| css | Css | Required. Text; maximum UTF-16 length 4096. |
| attempts | Attempts | Required. Safe integer; minimum 1; maximum 128. |
| 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": {
"vertexCount": 4,
"radiusPercent": {
"minimum": 20,
"maximum": 40
},
"areaPercentSquared": {
"minimum": 100,
"maximum": 5000
},
"maximumAttempts": 32,
"seed": 42
},
"output": {
"vertices": [
{
"x": 82,
"y": 50
},
{
"x": 50,
"y": 79
},
{
"x": 13,
"y": 50
},
{
"x": 50,
"y": 16
}
],
"areaPercentSquared": 2173.5,
"css": "clip-path: polygon(82% 50%, 50% 79%, 13% 50%, 50% 16%);",
"attempts": 1,
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- Area is in squared percentage-coordinate units, not percent coverage or physical area. A finite attempt budget can fail without proving no shape exists; no browser clipping or fabrication safety is assessed.
- 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 CSS Keyframe Motion Generator
Generate integer-pixel random waypoints on a strictly ordered jittered time grid, piecewise-linear samples, measured path length, and portable CSS translate keyframes with a reduced-motion override; no browser rendering or physical-motion model.
- 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.