← All projects

Inverse origami design for trajectory following

Tsinghua IIIS, with Prof. Tao Du

Overview

Given a 3D trajectory, we generate a rigid-foldable crease pattern whose folding moves a point along it. An autoregressive diffusion model writes the pattern one vertex unit at a time, conditioned on the trajectory. On 500 held-out curves, the best of 16 generated designs comes within 5% of the curve's reach for 86% of them; the closest of a million training designs does so for 52%.

Method

Representation

A degree-4 vertex is the smallest unit of rigid folding: once its incoming crease folds, its sector angles fix the other three folds, up to a choice between two branches. We therefore generate a whole unit as one token. Generating creases or vertices separately would leave the state incomplete, since a unit's motion is defined only once all four of its angles are known.

The units form a tree rooted at the driving crease, and motion passes only from parent to child. We generate along this tree, so each new unit attaches to one whose motion is already fixed; an order that does not follow the tree would condition on branches the new unit does not depend on. Here the tree is a single chain to the tracked vertex, at most 8 units long, and the model decides where it ends.

Method figure as blocks with arrows. Left, top: vertex unit = one token, a degree-4 vertex drawn as a disk with sector angles alpha 1 to 4 and crease lengths l 1 to 3; folding its incoming crease by rho folds the disk, and the two free sectors theta 1 and theta 2 and the gap theta 3 that rho opens must satisfy the triangle inequality. Left, bottom: the target curve (condition), 32 points along a 3D path next to the driving crease. Both feed the autoregressive diffusion block in the middle: a curve encoder and a causal Transformer decoder, one diffusion head per token, and above each token the flat crease pattern so far, white with its newest unit in the sector colors. Right, top: the units make the crease pattern; right, bottom: the folding simulation, whose end vertex follows the dashed target with 1.2% error.
Generating a crease pattern one vertex unit at a time. Each token is one degree-4 vertex: four sector angles, three crease lengths, which of its two folded branches it takes, and where the chain continues or ends. All patterns are from one real generated design.

Model

Our analysis points to two choices that matter: generating autoregressively, one unit per token, so every unit is sampled knowing the motion it inherits; and conditioning on the target, so the crease pattern is generated as the controller of that motion. A Transformer encodes the 32 curve points, a causal Transformer decoder reads the units placed so far with their layout on the paper, and a small diffusion head samples each token's geometry and class. The model is trained on 300k random patterns folded in simulation; at test time we draw a few designs, fold each, and keep the closest.

Results

We first test on trajectories from the training distribution, 500 held-out curves. The model's designs follow them closely, much more closely than the best designs found by searching the training set.

MethodCurves within error (best of 16) Median
error
Median
Fréchet
Samples
that build
≤ 2%≤ 5%≤ 10%
Nearest training designs (1M pool)10.6%51.8%85.4%4.9%7.3%100%
Ours, no guidance (guidance 1)46.0%84.8%97.8%2.1%3.3%71.5%
Ours, guidance 1.551.2%85.8%96.6%1.9%3.1%72.0%

500 test curves, 16 designs each. Error: root-mean-square distance after matching the curves by arc length, as a percentage of the target's reach. A sample builds if its creases do not cross.

Folding to held-out curves

Pick a held-out test curve below. Every design is a generated pattern folded in simulation.

Loading the folding viewer…

Each panel shows a generated crease pattern (left; mountain folds in red, valley folds in dashed blue, the driving crease in thick black) and its folding simulation (right). Drag the folding side to rotate it. The two designs per curve differ in structure, picked by hand from the best three at guidance 1 and 1.5.

Watching a design grow

Each token adds one unit. After every token, the pattern so far is folded and the path of the vertex the next unit grows from is traced.

Left: the crease pattern so far; the pink ring marks where the next unit grows. Right: that pattern folded. Pink: the path of the ringed vertex; orange: the end vertex once the chain ends; dashed: target. Play unfolds each stage from folded to flat, leaving the path behind.

Comparison with latent-space search

The closest prior work, Hochuli and Stankovic (H&S, Journal of Mechanisms and Robotics, 2025), learns an unconditional generative model of crease patterns. A β-VAE decodes a whole pattern at once, as vertex positions and an adjacency matrix, and nothing in its latent space enforces rigid foldability, which a single wrong entry can break: only 0.1% of its samples are valid, and a normalizing flow on the latent space raises this to 10%. Since the model does not see the target, every new target needs a search: a genetic algorithm explores the latent space, folding and scoring about 15,000 designs over 2.7 hours. We instead sample designs conditioned on the target, one rigid unit at a time, so only crossing creases make a sample invalid, and 16 designs per target suffice.

ParametersTraining dataTrainingValid samples Designs folded
per target
Time per
target
H&S 2025200M8M53 h10%15,0002.7 h
Ours11M300k12 h76%1613–21 s

Their figures are from their paper (approximate where they give no exact number); ours are from the 500 test curves above. Training data: crease patterns, ours a subset of theirs; training on an RTX 3060 (theirs) and an RTX 2080 Ti (ours). Valid: the simulator accepts an unconditional sample as a rigidly foldable pattern. Times include folding and scoring, on different machines.

Their benchmark

We also ran our model on curves from their benchmark and scored the results with their objective (lower is better). Their targets are shapes without size or heading, so we try 648 placements of each, sample 10 designs at each, and keep the best. We compare scores, not search cost.

Loading the folding viewer…

CurveGenetic algorithmOurs
Helix14.26.53
Spherical bi-angle4.262.87
Triangle4.935.06
Sine2.887.27

Their objective; lower is better. Genetic algorithm: best of their 8 runs (their Table 4). Ours: best design over our runs. Bold: better than the genetic algorithm.

Left: our best design for the chosen curve, with the target (dashed) where their objective aligns it. Drag to rotate.

Four benchmark curves, Helix, Spherical bi-angle, Triangle and Sine. Top row: the genetic algorithm's trajectories from Hochuli and Stankovic, with their best objective: 14.2, 4.26, 4.93, 2.88. Bottom row: our best trajectory for the same curve on the same axes, with its objective: 6.53, 2.87, 5.06, 7.27.
Top: trajectories from Hochuli and Stankovic (2025), Fig. 10 (Sine: Fig. 9(c)), traced and redrawn with the exact target; the number is the best objective of their 8 runs. Bottom: ours, on the same axes. Dash-dot green: target; red: trajectory.

Scaling and rotating a target

Below, a hard test curve is scaled or turned about its start, step by step, and at every step the model draws 32 designs; we pick one design per step for the whole range, with a penalty for every change of design. The picked design can be kept over long stretches, with only its geometry adjusted, while the error stays low and well below the nearest training designs picked the same way. This works because the generative model generalizes between designs and learns the features that matter, rather than recalling the designs it has seen.

Loading the slider…

Left: the crease pattern, with the driving crease held fixed. Right: its folding, with the target dashed. Playback sweeps the range and rests at every computed step; between steps the design is interpolated. Drag the slider or the chart to move through the range, and the folding side to rotate it. Error: mean distance between 32 points matched by arc length, as a percentage of the target's reach.

Limitations and future work

Curves moved away from the training distribution are matched less well: the share of test curves within 5% drops from 88% to 39% when they are halved in size and to 11% when they are turned 90° about their start. About 28% of raw samples do not build because their creases cross, and long spirals and helices are still hard to match.

Next, we will optimize patterns with several branches so that two points follow two trajectories at once.