← Blog
Technology 2026-05-10

Filling the N-Sided Hole: Why Two Kernels Disagree, and How We Make Them Shake Hands

Closing a 5-sided patch is a 30-year B-rep research problem. SDF smooth-blend solves it in one operator. But how do you know the two answers agree? Here is the contract.

#N-sided fill#Coons patch#smooth union#NURBS#SDF#G1 continuity#Hausdorff distance#surface modelling

Filling a hole between three or five curves is hard in B-rep, trivial in SDF — but how do you know they agree?


The hole nobody wants to look at

Every surfacing engineer has met this part. Five trim curves on a turbine blade, looping back on themselves, leaving an opening that has to be closed. Or three boundary curves on the corner of a car fender, two of them tangent, one curving away. Or six curves on a heat-exchanger header, none of them planar, all of them living on different parent surfaces.

You select the curves. You click Fill Surface. And you watch the progress bar.

Most of the time, in any commercial CAD package, one of three things happens:

  1. The patch comes back, and a colleague spends an hour eyeballing the G1 highlights to decide whether the seam is “good enough.”
  2. The patch fails outright, and you start playing the dance — re-trim, change a control point, swap a curve for a copy of itself, retry.
  3. The patch comes back wrong, you don’t notice, you ship the part, and three months later a NVH engineer is staring at a stripe in a flow visualisation and asking why.

Why is N-sided fill — closing an opening with anything other than four sides — still a research topic in 2025? Because the underlying B-rep math has a hard wall: there is no canonical way to interpolate four corners with three curves. There is no canonical way with five. With four it’s Coons. Everything else is a heuristic.


The B-rep history, in one paragraph

The clean case is N=4. Four curves, four corners, two parameter directions u and v — Coons solved it in 1967 with the bilinear blend that bears his name, and Piegl & Tiller’s NURBS Book (1995/1997) systematised it for industrial NURBS. The whole surfacing industry runs on Coons patches when N=4.

For N≠4, the field has been writing papers since the late 1980s and there is still no agreed answer. Gregory’s patch (1974). Sabin’s S-patch (1983). The “geometric Coons” generalisations of the 90s. The voxel-fitted iterative schemes of the 2000s. Each one trades a different defect against another: parameterisation singularity at the centre, control-point drift, G1 failure on opposite sides, computational cost when N>5. Open any modern CAD vendor’s documentation and you find the same sentence in different fonts: “for best results, prefer 4-sided regions.”


What an SDF does instead

NeuroCAD’s first kernel, Kernel A, doesn’t have edges. It has a function — the signed distance field. For any point in 3-space, it answers: how far am I from the surface, and on which side?

Filling an N-sided hole with an SDF is not a topology problem. It’s not a parameterisation problem. It is a smooth-min problem. You take the signed distance to the surrounding surfaces, you compose them with a polynomial smooth-union, and you let the field figure out the patch shape itself. The closed form for SmoothUnion lives in the SDF kernel as a single enum variant with a blend_radius parameter. That’s it. Three sides, five sides, six sides, twelve sides — same operator, same blend radius, same code path.

The nice property: the result is always G1, because polynomial smooth-min with continuous derivatives is G1 by construction. The unpleasant property: the result is not the same surface a B-rep solver would produce. It’s a smooth approximation that lives near the curves, not on them.

So when a NeuroCAD user closes a 5-sided hole and exports STEP back to a downstream B-rep tool, what does that tool see? And does it agree?

This is the publishable hole. Two kernels. Two answers. Nobody has measured the gap.


The dual-kernel architecture

NeuroCAD ships with two kernels living in the same workspace:

  • Kernel A — SDF. Implicit. Smooth-blend. GPU-friendly. The thing that lets us do variable-topology editing, lattice infill, and the smooth booleans that make the rest of the platform tick.
  • Kernel B — NURBS. Explicit. Coons-and-Gregory descended. The thing that lets us round-trip STEP to SolidWorks, to Onshape, to NX, to whatever your supplier runs.

For most operations the two kernels never meet. SDF does the heavy lifting; NURBS shows up only at import/export boundaries.

