Soft Vertex Stitch
Soft Vertex Stitch is an inter-primitive constitutive model that connects pairs of vertices from two separate meshes using spring-like energy. Each (vertex, vertex) pair forms a 2-point stencil with either a harmonic potential or a distance-based spring potential.
The first mesh provides a set of vertices and the second mesh provides a corresponding set of vertices. For each paired vertex \(\mathbf{x}_0\) (from the first mesh) and \(\mathbf{x}_1\) (from the second mesh), a soft constraint is created.
#22 SoftVertexStitch
Harmonic Energy (rest length \(L_0 = 0\))
When the rest length is zero, a simple harmonic energy is used:
This form has no singularity at zero distance, making it ideal for stitching vertices that should coincide.
Distance-Based Energy (rest length \(L_0 > 0\))
When a nonzero rest length is specified, the energy penalizes deviations from the rest length:
where:
- \(\kappa\) is the stiffness parameter
- \(L_0\) is the rest length of the spring
- \(\mathbf{x}_0\), \(\mathbf{x}_1\) are the vertex positions from the two meshes
Gradient and Hessian
For the harmonic case (\(L_0 = 0\)), the gradient and Hessian have simple closed forms:
For the distance-based case (\(L_0 > 0\)), the gradient and Hessian are computed symbolically (generated via SymPy) and projected to positive semi-definite form.
Attributes
On instances:
topo: vertex index pairs \((\mathbf{x}_0, \mathbf{x}_1)\) identifying stitched verticeskappa: \(\kappa\), the stiffness of the stitch constraintrest_length: \(L_0\), the rest length of the spring (0 for harmonic energy)