The Cuboctahedral Heart: A Valentine Gift for Lina

As the title suggests, the GIF above is a Valentine I made for my beloved wife, Lina. It is, in fact, the maximally dense \text{P2}_{1} \text{/c}  \ | \text{Pbca} Cuboctahedral Molecule Packing configuration from the Densest Packings of Cuboctahedral Molecules post.

To be honest, saying that I made the GIF is a bit misleading. It was actually created by the OpenCode AI coding agent, running the Claude Opus 4.6 model provided by Anthropic. I merely supplied the MATLAB FIG-file of the configuration’s figure, the shape of which reminded me of the heart symbol.

I have been watching closely AI-assisted software development for some time now, but all of the Large language models have proven entirely inadequate for the level of array programming capability required in my research. They have all failed, even at simple tasks such as writing a MATLAB script to visualise a regular icosahedron. For example, below is a response by OpenAI’s state‑of‑the‑art GPT model produced only last September, alongside what an actual regular icosahedron looks like for comparison. You can probably guess which figure is the output of the script written by GPT.

However, a few weeks ago, during my monthly routine check of the state of AI coding assistants, I was genuinely impressed with the \text{Research} \rightarrow \text{Plan} \rightarrow \text{Implement} framework of Claude Code CLI.

Today, I discovered that MathWorks has already released an official MATLAB Model Context Protocol (MCP) for agentic AI workflows. So I decided to test it thematically on a Valentine animation task. You can see the result at the top of the page.

Solving the task wasn’t as straightforward as I had thought it would be. The main issue lay in getting the orbit of rotation of the camera around the configuration right, but that was more of a mistake on my part, as I didn’t know how to explain it to the agent properly. The initial \text{Research} \rightarrow \text{Plan} \rightarrow \text{Implement} cycle went surprisingly well. And yes, although it may seem as though the camera is fixed and the object rotates around its axis, it is in fact the object that is fixed, while the camera and the light source rotate around it. It turned out to be easier this way.

After few back-and-forth exchanges with the agent, once I was satisfied, I asked the agent to create a public repository on my GitHub account, complete with everything needed to generate the animation, including writing a README.md documentation featuring a GIF animation at the top of the page. The result is available here: milotorda-net/cuboctahedral-heart. I’m quite happy with how it worked out.

Now that I have everything set up, it is time to get down to real business with my MATLAB‑context‑armed OpenCode agent.