Research Project

Mass-Spring-Charge Systems

Python C++ Blender

Master's thesis research on charged mass-spring systems for computer animation. Co-first author on a published paper, with my contribution focused on debugging and optimizing the DDEF charge-interaction algorithm and building the complete artist-facing tooling pipeline from scratch.

Read on arXiv
Mass-Spring-Charge Systems
Co-first Author on published paper
10x - 300x Speedup after C++ optimization
85% Listed as exceptional dissertation
Python / C++ Stack

About the Project

This project formed the basis of my Master's thesis and a wider research paper on charged mass-spring systems for computer animation. The broader idea was to extend traditional mass-spring simulation with electrostatic charge interactions, so that deformation could be driven not just by springs but also by charge-based forces and artist-controlled fields.

I joined the project after the core simulation framework had already been established. My contribution focused on two areas: the DDEF algorithm used to approximate charge interactions, and the artist tooling that turned the research into a usable creative workflow.

Why this project stands out

  • Co-first author on a research paper on charged mass-spring systems for animation.
  • Dissertation awarded 85% and selected for the university's list of exceptional dissertations.
  • Found and fixed a critical bug in the DDEF implementation, significantly reducing error after a full reimplementation in Python.
  • Reimplemented and optimized DDEF in C++, achieving 10x to 300x speedup over the Python version depending on test conditions.
  • Benchmarked DDEF against PME and Ewald, with stronger speed, accuracy, and scalability in the tested conditions.
  • Built the complete artist tooling pipeline - Blender export/import, Polyscope interactive controls, keyframing system, vertex-group charge control, Gaussian charge tools, and round-trip back to Blender for final rendering.

Visual Results

Example outputs from the wider project, showing the kinds of motion and deformation the system can produce through charge-based control.

Frame 0 Frame 1 Frame 2 Frame 3 Frame 4
Orbs Sphere

Interactive Simulation Tooling

The simulator is driven through the Polyscope-based interface shown here, letting users place, move, and tune charge sources in real time and watch the mesh respond immediately. Controls expose charge strength, Gaussian orb position, external charges, and per-vertex group charge assignments, all adjustable live without touching code. The goal was to make the simulation feel like a creative tool rather than a script you run and wait on.

Wave Scratch

Fine Control and Blender Round-Trip

Shaping the fields acting on the mesh rather than editing it directly gives precise, localised control. Once finished, the simulation feeds back into Blender as a fully animated mesh: the simulator outputs vertex positions per frame and the import script reconstructs the mesh using the original topology. Because it comes back as geometry, artists can apply materials, subdivision modifiers, and rendering setups directly on top of the result.

Artist Tooling Pipeline

The second half of my contribution was turning the research simulator into something artists could actually use as a production workflow. This meant designing and building every part of the interface between the artist and the simulation, from asset import through to final rendered output.

Blender Export

Wrote the tooling to export meshes from Blender into the simulator's format, preserving vertex group information so different parts of the mesh could be driven by separate charge configurations inside the simulation environment.

Polyscope Interactive Controls

Built the full GUI in Polyscope. Artists assign charges to vertex groups via sliders and preview behaviour directly in the simulator. Simpler models can even handle real-time updates. Also supports Gaussian charge spheres and external charges for shaping fields acting on the mesh rather than editing it directly.

Keyframing System

Built a keyframing system for charge changes over time, replacing the need to rerun simulation from scratch on every edit. Artists define charge behaviour across a timeline in a way that maps closely to a standard animation workflow, making the system practical as a creative tool rather than a research prototype.

Round-Trip Back to Blender

Built the import side of the pipeline: the simulator outputs vertex positions per frame, and the script reconstructs a fully animated Blender mesh by combining those positions with the original topology. Works with modifiers like subdivision so a lower-resolution simulation can drive a detailed final render.

DDEF Algorithm

Debugging and Reimplementation

The original DDEF concept had been prototyped in MATLAB. I reimplemented it in Python to investigate why accuracy was much lower than expected, which led to finding a deeply hidden correctness bug in how charge storage was handled relative to the split between near-field and far-field calculations. It took around two weeks of focused analysis, working through large volumes of raw numerical output, before I could isolate it. Fixing it reduced error significantly and made the later optimization work worthwhile.

C++ Optimization and Benchmarking

Once correct, I reimplemented DDEF in C++ and optimized it through lower-level work and multithreading, achieving 10x to 300x speedup over the Python version. I also built the benchmarking scripts and graphs used to evaluate the method. In tested conditions DDEF outperformed PME and Ewald across all tested sizes on speed, accuracy, and scalability, remained usable into the millions of vertices while PME and Ewald hit memory limits around the low hundreds of thousands, and overtook brute force at roughly 200k vertices.