Mixing, interpolating, and contouring volumetric data using some of the generalized functionality of Field3d<T>. Examples to come.
I’ve been meaning to build some subdivision operators on top of the half-edge mesh class in SpatialSlur for some time now. Having finally made some visible progress in this direction, I though I’d post some images. The weave operator below is one of several that’ll make their way into the library for the next release which should be available in the not too distant future.
I recently squashed a few remaining bugs in the differential growth simulation from earlier which means it’s ready for sharing. Here’s a link to the Grasshopper definition (note that it uses the current release of SpatialSlur.dll).
As mentioned in the previous post, the simulation uses a half-edge data structure to handle refinement of the surface mesh as it grows. When an edge exceeds a specified maximum length, it splits (along with the triangles on either side). Edges are also spun to unify vertex valence throughout the mesh, resulting in well-proportioned triangles that are ideal for all sorts of things. The video above shows the effect of different maximum edge lengths on the growth process (from large to small).
The half-edge mesh is particularly well-suited to this process because it allows such local topological modifications to be executed in constant time. In other words, splitting an edge will always take the same amount of time regardless of how many other edges are in the mesh. This property is especially important here since we’re working with an algorithm that tends to dramatically increase its own input size from one iteration to the next. Without constant-time topological operators, things would quickly get out of hand.
The process shown in the video above makes use of a phase field model to track the evolution of the interface between a supercooled liquid and a solid. While this seemed like unfamiliar territory at first, a quick look under the hood revealed a set of reaction-diffusion-like equations. The system is represented by two co-dependent scalar fields – one representing temperature and one representing the phase. The latter is either 0 (liquid) or 1 (solid) everywhere in the system except at the interface where it grades smoothly between the two extremes. At each step, the current temperature contributes to the change in phase and the change in phase contributes to the change in temperature. Over time, this feedback leads to instabilities in the interface which result in all the fancy branching patterns.
Below are a few more spoils from the differential growth studies – this time visualizing the collision spheres centered on each vertex which prevent the mesh from self-intersecting as it grows.
Besides being an extremely effective means of procrastination, it turned out to be a useful test for several classes within the SpatialSlur library – most notably HeMesh for the dynamic mesh refinement and SpatialHash3d for quickly handling vertex collisions.