The problem
Objects in graphics are points joined into triangles, and it is the GPU's job to turn that triangulation into what you see on screen. When the object changes shape, a liquid drop falling or a robot transforming into a jet, the triangulation has to change with it, and it gets distorted along the way. Triangulation is easy. Remeshing is hard: moving one interior point to fix a bad triangle affects every triangle around it, and the standard algorithms are purely geometric. We wanted a version where the mesh settles into a good shape on its own.
What we did
We modeled every interior point as a point mass, connected it to its neighbors with springs, and let it move in a damping field, with virtual charges along the boundary so points cannot escape the region. Positions come from Newton's second law, solved as a second order differential equation with Euler's method and zero initial velocity. Boundary points never move.
What we found
- 01Interior points settle into an equilibrium where most triangles come out close to equilateral
- 02Virtual charges along the boundary kept interior points inside the region on every shape we tested
- 03Tested on rectangles, triangles, L-shapes, and time-evolving shapes where the boundary changes mid-simulation
- 04Presented at the Bay Honors Symposium at UC Berkeley
In more detail
Boundary enforcement
We placed virtual charged particles along the boundary and modeled interior points as charges too. The repulsion between them keeps interior points inside the region. Same math as Coulomb's law, just applied to mesh containment instead of actual charges.
Physics model
Each interior point has three forces acting on it: electrostatic repulsion from the boundary, spring tension pulling it toward equal edge lengths with its neighbors, and a resistance term so the system actually converges instead of oscillating forever.
Implementation
The engine reads a triangulation and solves the differential equation in C++. The numerical solver was also implemented in VB.NET with Euler's first-order method and zero initial velocity, and MATLAB handled the plots, writing out a mesh snapshot at each time step so we could watch the triangulation converge.
Results
Ran tests on rectangular, triangular, and L-shaped regions with 2 to 6 interior points. Interior points consistently converged toward equilateral configurations. The engine also works on time-evolving shapes where the boundary itself changes.
Future work
The next step is localization: letting subregions resolve at higher resolution when more detail is needed there. Right now all interior points move with the same granularity, which is not ideal for engineering sims with stress concentrations.