Skip to content

Main content

Random Embroidery Motif Placement Plan Generator

Place supplied motif boxes on cloth using a bounded random shelf policy with margins and gaps; failure is policy-specific, and stitch technique and hoop deformation are excluded.

Loading tool…

Description

Place supplied motif boxes on cloth using a bounded random shelf policy with margins and gaps; failure is policy-specific, and stitch technique and hoop deformation are excluded.

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.

Place supplied motif boxes on cloth using a bounded random shelf policy with margins and gaps; failure is policy-specific, and stitch technique and hoop deformation are excluded.

When to use this tool

Use this generator to create reproducible embroidery motif placement 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 width, height, margin, gap, count, motifs 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 placements, clothArea, motifArea. Use the conventions below. Keep answer-bearing fields separate when presenting an exercise.

Inset the cloth by margin and fill it using a randomized nonrotated shelf sequence. Choose fitting motifs, advance horizontally by width plus gap, and start a new row below the tallest motif when necessary. Return placements and summed motif area.1

Input fieldMeaning and unitsAccepted input
widthWidthRequired. Finite number; strictly above 0.
heightHeightRequired. Finite number; strictly above 0.
marginMarginRequired. Finite number; minimum 0.
gapGapRequired. Finite number; minimum 0.
countCountRequired. Safe integer; minimum 1; maximum 32.
motifsMotifsRequired. Array of Object; no unknown keys.; minimum items 1; maximum items 16.
motifs[].idLiteral identifier used independently of display labels.Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 80.
motifs[].widthWidthRequired. Finite number; strictly above 0.
motifs[].heightHeightRequired. Finite number; strictly above 0.
seedOptional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed.Optional. Safe integer.
Output fieldInterpretationReturned shape
placementsPlacementsRequired. Array of Object; no unknown keys.; minimum items 1; maximum items 32.
placements[].motifIdMotif IdRequired. Text; minimum UTF-16 length 1; maximum UTF-16 length 80.
placements[].indexIndexRequired. Safe integer; minimum 0; maximum 31.
placements[].xXRequired. Finite number.
placements[].yYRequired. Finite number.
placements[].widthWidthRequired. Finite number; strictly above 0.
placements[].heightHeightRequired. Finite number; strictly above 0.
placements[].areaAreaRequired. Finite number; strictly above 0.
clothAreaCloth AreaRequired. Finite number; strictly above 0.
motifAreaMotif AreaRequired. Finite number; strictly above 0.
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": {
    "width": 6,
    "height": 4,
    "margin": 0,
    "gap": 1,
    "count": 2,
    "motifs": [
      {
        "id": "leaf",
        "width": 2,
        "height": 2
      }
    ],
    "seed": 42
  },
  "output": {
    "placements": [
      {
        "motifId": "leaf",
        "index": 0,
        "x": 0,
        "y": 0,
        "width": 2,
        "height": 2,
        "area": 4
      },
      {
        "motifId": "leaf",
        "index": 1,
        "x": 3,
        "y": 0,
        "width": 2,
        "height": 2,
        "area": 4
      }
    ],
    "clothArea": 24,
    "motifArea": 8,
    "randomness": {
      "seed": 42,
      "source": "seed"
    }
  }
}

Limitations and assumptions

  • A no_fit error means this sampled shelf sequence failed; another arrangement may fit. Area totals do not account for thread, stitch density, cutting, or physical fabric behavior.
  • 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 Embroidery Motif Placement Plan Generator — tool.io

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.