In this article
01 / THE IDEA

Watch the pattern take shape.

With Yarnify3D, we want people to write a crochet pattern and watch its 3D representation develop as they go.

The problem is that a list of stitches does not directly tell us where they belong in space. We need to understand their connections, their dimensions and how the rows influence the shape.

“I’m writing my pattern and watching it take shape as I write.”

That immediate feedback guides our approach: calculate a plausible shape using heuristics, without waiting for a long physics simulation to settle.

02 / THE LANGUAGE

From text to instructions.

The parser turns the text into a typed representation of the pattern, including stitch type, count, color and the row each stitch belongs to.

PATTERNTwo rows, seven stitches
11: 4 ch
22: 3 sc

Here, ch means a chain stitch and sc means a single crochet stitch, using US terminology. The engine reserves a turning chain: the four chain stitches provide three usable foundations for the next row.

FROM TEXT TO PREVIEW01 / Pipeline
Text

The written pattern

1: 4 ch
2: 3 sc
Each step transforms the previous representation. Select a step to follow it.

Parsing does more than recognize words. It resolves repetitions and counts, and reports inconsistencies. An instruction can be understandable while still requiring more foundation stitches than the pattern provides.

03 / THE GEOMETRY

Connect, then place the stitches.

We then build a graph: points for stitches and links for their connections. This describes the relationships before assigning coordinates.

Placement uses those relationships, stitch dimensions and geometric rules to estimate the shape. For some closed sections, we also approximate the effect of stuffing pushing the walls outward.

THE TRADEOFF

The result is an approximation of real crochet. We prioritize an immediate preview, with heuristics that can improve through user feedback.

Once the points are positioned, Three.js displays the nodes and the curves connecting them. We build rendering data rather than generating a JavaScript program from the pattern.

04 / THE PHYSICS

Refine the shape with physics.

Physics simulation is a separate option alongside the initial placement. Rapier represents points as bodies connected by spring and rope constraints, then updates their positions.

The simulation aims to behave more like real crochet, but it remains imperfect. We would like to add stuffing pressure, already approximated in geometric placement, to better reproduce the volume of closed shapes.

IMMEDIATE PREVIEW

Heuristic placement

A shape calculated from the pattern and the connections between stitches.

OPTIONAL SIMULATION

Rapier simulation

Positions that evolve under the physical constraints of the model.

05 / THE EDITOR

Keep a preview while making corrections.

A pattern being written is often incomplete. Making the representation disappear after every error would make editing frustrating.

We therefore keep the last validated version on screen. The editor can report a problem while the preview remains visible; once a new version passes validation, it replaces the previous one.

06 / WHAT COMES NEXT

Improve without losing fluidity.

We plan to refine our heuristics through user feedback. The goal stays the same: bring the preview closer to real crochet while preserving the feeling of watching a pattern develop as you write it.

That tradeoff between fidelity and immediate interaction guides the evolution of the engine.

Want to explore the project?

Explore Yarnify3D ↗

Manuel Tomé

Full-Stack & DevOps developer, Yarnify3D co-founder and DockScope creator.

Discover my projects ↗
← Back to articles