# \[ANN\] PolyominoTools.jl - easy experimentation with polyominoes

**URL:** <https://discourse.julialang.org/t/ann-polyominotools-jl-easy-experimentation-with-polyominoes/143378>\
**Category:** Package Announcements\
**Tags:** puzzles, combinatorics\
**Created:** [December 1, 2026, 8:25am UTC](https://discourse.julialang.org/t/ann-polyominotools-jl-easy-experimentation-with-polyominoes/143378 "2026-12-01T08:25:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wclaerhout](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wclaerhout/32/225553_2.png) [@wclaerhout](https://discourse.julialang.org/u/wclaerhout)\
**Post date:** [December 1, 2026, 8:25am UTC](https://discourse.julialang.org/t/ann-polyominotools-jl-easy-experimentation-with-polyominoes/143378/1 "2026-12-01T08:25:23Z")

</div>

# PolyominoTools.jl - easy experimentation with polyominoes

PolyominoTools.jl is a lean and straightforward package to experiment with enumerating, joining, splitting and just playing around with these little blocks. Code and docs can be found on [GitHub](https://github.com/wclaerhout/PolyominoTools.jl).

### Origin story

I distilled this code from a research project, where I used polyominoes as a proxy for large, discrete search spaces. I realized that once the polyomino tooling was built, it is incredibly easy to start experimenting with different scenarios, so I built the core functionality into PolyominoTools.jl.

### Philosophy

The package aims to be easy, lean and general-purpose, so anyone can pick it up. The only dependency is Makie, and it’s optional: you only need it for plotting.

### Easy tooling

A polyomino can be built as follows:

```julia
using PolyominoTools

p = poly"""
###
"""

p1 = poly"""
##.
###
"""

```

You can then try to attach them to each other at a specified location and subsequently also split the result.

```julia
julia> attach(p, p1, (1, 2))
8-cell Polyomino (3×5):
 ..##.
 ..###
 ###..

```

Afterwards, you can find all unique splits up to symmetry:

```julia
julia> q = attach(p, p1, (1, 2));

julia> splits = unique_splits(q, symmetry = :full); # translation, rotation and mirroring

julia> length(splits)
10

julia> a, b, n = splits[1];

julia> b
7-cell Polyomino (3×4):
 .##.
 .###
 ##..

```

And visualizing your polyomino:

```julia
julia> using CairoMakie
julia> visualize_polyomino(q)

```

 ![display](https://global.discourse-cdn.com/julialang/original/3X/a/4/a430f8f84d6292858ee530161add1eb55307f34d.png)

### What could you use it for?

The package doesn’t assume a particular application, but provides the building blocks that keep coming back when working with polyominoes:

- **Enumeration:** generate fixed, one-sided or free n-ominoes, with canonical forms for reliable symmetry-aware comparison
- **Attaching and splitting:** join shapes at any offset, or list all unique ways to cut a shape into two connected parts, up to the symmetry you choose; handy for dissection problems or growth processes on the lattice
- **Combinatorics and lattice animals:** count shapes, classify them by symmetry, or sample them for statistical analysis
- **Tiling and packing:** use the shape operations as a base layer for tiling or packing problems
- **Visualization:** plot shapes and their decompositions with Makie

I’m curious what other people would do with it, so feel free to reply here with ideas, use cases or features you’d like to see. Issues and PRs on GitHub are very welcome too.

### Installation

You can add PolyominoTools.jl to your project through the Julia package manager.

```julia-auto
pkg> add PolyominoTools

```

---

<div class="post-metadata">

**Author:** ![bspanoghe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bspanoghe/32/209460_2.png) [@bspanoghe](https://discourse.julialang.org/u/bspanoghe)\
**Post date:** [December 1, 2026, 10:20am UTC](https://discourse.julialang.org/t/ann-polyominotools-jl-easy-experimentation-with-polyominoes/143378/2 "2026-12-01T10:20:14Z")

</div>

Bangin’ package my man

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [December 1, 2026, 11:35am UTC](https://discourse.julialang.org/t/ann-polyominotools-jl-easy-experimentation-with-polyominoes/143378/3 "2026-12-01T11:35:51Z")

</div>

The obvious application of a Polyomino package is, of course, to implement Tetris.