But fill surfaces are a place where both kernels have an opinion. The SDF kernel computes a smooth-blend patch. The NURBS kernel runs a Coons construction (when N=4) or a radial-blend centroid interpolant (when N≠4). Both produce a surface that closes the hole. They are not the same surface.

The natural question — and the one this paper takes seriously — is: how close are they?


The agreement contract

We cannot demand bit-equality. The two kernels are mathematically different objects. What we can demand is a publishable, falsifiable agreement contract. Three numbers, measured over a frozen test corpus.

1. Hausdorff distance (geometric closeness). Sample a dense grid of points on the SDF zero-isosurface inside the hole, and a dense grid on the NURBS fill, and compute the symmetric Hausdorff distance between the two point sets. The contract: less than ε_haus, where ε_haus is fixed per part diagonal length.

2. G1 continuity at the boundary (tangent agreement). At sample points along each boundary curve, evaluate the surface normal of both the SDF patch and the NURBS patch. Compute the angle between the two normals. The contract: less than ε_g1, expressed in degrees.

3. Curvature stripe. Render Gaussian curvature on both patches at the same shading resolution. The contract: the curvature highlight pattern matches, in the qualitative sense that an experienced surfacing engineer cannot distinguish them at viewing distance, and in the quantitative sense that a SSIM ≥ 0.9 holds against a reference render. (This third leg is the one that catches the failure modes humans will accept in practice but that numerical Hausdorff bounds happily ignore.)

If all three pass for a given (N, curve set, blend radius) tuple, we say the two kernels agree on that case. If any one fails, we report the case as a published gap.


Why this matters beyond NeuroCAD

The N-sided fill problem is the place where B-rep CAD has been quietly punting for thirty years. SDF tooling — built for the GPU, originally driven by ML, now stable enough for engineering use — produces a clean answer in a single call. That is not free; it produces a different clean answer than the NURBS literature. Until someone publishes the gap, the surfacing community has no honest way to compare them.

There is also a procurement angle. Every CAD vendor’s pitch deck has a slide that says “we handle N-sided fill.” Some of them genuinely do, with patented Gregory variants. Some of them don’t, and the slide is silent on what fails. A public, kernel-agnostic agreement contract — measure your N-sided fill against an SDF reference, publish the Hausdorff and the G1 — would do the surfacing world a favour.

We are publishing the contract. We are not publishing magic. The SDF smooth-blend is older than NeuroCAD. The Coons patch is older than half the people reading this. What is new is the harness that lets you put both in front of the same five curves and ask the kernels to shake hands.


What you can do with this

If you ship a CAD product:

  • Run the SDF reference patch yourself. The math is closed-form. Nine lines of GLSL.
  • Measure your own fill surface against it on the published test corpus.
  • Publish the gap. The surfacing community has been waiting for this.

If you buy a CAD product:

  • Ask your vendor what the Hausdorff is between their N=5 fill and an SDF reference patch on the same boundary curves.
  • Watch their face.

If you research surface modelling:

  • The agreement contract is open. The test corpus is open. The reference SDF kernel is open.
  • We propose Computer-Aided Geometric Design (CAGD) and arXiv cs.GR as the venues for the formal preprint.

Status

The Coons patch path in NeuroCAD’s NURBS kernel ships today: the N=4 Coons construction and an N≠4 radial-blend interpolant are both in production. The SmoothUnion operator in NeuroCAD’s SDF kernel ships today: the closed-form polynomial smooth-min with a tunable blend_radius is part of the DSL AST. These are not proposed.

What is publishing is the comparison harness: the test corpus, the three-leg agreement contract (Hausdorff + G1 boundary tangent + curvature SSIM), and the gap measurement against frozen baselines. That harness is in active authoring as part of the REV11.5 dual-kernel test suite. The frozen test corpus (N=3, 5, 6, 12) and the published gap measurement are proposed, not delivered.

Honest summary: smooth-blend exists, Coons exists, the comparison harness is what gets published.

Ready to design differently?

Request early access to NeuroCAD.

Request Access