Push-Heal Rectangulation

Deterministic rectangulation generator for an integer grid. It subdivides [0..N] x [0..N] into axis-aligned rectangles using a local push-heal operation.

Playground

Try it live in the browser.

Open Playground

Contract

Deterministic behavior: same version + same options + same seed = same output.

Install

npm i push-heal-rectangulation

Quickstart

import { createGenerator } from "push-heal-rectangulation";

const gen = createGenerator({
  size: 60,
  seed: "12345",
  bootstrapRect: { width: 2, height: 2 },
  hopStrategy: "random",
  prioritizePotential: false,
  includeSegments: true,
  recordSteps: false,
});

const out = gen.run();
for (const r of out.rects) {
  // primary output
}

License

MIT