Surface grids on a CAD face
A surface grid fills one block face from its four boundary rows, with every node on a parametric CAD surface. It is the face-filling step of a CAD-driven workflow, as in ICEM CFD or Pointwise: the edges are fixed first (on CAD curves, or by a topology), and the face is meshed on the surface between them. SHORE does it with transfinite interpolation (TFI) in the surface's parameter plane, followed by elliptic (Winslow) smoothing in the same plane, and evaluates the surface once at the end.
The kernel is shore.surface.tfi.surface_grid; the journaled command is Project.surface_grid (FillFace), which rebuilds one face of a mesh block in place.
Why the parameter plane
The obvious alternative, TFI of the physical boundary points followed by a projection onto the surface, interpolates along chords that cut through a curved surface. On a cylinder patch with a distorted parametrisation, physical TFI is off by 0.046 where TFI in
Smoothing on the surface with a re-projection every sweep is the other alternative. At the measured tier-1 projection rate of
The method
Boundary parameters. The four boundary rows are projected once onto the SURFACE entity (tier-2, exact projection), which gives their
. Boundary nodes farther than of the model diagonal from the surface are refused. TFI of those parameters: a Coons patch in
. Winslow smoothing in
(with smoothing="elliptic", the default). Withand the surface, the physical tangents are (likewise ), and the solved system is The term
carries the parametrisation's second derivatives (the Christoffel terms): with
the first fundamental form and . These are the physical Winslow equations projected on the tangent plane, so the result does not depend on how the CAD face happens to be parametrised. One evaluation of
at the final . The boundary rows of the result are the input rows, bit for bit.
Control functions: keeping the clustering
Plain Winslow equalises the grid and washes out wall clustering: on a clustered rectangle (first cell
blended linearly across the face and clipped to
Solver and work
The metric (
Parameters
EllipticParams holds the smoother's defaults; they are not per-case tuning knobs.
| Field | Default | Meaning |
|---|---|---|
lattice_refine | 2 | metric lattice spacing = grid parameter spacing / refine |
max_iterations | 400 | Picard steps |
tolerance | 1e-12 | largest parameter update, relative to the |
control_limit | 1.5 | bound on |
The user-facing choice is smoothing: "elliptic" (default) or "none" (plain TFI in
Measured behaviour
From the frozen acceptance spec (tests/spec/test_surface_tfi.py), on exact analytic surfaces:
| Case | Result |
|---|---|
| uniform physical boundaries, distorted plane / cylinder | 0.0007 h / 0.0011 h from the uniform grid (TFI: 0.65 h, 1.03 h) |
| tanh-clustered rectangle | first cell 1.00000 of the boundary's |
| S-shaped overhang, 81 × 61 | TFI folds 29 cells; elliptic 0 folded, minimum corner angle 5.4° |
| sphere patch | 0 folded; minimum corner angle 68° (lat-lon TFI: 88°) |
On a STEP cylinder, the rebuilt inner face of a clustered annulus sector lies
Winslow equalises; it does not preserve angles. On the sphere patch it lowers the minimum corner angle from TFI's 88° to 68°. Only validity is required there.
The command
Project.surface_grid(block, face, *, surface, smoothing="elliptic", geometry="body") checks the block, the face name and the SURFACE index, runs the kernel on the face's node view, and only then snapshots the mesh, so a refused call leaves no undo entry and the nodes untouched. The result is written through the view, so a SHARED face aliased by another block stays consistent. The rest of the block does not move.
import build123d as bd
import numpy as np
from shore.geometry import BODY
from shore.project import Project
bd.export_step(bd.Cylinder(radius=0.5, height=4.0), "cylinder.step")
p = Project()
p.load_geometry("cylinder.step")
p.build_primitive(
"annulus", r_in=0.5, r_out=1.5, z0=-1.5, z1=1.5, ni=9, nj=25, nk=21,
theta_start=0.5, theta_end=2.0, j_law="tanh2", j_beta=2.0,
)
probe = np.array([0.5 * np.cos(1.25), 0.5 * np.sin(1.25), 0.0])
face = int(p.body.geometry.project(probe, BODY).entity_index) # the cylinder's SURFACE
p.surface_grid(p.mesh.blocks[0].label, "i_lo", surface=face) # TFI + Winslow in (u, v)
print(p.journal().splitlines()[-1]) # p.surface_grid('annulus', 'i_lo', surface=0)This needs the CAD extra (shore[cad]).
Limits
- CAD only. An STL has no
parametrisation; the command refuses it. - Periodic seams. A face whose boundary crosses the surface's periodic seam (a full cylinder or sphere band) is refused: around the boundary, a parameter step per unit length more than 50× the median marks the jump of a whole period. Split the face at the seam.
- Singular points. A face with a collapsed boundary edge (coincident consecutive nodes, as at a pole or a cone apex) is refused.
- One CAD face per block face. Block faces spanning several CAD faces are out of scope.
- No orthogonality control at the boundary (Sorenson / Hilgenstock).
- Clustered boundaries on strongly concave boundaries. The Thomas–Middlecoff functions copy irregular boundary spacing and can fold the grid there. Boundaries spaced evenly in arc length do not trigger it.
See also
- ADR 0007 — Surface grids: the decision, the acceptance numbers and the review decisions.
- ADR 0002 — Geometry backend: the two projection tiers.
shore.surface.tfi—surface_grid,EllipticParams.Project.surface_gridand the commandFillFace.- Fill a block face on a CAD surface (recipe).
- Geometry and Association.