Laplacian smoothing

smooth.laplace evens a mesh by many cheap passes. One pass, step by step, computed by the smoother itself:

(a) shrink: each quad's corners are re-read at ±w, toward its own centre; a boundary side stays at ±1
(b) average: each vertex goes to the mean of its shrunk corner copies (four for the one followed)
1: on curve, ×2412: frozen, ×292
(c) snap: a vertex on a curve is projected onto it, a frozen one returns to its anchor (magnified below)

One pass on a 3 × 3 patch with w = 0.7 (the default is 0.97; a smaller w is drawn so the moves show). The bottom and sides are frozen, the two middle top vertices are on the arc (red). The result is identical to laplace(passes=1, w=0.7). The followed vertex moves 0.15 of an edge in (b); the snap moves are smaller, 0.029 and 0.024 of an edge in the insets.

Key points

  • A pass is shrink, average, snap, with no neighbour list: a vertex sees only the shrunk corners of its own quads.

  • Boundary vertices slide along the boundary, in three layers (Boundary settings).

  • A pass that hurts is refused: one that adds an inverted quad, or lowers the minimum scaled Jacobian by more than max_sj_drop, is rolled back and the stage stops.

The pass

The bilinear map of quad \(q\) is \(x_q(r,s)=\sum_j N_j(r,s)\,x_j\) with \(N_j=\tfrac14(1+r_jr)(1+s_js)\). Step (a) re-reads the four corners at \(\pm w\) instead of \(\pm1\):

\[ \begin{align}\begin{aligned}\tilde x_{q,k} = x_q(w\,r_k,\,w\,s_k) = \alpha\,x_k + \beta\,(x_{k+1}+x_{k-1}) + \gamma\,x_{k+2},\\\alpha=\tfrac{(1+w)^2}{4},\ \ \beta=\tfrac{1-w^2}{4},\ \ \gamma=\tfrac{(1-w)^2}{4}.\end{aligned}\end{align} \]

Steps (b) and (c), with \(m_v\) the number of quad corners at \(v\), \(P\) the projection onto its target, \(i\) the pass and \(N\) the number of passes:

\[x_v \leftarrow \frac{1}{m_v}\sum_{(q,k)\to v}\tilde x_{q,k}, \qquad x_v \leftarrow x_v + \omega_i\,\bigl(P(x_v)-x_v\bigr),\quad \omega_i=\frac{i}{N}.\]

The last pass is a full snap; a frozen vertex returns to its anchor every pass.

Boundary vertices

A boundary vertex has quads on one side only, so a plain average pulls it inward. Three layers keep it on the boundary: source (a boundary side is not shrunk across its normal), movement (under Tangent, the move loses its component normal to the boundary) and constraint (the snap). One vertex under each setting: Boundary settings. The same rules over a whole disk:

worst-corner scaled J≤ 01input boundary

free disk, uneven boundary

input
min J 0.27
free
area -15.7 % · off circle 1.0 h
tangent
area +0.2 % · off circle 0.00058 h
slide
area +0.2 % · off circle 0.0012 h

The comparison’s free disk, its boundary vertices slid along the circle by up to 0.3 of their spacing, after laplace(passes=100, w=0.95). free: boundary="free"; tangent: boundary="tangent"; slide: boundary="slide". Off circle: the largest distance of a boundary vertex from the circle, in mean boundary edges h.

Parameters

parameter

default

meaning

passes

3

number of passes

w

0.97

shrink factor per pass, in (0, 1]; 1 is a no-op, smaller moves vertices more

normals

None

reference normals for the readings (default: the input’s winding)

elements

None

boolean mask of quads: only their vertices move (the local variant)

max_sj_drop

0.05

a pass that adds an inverted quad or lowers the minimum scaled J by more than this is refused and the stage stops on the last accepted pass

kappa

1000.0

inversion-penalty weight, used only for the F/quad reading in the log

eps

0.05

inversion-penalty threshold on the scaled J, likewise only for the reading

laplace_local is the same call with elements set to the failing quads.

Limitations

  • No shape objective: it never reads \(\varphi\).

  • boundary="tangent" holds a boundary only approximately: it keeps the area, but a tangent step can leave a curved boundary slightly (figure above); "slide" or an attached curve holds the shape.

  • boundary="free" shrinks a convex boundary: repeated averaging is diffusion.

  • No repair of folds by design: nothing in a pass aims at validity, and a fold can stay, as on a concave outline (Winslow smoothing).

  • It relaxes designed grading (Boundary layers and grading).

The update on a regular interior vertex

With four quads around \(v\), the pass is the weighted average

\[x_v \leftarrow \alpha\,x_v + \tfrac{\beta}{2}\sum_{4\ \text{edge nbrs}} x_u + \tfrac{\gamma}{4}\sum_{4\ \text{diagonal nbrs}} x_u, \qquad \alpha+2\beta+\gamma=1,\]

a Laplacian update with self-weight \(\alpha\): repeated passes are repeated diffusion.

References

  • K. Mittal, P. Fischer, “Mesh smoothing for the spectral element method”, J. Sci. Comput. 78(2), 1152-1173 (2019), doi:10.1007/s10915-018-0812-9. Used for: The approach this smoother follows for spectral-element meshes. Cited as a record; its method is not summarised here.

  • K. Mittal, “Spectral element mesh generation and improvement methods”, M.S. thesis, University of Illinois at Urbana-Champaign (2016), hdl:2142/95509. Used for: With the paper above, the mesh-improvement approach this smoother follows for spectral-element meshes.

  • D. A. Field, “Laplacian smoothing and Delaunay triangulations”, Communications in Applied Numerical Methods 4(6), 709-712 (1988), doi:10.1002/cnm.1630040603. Used for: Laplacian smoothing relocates vertices to improve an existing mesh; Field studies it on Delaunay triangulations.

  • P. M. Knupp, “A method for hexahedral mesh shape optimization”, Int. J. Numer. Meth. Engng 58(2), 319-332 (2003), doi:10.1002/nme.768. Used for: Abstract: Laplacian smoothing “fails to guarantee improvement of mesh quality” and can create inverted elements; the paper proposes a shape-improvement method that guarantees untangled elements, with element quality based on the condition number of Jacobian matrices (hexahedra).