- When a Boundary No Longer Defines a Unique Volume
- A Curious Engineering Problem
- Boundary, Surface, Volume
- The Simplest Non-Planar Face
- Why Earthwork Cells Expose the Problem
- From a Closed Surface to a Volume
- Area Vectors from Polygon Vertices
- Lemma: The Area Vector Is Invariant Under Cyclic Rotation
- Lemma: Pivot Choice Does Not Matter for a Planar Face
- What Fails for a Non-Planar Face
- The Maximum Volume Ambiguity Theorem
- Geometric Interpretation
- Corollaries
- Why Only the Platform Face Usually Matters
- Worked Example: A Warped Unit Cube
- Data Flow at a Glance
- Why Not Simply Triangulate Everything?
- Engineering Tolerance and Mathematical Purity
- Practical Example: Imported 3D Polylines
- Practical Example: Road Corridors
- Practical Example: LandXML and Interoperability
- A Note on Exactness
- Why This Is Not Floating-Point Error
- The Broader Lesson
- Conclusion
- Appendix A: Summary of Key Equations
When a Boundary No Longer Defines a Unique Volume #
Understanding Non-Planar Surfaces in Earthwork Modelling #
A cut-and-fill number looks simple. Design a platform, survey the terrain, and the software reports how much material moves, what could have gone wrong? The figure may be large, but the idea behind it feels obvious: one design surface, one existing surface, one volume.
But then, the assumption is that single platform, which consists of Point3D defining the outer layer of the boundary, must be a valid plane throughout. But this is not always guaranteed. A closed boundary in three-dimensional space does not automatically define a unique surface. If the boundary vertices aren’t coplanar, the interior of that boundary can be interpolated in more than one valid way — and different interpolations enclose different volumes, even when every boundary point is identical.
The geometry of a platform in 3D could be ambiguous. So it becomes a practical problem that engineers should look into and fix, or at least and be aware of, lest it ruins their cut and fill computation.
This article works out the mathematics behind that ambiguity and derives an exact closed-form bound for one common source of it in earthwork modelling: the volume ambiguity caused by non-planar polygonal faces. We will quantify the error bar with respect to the case when the plan of a platform is not strictly planar. We will answer the question, let’s say if a point deviate from the perfect planarity of the platform, how much uncertainty it will introduce into the cut and fill calculation?
Conclusion first. For a polygonal face with vertices P_i and oriented area vector N , the maximum volume spread caused by changing the fan-triangulation pivot is
\displaystyle \Delta V_{\max} = \frac{\max_i(P_i\cdot N)-\min_i(P_i\cdot N)}{6}.
That’s not an approximation. It’s an exact algebraic consequence of the standard polyhedral volume formula, and cheap besides — one pass over the face vertices, nothing more.
A Curious Engineering Problem #
Picture two engineers exchanging the same LandXML model.
Both import the same data into different CAD or earthwork applications. Both compute cut and fill. Both applications use valid numerical methods. And yet the reported volumes differ.
The usual suspects get rounded up:
- rounding;
- floating-point precision;
- mesh resolution;
- interpolation method;
- software bugs;
- different treatment of boundaries.
All of these can matter, fair enough. But there’s a deeper possibility hiding behind the obvious ones.
The two programs may simply be computing different, equally valid interpretations of the same boundary geometry. That sounds strange only because we’re used to treating a closed 3D boundary as though it automatically defines a surface. In two dimensions, it does — a closed polyline encloses an area, full stop. In three dimensions, a closed loop of points is only a boundary. It doesn’t necessarily specify the surface spanning it.
The distinction is easy to miss because the common cases behave themselves. Three points always define a plane. Four points often look like they define a quadrilateral face. A rectangular-looking platform looks flat in plan. A closed 3D polyline looks like a surface boundary. But the four points in 3D need not be coplanar.
And once they aren’t, the phrase “the quadrilateral face” stops meaning anything specific. Which face? Which interpolation? Which diagonal? Which surface patch?
Until that choice gets made, there is no single volume to compute.
Boundary, Surface, Volume #
It helps to pull apart three concepts that get blurred together in casual use:
Boundary
↓
Surface
↓
Volume
A boundary is a set of curves or edges. It’s lines, 1D objects. A surface is an interpolation spanning those boundaries. It’s area, 2D objects A volume,on the other hand, is the three-dimensional region enclosed by surfaces, it’s a 3D object.
The arrow from boundary to surface is not always unique. So the arrow from surface to volume isn’t either.
This matters in civil engineering workflows precisely because so much imported or generated geometry is boundary-based. Think:
- closed 3D polylines imported from CAD;
- Civil 3D feature lines;
- LandXML grading boundaries;
- platform outlines with vertex elevations;
- surveyed breaklines;
- corridor edges;
- manually edited design pads.
These objects can carry vertices with independently set elevations. Unless those elevations happen to line up on a common plane, the object may well be non-planar.
A 3D polyline is a good example to sit with for a moment. It is a curve in space. It tells you where its vertices are and how they connect. It does not, on its own, tell you what surface fills its interior. So if a program later treats a closed 3D polyline as a platform, it has to choose how to fill that interior. When the vertices are coplanar, the choice is obvious — there’s only one plane to fall back on. When they aren’t, it isn’t, and we say that the plane is not uniquely defined.
The Simplest Non-Planar Face #
Take four boundary points:
A-------------B
| |
| |
D-------------C
In plan this looks like a rectangle, or close enough to one. But suppose the elevations are:
\displaystyle A_z=100.000, \quad B_z=100.000, \quad C_z=100.120, \quad D_z=100.030.
Nothing guarantees these four points share a plane. And in general, they won’t.
If they’re non-coplanar, there is no single planar quadrilateral running through all four vertices. A surface has to be chosen, and the two simplest choices split the quadrilateral along opposite diagonals.
Diagonal AC Diagonal BD
A-------------B A-------------B
|\ | | /|
| \ | | / |
| \ | | / |
D---\---------C D-------/-----C
Both triangulations use exactly the same four boundary vertices and exactly the same four boundary edges. Both are piecewise planar. Both are perfectly reasonable choices. But they are, in general, not the same surface. If this face closes off part of a solid, the two choices can enclose different volumes. That’s the whole ambiguity in miniature.
Why Earthwork Cells Expose the Problem #
A typical digital terrain model represents existing ground as a triangulated surface. A platform, pad, or design surface then gets compared against that terrain. For the purpose of discussion we assume that the platform is higher than the terrain, but the principle applies equally well when it’s the other way round, that the terrain is higher than platform. A common approach breaks the comparison into many small solids, one per overlap between a terrain triangle and the design footprint.
Each small solid is a prism-like cell:
- the bottom face comes from the terrain triangle;
- the top face comes from the design surface;
- the side faces connect corresponding boundary edges.
Sum the signed volumes of all the cells, and you have total cut and fill.
That works cleanly, as long as every face of every cell stays planar.
The bottom face, which is the terrain doesn’t have a problem. This is because the terrain is usually represented by a mesh, with triangle face, which by definition, can only be a plane.
The vertical side walls are also safe under the usual construction: corresponding bottom and top vertices share the same horizontal coordinates, and the connecting edges are vertical and parallel. Two parallel lines are always coplanar, so the wall stays flat.
The top face is the one to watch. Since it is a platform, it may not be triangle; it could be quadrilateral or something more complicated. If it’s a quadrilateral or higher, whose corner elevations were set independently, it can go non-planar without anyone noticing.
This is exactly why the issue stays hidden. Most faces in the computation take care of themselves. Only one face — the top — needs to go non-planar for the whole cell’s volume to become interpretation-dependent.
From a Closed Surface to a Volume #
Let’s derive the formula that exposes the ambiguity.
Let S be the closed surface of a solid region \Omega . The divergence theorem says that for a vector field \mathbf{F} ,
\displaystyle \int_\Omega \nabla\cdot\mathbf{F},dV = \oint_S \mathbf{F}\cdot\hat n,dA,
where \hat n is the outward unit normal of the surface.
Choose
\displaystyle \mathbf{F}(\mathbf{x})=\frac{1}{3}\mathbf{x}.
Since
\displaystyle \nabla\cdot\mathbf{x}=3,
we get
\displaystyle \nabla\cdot\left(\frac{1}{3}\mathbf{x}\right)=1.
Therefore,
\displaystyle V = \int_\Omega 1,dV = \frac{1}{3}\oint_S \mathbf{x}\cdot\hat n,dA.
That’s the starting point.
For a polyhedron, the surface splits into planar faces. On a planar face f , every point \mathbf{x} on the face satisfies
\displaystyle \mathbf{x}\cdot\hat n_f = c_f,
with c_f constant over that face. So for any point Q_f lying on the plane of the face,
\displaystyle \int_f \mathbf{x}\cdot\hat n_f,dA = Q_f\cdot\hat n_f A_f.
Let the oriented area vector of the face be
\displaystyle \mathbf{A}_f = A_f\hat n_f.
The volume becomes
\displaystyle V = \frac{1}{3}\sum_f Q_f\cdot \mathbf{A}_f.
Take note that there is freedom hiding in this equation: for a planar face, Q_f can be any point on the face plane. That freedom is harmless when the face is planar, but it’s the the ambiguity gets in when the face isn’t.
Area Vectors from Polygon Vertices #
For a polygonal face with ordered vertices
\displaystyle P_1,P_2,\dots,P_m,
the raw oriented area vector is commonly written as
\displaystyle N_f = \sum_{i=1}^{m} P_i\times P_{i+1},
with P_{m+1}=P_1 .
This raw vector is twice the usual oriented area vector:
\displaystyle N_f = 2\mathbf{A}_f.
Substitute \mathbf{A}_f=N_f/2 into the volume formula from the previous section and you get
\displaystyle V = \frac{1}{6}\sum_f Q_f\cdot N_f.
If the face is planar, any vertex of that face can serve as Q_f . So for a planar polyhedron, volume can be computed as
\displaystyle V = \frac{1}{6}\sum_f P_{p(f)}\cdot N_f,
where P_{p(f)} is any chosen pivot vertex on face f .
For planar geometry, the choice of pivot doesn’t matter at all, but for non-planar geometry, it does.
Lemma: The Area Vector Is Invariant Under Cyclic Rotation #
Before we get to pivot choice, one small fact needs to be nailed down.
Lemma 1 #
For a polygonal face with ordered vertices P_1,\dots,P_m , the raw area vector
\displaystyle N= \sum_{i=1}^{m} P_i\times P_{i+1}
stays the same regardless of which vertex you start counting from.
Proof #
The expression is a cyclic sum over the same directed edges. Starting at P_2 instead of P_1 only changes the order the terms are written in:
\displaystyle P_2\times P_3 + P_3\times P_4 + \cdots + P_m\times P_1 + P_1\times P_2.
Same sum. So the area vector is invariant under cyclic rotation of the vertex list.
∎
This lemma holds whether the polygon is planar or not.
Lemma: Pivot Choice Does Not Matter for a Planar Face #
Lemma 2 #
Let f be a planar polygonal face with raw area vector N_f . For any two vertices P_j and P_k of that face,
\displaystyle P_j\cdot N_f = P_k\cdot N_f.
Proof #
Because the face is planar, the vector
\displaystyle P_j-P_k
lies in the plane of the face.
The area vector N_f is normal to that plane. So,
\displaystyle (P_j-P_k)\cdot N_f=0.
Expand the dot product:
\displaystyle P_j\cdot N_f – P_k\cdot N_f=0.
Hence,
\displaystyle P_j\cdot N_f=P_k\cdot N_f.
∎
This is why planar faces behave so well. The volume contribution of a planar face doesn’t care which vertex you use as the representative point.
What Fails for a Non-Planar Face #
For a non-planar face, the proof above breaks at exactly one step.
The vector P_j-P_k is still a chord between two vertices, but there is no single plane containing every vertex of the face anymore. The area vector N_f , still computed straight off the polygon boundary, is still perfectly well-defined. It just no longer works as the normal of a plane the vertices actually sit on.
So it is no longer guaranteed that
\displaystyle (P_j-P_k)\cdot N_f=0.
Which means
\displaystyle P_j\cdot N_f
can differ from
\displaystyle P_k\cdot N_f.
That’s the mathematical signature of the ambiguity, right there. Change the pivot, and the face’s contribution to the volume changes with it.
The Maximum Volume Ambiguity Theorem #
Here’s the central result.
Theorem #
Let a polygonal face f have vertices P_1,\dots,P_m and raw oriented area vector
\displaystyle N_f=\sum_i P_i\times P_{i+1}.
Suppose the volume contribution of this face is evaluated using one of its vertices as the pivot:
\displaystyle V_f(P_j)=\frac{1}{6}P_j\cdot N_f.
Then the maximum possible spread in the face’s volume contribution, over every possible choice of pivot vertex, is
\displaystyle \Delta V_{\max}(f) = \frac{\max_i(P_i\cdot N_f)-\min_i(P_i\cdot N_f)}{6}.
Proof #
Choose two candidate pivot vertices P_j and P_k . Their face contributions are
\displaystyle V_f(P_j)=\frac{1}{6}P_j\cdot N_f,
and
\displaystyle V_f(P_k)=\frac{1}{6}P_k\cdot N_f.
The difference is
\displaystyle \Delta V_{jk} = V_f(P_j)-V_f(P_k) = \frac{1}{6}(P_j\cdot N_f-P_k\cdot N_f).
By linearity of the dot product,
\displaystyle \Delta V_{jk} = \frac{1}{6}(P_j-P_k)\cdot N_f.
The largest possible difference comes from picking the vertex with maximum projection P_i\cdot N_f and subtracting the one with minimum projection. So,
\displaystyle \Delta V_{\max}(f) = \frac{\max_i(P_i\cdot N_f)-\min_i(P_i\cdot N_f)}{6}.
∎
That’s the closed-form expression we promised at the start.Note that it only needs the vertices of the face and their oriented area vector. No search over triangulations. No iteration. No numerical tolerance anywhere in the derivation. It’s a fast result that is uniquely suited to be implemented in a computer.
Geometric Interpretation #
The expression
\displaystyle P_i\cdot N_f
is a projection of vertex P_i along the area-vector direction.
Write
\displaystyle N_f=|N_f|\hat n_f,
and
\displaystyle P_i\cdot N_f =|N_f|(P_i\cdot\hat n_f).
The term P_i\cdot\hat n_f is the signed coordinate of the vertex along the normal direction \hat n_f . So
\displaystyle \max_i(P_i\cdot N_f)-\min_i(P_i\cdot N_f)
measures how spread out the vertices are in the direction normal to the face’s area vector, scaled by the magnitude of that area vector.
Put plainly:
The ambiguity is proportional to the face area and to the depth of its warp.
A large, mildly warped face can matter. So can a small, severely warped one. The ambiguity drops to zero when the platform is completely planar.
Corollaries #
The theorem hands us several useful consequences almost for free.
Corollary 1: Planar Faces Have Zero Ambiguity #
If every vertex of a face lies in one plane, then by Lemma 2,
\displaystyle P_i\cdot N_f
is identical for every vertex P_i . So
\displaystyle \max_i(P_i\cdot N_f)-\min_i(P_i\cdot N_f)=0,
and hence
\displaystyle \Delta V_{\max}(f)=0.
Not an approximation. Exact.
Corollary 2: Triangular Faces Have Zero Ambiguity #
Any three points define a plane — no way around it. So every triangular face is planar, and by Corollary 1 its ambiguity is zero.
This is precisely why triangulated terrain faces are safe, at least in this particular sense.
Corollary 3: The Bound Is Translation Invariant #
Suppose every vertex shifts by a constant vector T :
\displaystyle P_i^{\prime} = P_i+T.
The area vector of a closed polygon doesn’t change under translation. The projections become
\displaystyle P_i^{\prime}\cdot N_f=(P_i+T)\cdot N_f=P_i\cdot N_f+T\cdot N_f.
Both the maximum and the minimum shift by the same constant T\cdot N_f , so their difference stays put:
\displaystyle \max_i(P_i^{\prime}\cdot N_f)-\min_i(P_i^{\prime}\cdot N_f) = \max_i(P_i\cdot N_f)-\min_i(P_i\cdot N_f).
The ambiguity doesn’t care where your coordinate origin sits.
Corollary 4: The Bound Scales Linearly with Warp Depth #
Scale the out-of-plane displacement of a face by a factor \lambda , and the spread of vertex projections along the normal direction scales by the same factor. So the ambiguity scales linearly too.
Double the warp depth, and — all else equal — the ambiguity doubles. No surprises.
Corollary 5: The Bound Is Additive #
Total volume is a sum of face contributions. So independent uncertainty bounds over faces simply add:
\displaystyle \Delta V_{\max}(\text{solid}) = \sum_f \Delta V_{\max}(f).
Same logic applies if an earthwork computation decomposes the site into many independent cells:
\displaystyle \Delta V_{\max}(\text{project}) = \sum_k \Delta V_{\max}(k).
This is where the theory pays for itself. A global ambiguity estimate doesn’t require recomputing the whole project under a pile of alternative triangulations. Just accumulate it locally, face by face, cell by cell.
Why Only the Platform Face Usually Matters #
Back to the earthwork cell.
The bottom is a triangle. Always planar due to that it’s terrain ( as per our convention), and terrain is mesh with triangle cells. The side walls, built the ordinary way from paired top and bottom vertices sharing horizontal coordinates, connect via parallel vertical edges — so each wall stays coplanar. The top face is a different animal. It comes off the design surface. If that design is represented by four or more independently elevated vertices, nothing forces them onto a common plane. This is why quantifying the error bar is important, and that’s why our simple results work– it only has one single nonplanar face to worry about.
The same conclusion also holds if the top is terrain and bottom is platform.
Worked Example: A Warped Unit Cube #
Take a unit cube. Bottom face at z=0 , top face nominally at z=1 .
Now lift one corner of the top face by an amount d . The top vertices become:
\displaystyle (0,0,1),\quad (0,1,1),\quad (1,1,1+d),\quad (1,0,1).
Only the top face warps. Everything else stays planar. For this top face, the raw area vector works out to
\displaystyle N=(d,d,-2).
The vertex projections onto N come to:
\displaystyle -2,\quad d-2,\quad -2, \quad d-2.
The spread, therefore:
\displaystyle (d-2)-(-2)=d.
So the maximum ambiguity is
\displaystyle \Delta V_{\max}=\frac{d}{6}.
Simple, and useful.
Lift the corner 0.3 m above the nominal plane, and
\displaystyle \Delta V_{\max}=\frac{0.3}{6}=0.05\text{ m}^3.
For a unit cube, that’s not nothing. Scale up to a large platform, and the same principle carries over, with the magnitude scaled by area.
| Lifted corner d | Nominal volume | Ambiguity \Delta V_{\max} | Error percentage |
|---|---|---|---|
| 0.0 | 1.000000 | 0.000000 | 0.00% |
| 0.1 | 1.033333 | 0.016667 | 1.61% |
| 0.3 | 1.100000 | 0.050000 | 4.55% |
| 0.5 | 1.166667 | 0.083333 | 7.14% |
| 1.0 | 1.333333 | 0.166667 | 12.50% |
Two things worth noticing here.
First, the absolute ambiguity grows linearly with d . Second, the percentage doesn’t grow linearly, because the nominal volume is also changing as the corner lifts.
Which is exactly why a bare percentage should be read carefully. It’s a ratio of two moving quantities: the ambiguity, and the reported volume.
The warped-cube example also explains why two programs can disagree without either one being broken. If one program splits the warped top face along one diagonal, and another splits it along the other, they’re computing two different piecewise-planar surfaces that happen to share the same boundary. Both surfaces are valid. The boundary simply doesn’t say which one has to be used, so the disagreement isn’t necessarily a bug. It may just be a artifact of missing geometric information.
Data Flow at a Glance #
Here’s the conceptual flow from a local face ambiguity to a project-level quantity.
The important part is additivity. Once you know the ambiguity per face, you can sum it per cell, then per project, and never have to touch the whole model at once. That’s what makes the bound computationally practical rather than merely elegant.
Why Not Simply Triangulate Everything? #
If non-planar faces cause ambiguity, why not just split every non-planar platform into triangles?
Mathematically, that works fine. Every triangle is planar, so every triangular face has zero ambiguity.
But geometry isn’t the only thing engineering software has to worry about. A platform is not merely a mathematical polygon. It’s also a design object — it carries a name, a purpose, an editing history, slope rules, boundary conditions, reporting identity, relationships to other elements in the model. Split one logical platform into dozens or hundreds of triangular fragments, and you pay real costs:
- more objects to store;
- more edges to manage;
- more topology to maintain;
- harder editing;
- duplicated attributes;
- messier reporting;
- a weaker link between the engineer’s design intent and the software model.
For severe non-planarity, decomposition may well be the right call. For tiny deviations, it’s overkill.
This is where engineering tolerance earns its keep.
The better question usually isn’t:
Is this face perfectly planar?
It’s:
Is the non-planarity large enough to matter for what I’m actually calculating?
If the ambiguity is negligible next to the accuracy the job requires, keeping the platform as one logical object is probably more useful than aggressively slicing it up. If the ambiguity is large, then fix the model, triangulate it explicitly, or state the interpolation rule out loud. The bound is what lets you make that call — it turns a vague geometric defect into a measurable engineering quantity.
Engineering Tolerance and Mathematical Purity #
Mathematics likes exactness. Engineering runs on judgement.
A platform whose vertices deviate from a common plane by 0.5 mm is, technically, non-planar. Whether that matters depends entirely on the scale and purpose of the model.
For a small machine part, 0.5 mm might be everything. For an earthwork platform spanning thousands of square metres, it’s probably noise. None of this means accuracy should be waved away. It means accuracy needs to be quantified in the units that actually matter for the decision at hand. An exact ambiguity bound helps precisely because it converts geometry into volume uncertainty — a number a designer can weigh, rather than a red flag they have to guess about.
That beats a binary pass/fail rule every time.
A binary rule says:
non-planar.
A quantitative rule says:
non-planar, with at most x cubic metres or y % volume ambiguity.
The second statement tells you something you can act on.
Practical Example: Imported 3D Polylines #
Suppose a closed 3D polyline gets imported from a CAD drawing and used as a platform boundary, with vertices
\displaystyle A=(0,0,100.000),
\displaystyle B=(20,0,100.000),
\displaystyle C=(20,20,100.120),
\displaystyle D=(0,20,100.030).
It looks rectangular in plan, so a user could reasonably expect it to behave like a platform — but a 3D polyline is not a surface, it’s a boundary and only a boundary, and if the software turns it into one it has to choose how to fill the interior somehow: two diagonal choices, a bilinear patch, a best-fit plane, a constrained triangulation, a least-squares surface, each a real modelling decision rather than a neutral default. The dangerous move isn’t picking one of these; it’s picking one silently and then reporting the result as if the original boundary had uniquely implied it. The volume ambiguity bound is what makes that hidden choice visible again.
Practical Example: Road Corridors #
Road corridors make the same point from a different angle. A road surface varies by chainage, crossfall, superelevation, widening, and vertical alignment, so if a long stretch is represented as one large polygonal platform, the vertices along that boundary will quite likely fail to be coplanar — not because the road is badly designed, but because a road is inherently a three-dimensional surface whose slope changes along its length, which is exactly the job it’s meant to do. Forcing the whole segment into one plane would be wrong, and splitting every small variation into separate triangular objects can get cumbersome fast, so the right representation depends on what the software actually needs to compute and how much ambiguity the user is willing to live with. The issue was never whether non-planarity exists here — it will, routinely — but whether it gets quantified and handled honestly rather than waved through.
Practical Example: LandXML and Interoperability #
LandXML and similar exchange formats earn their keep by moving design data between applications, but interoperability has a way of exposing differences in interpretation that stayed invisible inside a single tool. One application exports a boundary and vertex elevations; another imports that boundary and builds an interior surface from it; and if the exchange doesn’t fully specify the interpolation rule — which it often doesn’t — the two applications can land on different, equally defensible choices. This is one reason earthwork volumes can differ across software even from the same file, and the disagreement isn’t always carelessness so much as the data exchange simply not carrying enough information to force a unique answer. A mathematically honest workflow keeps these apart: geometry that uniquely defines a volume, geometry that defines a volume only after an interpolation rule is chosen, geometry whose ambiguity is too small to matter, and geometry whose ambiguity is large enough to demand correction.
A Note on Exactness #
The formula in this article is exact within its stated scope, and both halves of that phrase matter. It’s exact because it follows algebraically from the polyhedral volume formula, with no approximation anywhere in deriving
\displaystyle \Delta V_{\max} = \frac{\max_i(P_i\cdot N)-\min_i(P_i\cdot N)}{6}.
And it’s within its stated scope because it measures the ambiguity tied specifically to changing the pivot used in a fan-based contribution for a polygonal face — for quadrilaterals that corresponds directly to the two possible diagonal triangulations, while for general polygons further triangulation choices exist beyond what pivot rotation reaches. That’s the kind of precision good engineering mathematics needs: not just stating a result, but stating exactly what it covers and where it stops.
Why This Is Not Floating-Point Error #
Worth saying plainly: this ambiguity has nothing to do with floating-point arithmetic. A floating-point error shrinks under higher-precision arithmetic; this one doesn’t, because even with exact rational arithmetic, or symbolic computation, or a flawless implementation, a non-planar quadrilateral boundary still admits more than one valid piecewise-planar surface with genuinely different diagonal choices. The issue isn’t numerical precision — it’s missing geometric information, and no amount of computing power fixes a question the data never answered in the first place.
The Broader Lesson #
There are two fundamentally different kinds of geometric problems here: invalid geometry and ambiguous geometry. Invalid geometry should often just be rejected — a self-intersecting boundary, a missing face, an impossible topology may not describe a usable object at all. Ambiguous geometry is a different animal: it can be perfectly usable once an interpretation is chosen, but that interpretation shouldn’t get mistaken for something the boundary alone handed you. A non-planar quadrilateral isn’t necessarily invalid; it’s under-specified, and that distinction matters in practice, because rejecting every under-specified object forces users into unnecessary model fragmentation, while silently accepting every one of them lets users trust volume numbers more than they should. The better path is to quantify the ambiguity and let the engineer decide.
Conclusion #
A closed boundary in three-dimensional space does not always define a unique surface. A surface that isn’t uniquely defined does not always define a unique volume. That one observation explains why two valid earthwork computations can disagree in the face of non-planar boundary geometry — no bug required.
The mathematics shows the ambiguity isn’t mysterious at all. For the common case of a polygonal face evaluated through a fan-based volume contribution, the maximum volume spread is exactly
\displaystyle \Delta V_{\max} = \frac{\max_i(P_i\cdot N)-\min_i(P_i\cdot N)}{6}.
Compact, exact, translation invariant, linear in warp depth, zero for planar faces, additive over independent cells. That’s a lot of good behaviour from one short expression. It turns a hidden geometric uncertainty into something you can actually measure.
Most earthwork software reports a number. A more honest one reports the number — and the confidence the geometry actually earns it.
Appendix A: Summary of Key Equations #
Divergence theorem volume form:
\displaystyle V = \frac{1}{3}\oint_S \mathbf{x}\cdot\hat n,dA.
Face-sum form:
\displaystyle V = \frac{1}{3}\sum_f Q_f\cdot \mathbf{A}_f.
Raw area vector:
\displaystyle N_f = \sum_i P_i\times P_{i+1}.
Volume using raw area vector:
\displaystyle V = \frac{1}{6}\sum_f Q_f\cdot N_f.
Difference between two pivot choices:
\displaystyle \Delta V_{jk} = \frac{(P_j-P_k)\cdot N_f}{6}.
Maximum face ambiguity:
\displaystyle \Delta V_{\max}(f) = \frac{\max_i(P_i\cdot N_f)-\min_i(P_i\cdot N_f)}{6}.
Project-level ambiguity:
\displaystyle \Delta V_{\max}(\text{project}) = \sum_k \Delta V_{\max}(k).
