ProjectsIndustrial automation

Pallet pattern planner

A web application that takes a product drawing and a pallet and produces the pattern file a palletizing robot cell runs, with packing for irregular shapes, approach-angle planning and tool-clearance checks.

CompletedApr to Jul 2026Page updated

Project facts
Input
Box dimensions, or an irregular outline imported from a DXF drawing
Output
A pattern file for the cell controller, plus a 3D preview of the build
Modes
Palletize, depalletize, repalletize
Checks
Tool footprint, approach corridor, reachable gripper rotation, build height and weight
Done for
An employer. Shown with permission.
Built with
React, TypeScript, FastAPI, Python, Shapely, Three.js
When
Apr to Jul 2026
Status
Completed
Code
Private repository. I can walk through it on request.
Page updated
On this page

What it does

Someone setting up a palletizing cell has to answer the same questions for every product: how many fit on a layer, in which orientation, in what order the robot places them, and from which side the gripper can approach each one without hitting its neighbours. This application answers them in a browser and writes the result as the pattern file the cell controller executes.

A recipe moves through four steps: set up the product, pallet and gripper; compute and refine one layer; compose the layers into the full stack with sheets between them; then validate and export.

Packing

For boxes, the solver tries seven layout strategies (grids, brick patterns, a pinwheel, mixed zones), packs each with the configured gap, and returns up to five candidates ranked by product count and then by pallet coverage.

Products that are not boxes come in as DXF drawings. The outline is parsed, converted to millimetres and reduced to a polygon. Packing irregular outlines uses a no-fit-polygon solver: the region where one shape may sit without overlapping another is computed from the Minkowski sum of the two outlines. That is exact for convex shapes and a safe over-estimate for concave ones. A 30-second limit returns the best layout found so far rather than failing.

Can the robot get there?

A layout that fits is not yet a layout the robot can build. Three checks address that.

  • Approach direction. For every placement, eight approach directions are scored by sweeping the gripper’s footprint, plus a clearance margin, along the approach path and testing it against the products already placed. An operator sees a dial per step: clear, near the limit, or blocked.
  • Gripper rotation. Every orientation in the pattern is checked against the rotation the gripper can reach, given how the product arrives on the conveyor.
  • Tool clearance. The gripper is modelled by its footprint, its pick faces, its approach type (straight down, sliding in, or at an angle), its clearance distance and its retract height. The 3D view can draw the swept volume for a placement.

The pick-and-place order can be played back in 3D, in the order the robot will execute it.

Engineering

  • A React and TypeScript front end with a 2D editor and a 3D viewer, and a FastAPI back end that does the geometry with Shapely.
  • The repository has 565 commits and a three-job continuous-integration pipeline (linting, type checks, unit tests, and end-to-end tests in a browser).

What is not here

Code generation for specific robot languages was left out of scope: the application writes a pattern file that the cell’s own controller interprets.