稳定形态
基于计算流体动力学的形态生成探索GH插件
StableShape
Morphology Generation Grasshopper Plugin Based on Computational Fluid Dynamics
StableShape
Download项目概述
Project Overview
StableShape项目专注于模拟流体动力学和粒子系统,使用计算框架来创建稳定的形态生成。该算法基于Jos Stam的稳定流体方法,通过管理速度场、密度场以及扩散、对流和压力投影等方法来保持流体动力学的稳定性。
项目将流体模拟与形态生成结合,探索了从标量场到形态的转化过程,利用三维中的等势表面平滑地表现流体运动。通过这种方法,我们可以创建出既符合物理规律又具有美学价值的建筑和设计形态。
The StableShape project focuses on simulating fluid dynamics and particle systems using a computational framework to create stable morphogenesis. The algorithm is based on Jos Stam's stable fluid method, maintaining fluid dynamics stability by managing velocity fields, density fields, and methods for diffusion, advection, and pressure projection.
The project combines fluid simulation with morphology generation, exploring the transformation from scalar fields to form, using equipotential surfaces in three dimensions to smoothly represent fluid motion. Through this approach, we can create architectural and design forms that are both physically accurate and aesthetically valuable.
算法框架
StableShape算法的核心包括两个主要组件: StableFluid类和ParticleSystem类。StableFluid类管理速度场和密度场,并通过扩散、对流和压力投影等方法解析Navier-Stokes方程。这些方法确保了流体动力学模拟的稳定性。
ParticleSystem类则操作由弹簧连接的粒子网格, 允许进行张力计算和网格重建。通过将网格顶点视为受稳定速度场影响的粒子,该框架实现了逼真的流体行为模拟。
Algorithm Framework
The core of the StableShape algorithm includes two main components: the StableFluid class and the ParticleSystem class. The StableFluid class manages velocity and density fields, resolving the Navier-Stokes equations through methods like diffusion, advection, and pressure projection. These methods ensure the stability of fluid dynamics simulation.
The ParticleSystem class operates on a mesh of particles connected by springs, allowing for tension calculations and mesh reconstruction. By treating mesh vertices as particles influenced by a stable velocity field, this framework achieves realistic fluid behavior simulation.

从场到形态
项目探索了从标量场到形态的转化过程。在科学中,场是一个物理量,可以通过标量、向量或张量表示,对空间和时间中的每个点都有一个值。例如,电场或磁场是标量场,在二维平面上为每个点提供一个值。在流体情况下,标量场表示流体密度。
在三维中,标量场的等势空间是二维的,即等势表面。我们可以使用这些等势表面来表示三维流体,这与二维高度场不同。在这里,任何等势表面都是一个三维闭合体,相当于一条等高线。
From Field to Morphology
The project explores the transformation from scalar fields to morphology. In science, a field is a physical quantity, represented by a scalar, vector, or tensor, that has a value for each point in space and time. Examples of scalar fields are electric or magnetic fields, containing values for each point on a 2D plane. In the fluid case, our scalar field represents fluid density.
In three dimensions, the equipotential space of a scalar field is two-dimensional, that is, equipotential surfaces. We can use these equipotential surfaces to represent three-dimensional fluid, which differs from a 2D height field. Here, any equipotential surface is a three-dimensional closed body, equivalent to a contour line.
形态生成方法
Morphogenesis Methods

StableShape提供了两种生成形态的方法:VDB方法和网格方法。VDB方法使用Dendro插件将密度点转换为体积。网格方法则使用粒子系统处理网格。通过这两种方法,可以从简单的基本形状逐步演化出复杂的流体形态。
项目利用Grasshopper界面进行交互设计,包括网格构建、VDB处理、StableFluid求解器和ParticleSystem求解器等组件。这种工作流程允许设计师直接操作并实时观察形态的演变过程。
StableShape offers two methods for generating morphology: the VDB method and the mesh method. The VDB method uses the Dendro plugin to convert density points to volumes. The mesh method employs the particle system to process meshes. Through these two methods, complex fluid forms can be evolved from simple primitive shapes.
The project utilizes the Grasshopper interface for interactive design, including components such as grid construction, VDB processing, StableFluid solver, and ParticleSystem solver. This workflow allows designers to directly manipulate and observe the evolution of forms in real-time.
实现过程
Implementation Process

流体求解器的实现过程包括初始化、添加密度、更新速度场和更新密度场四个主要步骤。每个时间步中,算法通过扩散、投影和对流操作来解析Navier-Stokes方程,确保流体模拟的物理准确性和数值稳定性。
网格求解器则处理粒子系统,包括网格拓扑处理、粒子移动、张力应用和网格重建。通过这些步骤,系统可以生成随时间演变的流体形态,为建筑和设计探索提供新的可能性。
The implementation process of the fluid solver includes four main steps: initialization, adding density, updating the velocity field, and updating the density field. In each time step, the algorithm resolves the Navier-Stokes equations through diffusion, projection, and advection operations, ensuring physical accuracy and numerical stability of the fluid simulation.
The mesh solver processes the particle system, including mesh topology processing, particle movement, tension application, and mesh reconstruction. Through these steps, the system can generate fluid forms that evolve over time, providing new possibilities for architectural and design exploration.