Skip to content

Closing rings

Open and close the hole of every donut in a grid with Each, in a wave from the centre.

Preview of closing rings

Static preview at 1 second. Open the scene in the editor and press Play to see the motion.

Animation · Donut → Clone → Each › Shape

Download scene JSON · Open SVG preview

Download the JSON file and open it in svertik with Open or by dragging it onto the editor. The scene is complete and editable.

  1. Create a Donut with Outer 14 and Inner 10, filled turquoise, without stroke.

  2. Add Clone in Grid mode: Columns 15, Rows 11, Spacing [1.1, 1.1].

  3. With Clone selected, add Each from the Effect menu. It lands right after the Clone, with a Shape inside.

  4. Select Shape, press + in Per copy and choose Inner. Give it this formula:

    12 * clamp(0.5 + 0.5 * sin(scene.time * pi / 2 - element.distance * 6), 0, 1)

    element.distance is 0 for the centre copy and 1 for the furthest one, so each ring of copies is a step behind the one inside it: the wave travels outwards. clamp keeps Inner between 0 (a full disc) and 12 (a thin ring).

  5. Set the document duration to 8 seconds with Loop enabled. scene.time * pi / 2 completes a cycle every 4 seconds, so the loop is seamless.

  • 12 * (1 - element.distance): a still grid, open in the centre and closed at the edges.
  • 12 * element.random: every hole a different size, fixed per copy. Each’s Random seed shuffles them.
  • 12 * element.u: the holes close from left to right. element.v does the same from top to bottom.
  • Add a Transform inside Each with Rotation 360 * element.random: every copy turned on its own. Any effect inside Each reads element.* the same way.

Run this from the main svertik checkout, replacing the input path with the downloaded file:

Terminal window
pnpm svertik render closing-rings.json -o closing-rings.svg --time 1
{
"version": 1,
"notes": "A grid of donuts whose holes open and close in a wave from the centre. Each \u203a Shape gives every Clone copy its own Inner, from element.distance and scene.time.",
"document": {
"width": 640,
"height": 480
},
"animation": {
"duration": 8,
"loop": true,
"fps": 60,
"tracks": []
},
"objects": [
{
"kind": "shape",
"id": "rings",
"name": "Rings",
"shape": "donut",
"params": {
"radius": 14,
"innerRadius": 10,
"fill": true,
"fillColor": "#09fdd1",
"stroke": false
},
"stack": [
{
"id": "rings-clone",
"type": "clone",
"params": {
"mode": "grid",
"columns": 15,
"rows": 11,
"spacing": [
1.1,
1.1
]
}
},
{
"id": "rings-each",
"type": "each",
"params": {
"seed": 1
},
"children": [
{
"id": "rings-shape",
"type": "shapevalues",
"params": {
"innerRadius": {
"$expr": "12 * clamp(0.5 + 0.5 * sin(scene.time * pi / 2 - element.distance * 6), 0, 1)",
"fallback": 10
}
}
}
]
}
]
}
]
}

Clone · Each · Shape · Donut

Back to all recipes