Documentation Algorithmic design

Algorithmic design

Start with algorithmic design

beginner

Last updated Sep 23, 2026

An algorithmic design is a short script that draws from a rule. Popcorn comes with examples you can use straight away. Each one shows its settings as sliders, so you tune the design instead of the code.

Open an example

  1. Choose Menu ▸ Algorithmic design.
  2. Pick a category (Line art, Patterns or With the selection) and an example, for instance Line art ▸ Ridgelines.

A floating window opens and the example appears on the canvas as a preview, inside a dashed blue frame. The preview is not part of your design yet: it is not saved, exported or shared until you press Apply. Drag the window by its title bar and resize it from the corner.

The window has four tabs:

Tab What it holds
Examples Every example with a one-line description.
Controls The sliders, switches and color pickers the script declares, and how the result is applied.
Code The script itself, its problems, and a reference of every function.
Ask AI A prompt to paste into an assistant, and a box for its reply. See Let an assistant write the script.

The line at the bottom always says what the preview shows right now, for example 120 shapes · 1005 KB · 5 ms.

Tune it

  • Move a slider or type a value: the script runs again at once and the preview follows.
  • New variation appears when the design uses randomness. It keeps every setting and makes new random choices. The same settings always give the same result, so a variation you like stays put until you ask for another.
  • After you change the code, press Run (or ⌘Enter, Ctrl+Enter on Windows) to see the new version.

Apply it

Press Apply. The shapes become one group of ordinary objects that you can move, recolor or edit like anything you drew by hand, and one Undo removes them again.

Apply only works when the preview is up to date. If the code changed since the last run, the bottom line says so and asks you to run it again: what you apply is always what you saw.

Under Output you choose how the shapes land:

  • Separate shapes: every shape is its own object. Best for designs you want to pick apart.
  • Merged by style: shapes that share a fill and stroke become compound shapes. Much lighter for dense patterns, still fully editable, and stacked exactly as drawn.

Edit it later

The group remembers its script. Select it, and Properties shows an Algorithmic design row:

  • Edit script reopens the window with the code and your slider values. Nothing runs until you press Run or move a slider. Update then replaces the shapes inside the group. If you moved, turned or scaled the group in the meantime, the new result keeps that placement. If you changed shapes inside it by hand, Popcorn asks before replacing them.
  • Make a new group instead (in the Controls tab) applies the next result as a new group and leaves the old one alone.
  • Detach keeps the shapes and forgets the script.

Opening a design never runs its scripts. A script only runs when you press Run, move one of its sliders or, for scripts that use the selection, change the selection while the window is open.

Change the selected objects

Scripts can also move, turn, scale, recolor, copy or remove the objects you select. Select some objects first, then choose an example under Menu ▸ Algorithmic design ▸ With the selection, such as Arrange on a circle. The preview shows each object as an outline at its new place; nothing moves until you press Apply, and one Undo puts everything back. Locked objects are left out.

Next