Resources
Numerical accuracy
The calculations in our apps: the policy each one is under, the precision it runs at, and the code itself.
Calculation policies
A policy says how one family of calculations keeps its precision. Open one to see its calculations, by source file, and their code.
-
Surface triangulation
Builds a triangulated surface from survey points and breaklines, then its elevations, contours and slopes.
- BimCraft
- CivilCraft
- 6 calculations
64-bit
A policy is added only after its source was read. Each statement can be checked in the code shown on its page; the app repositories are public. When a release changes a calculation, its page says so until it has been read again.
The standard
-
64-bit everywhere
Every calculation runs in 64-bit floating point (IEEE 754 double precision), from the number you type to the number you read.
-
15 digits, always
A 64-bit number keeps any 15-digit value intact and takes 17 digits to write out in full. Our rule for every calculation: carry all 17 between steps, and order the arithmetic so that avoidable rounding never costs one of the first 15.
-
32-bit gets a warning
A 32-bit number keeps about 7 digits. Where a 32-bit step can reach a number you read, the calculation is flagged in the lists below, and the app will warn that the result can have less mathematical precision.
This device
What this browser can see of your machine. It is shown here only and sent nowhere; the desktop app reads the full hardware, a web page cannot.
The apps calculate in 64-bit on every device. Work handed to the graphics processor is the exception: browsers expose graphics processors as 32-bit calculators, which can provide less mathematical precision.
- Processor
- Memory
- Numbers in the apps
- Graphics processor (WebGL)
- WebGPU
A browser reports a rounded or capped view of the machine, never a full inventory: it gives the number of processor threads (not the model), memory rounded down and capped at 8 GB (Chromium only), and one graphics adapter even when a machine has several. What the browser reports about graphics is a capability, not a measurement of the card. The size of a graphics card's memory bus (a 192-bit bus, for example) says how fast data moves, not how precisely it calculates. Most graphics cards can calculate in 64-bit natively, slowly, but WebGL and WebGPU do not offer it to web pages.
Approaches
Every policy takes one of five approaches to keeping its precision.
- Exact values 8 policies
- Constants and factors are held as exact fractions from their definitions. The arithmetic is ordered so that no rounded factor is ever used.
- Exact predicates 1 policy
- Coordinates are 64-bit. The yes-or-no decisions that shape the geometry (which side of a line, inside or outside a circle) are computed exactly, so rounding cannot flip one.
- 64-bit, direct 337 policies
- Every value is a 64-bit number from input to result. Formulas are closed form or a direct solve, and every comparison uses a stated tolerance.
- 64-bit, stated limit 428 policies
- The arithmetic is 64-bit, but the method or the data sets the accuracy: a solver tolerance, a mesh, a step size, a datum shift, a table. The limit is stated where the result is shown.
- Display only 49 policies
- Computed to draw the screen, often in 32-bit on the graphics processor. No number a person reads, saves or exports comes from it.
- 32-bit step, flagged 118 policies
- One step stores or exchanges 32-bit values that reach a number a person reads. It is listed here with its open item, and the step is either moved to 64-bit or the app will warn where the number is read.
Precision is not robustness
Mathematical precision is how many digits a number keeps. Geometric robustness is whether a shape stays valid: every intersection found, every solid closed, every face joined to its neighbors. They are different properties, and a CAD system can have the first without the second.
Every geometric algorithm rests on yes-or-no questions. Is this point left or right of that line? Do these two edges cross? Is this point inside that circle? Each answer is the sign of a small expression. When three points are almost in line, the true value of that expression can be smaller than the rounding error of the arithmetic that computes it, and the sign comes out wrong. That happens at 15 digits as readily as at 7.
One wrong sign is not a small error in the last digit. It is a different decision: an intersection that is missed, two triangles that overlap, a face that points the wrong way, a solid with a gap in it. Every coordinate can be correct to 15 digits while the shape they describe is invalid.
What makes geometry robust
-
Exact predicates
The yes-or-no questions are answered exactly. The fast 64-bit answer is used when it is safely away from zero. When it is not, the sign is computed again with as many digits as it takes.
-
Decide once
A decision about a shape is recorded as topology, and every later step agrees with it. The same question is never asked twice with a chance of two answers.
-
Stated tolerances
Where a tolerance is used it is written down, scaled to the size of the geometry and applied the same way everywhere.
-
Local origins
Coordinates far from zero are moved to a local origin before the work, so the digits are spent on the geometry and not on the distance to the origin.
-
Valid by construction
Algorithms whose result is guaranteed to be a closed solid, whatever the input, in place of ones that repair the result afterwards.
-
More than the language
These choices matter more than the programming language. JavaScript, C++ and Rust all compute with the same 64-bit numbers: the same algorithm is as robust, or as fragile, in each.
Where our apps stand
The list on this page records both properties. Surface triangulation in CivilCraft and BimCraft uses exact predicates. Solid modeling in PartCraft runs on a kernel whose result is a closed solid by construction. The intersections in the CadCraft app use stated tolerances today, and exact tests for the near-parallel and near-tangent cases are an open item. Each policy says which approach it takes.