Resources

Numerical accuracy

The calculations in our apps: the policy each one is under, the precision it runs at, and the code itself.

  • 941 calculation policies
  • 6,917 calculations in 1,248 source files
  • 143 exact
  • 6,286 in 64-bit
  • 335 with a 32-bit step
  • 437 open items
  • Last reviewed

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.

  • 2D drawing on screen

    Draws the drawing, the grid and the cursor aids on the two canvases of the 2D view.

    • CadCraft
    Display only
    4 calculations
    32-bit, display only
  • 3D site view scene

    Builds the triangles and lines the 3D view draws: the ground with its elevation bands, roads, hardscape, plants, tracks, pipes and structures.

    • CivilCraft
    Display only
    4 calculations in 3 files
    32-bit, display only
  • 3D tab drawing of the 2D lines and kept solids

    Sends the 2D drawing's lines and the solids kept from DWG files to the graphics card for the 3D tab.

    • CadCraft
    Display only
    2 calculations
    32-bit, display only
  • 3D view

    Draws the model in 3D and finds the part under the pointer.

    • DetailCraft
    Display only
    3 calculations
    32-bit, display only
  • 3D view drawing

    Draws the model in the 3D view: section planes and boxes, the turned section frame, picking and walking.

    • BimCraft
    Display only
    3 calculations
    32-bit, display only
  • 3D view drawing

    Builds the meshes, edges, lights and overlay lines that draw the 3D model on screen.

    • CadCraft
    • ModelCraft
    Display only
    3 calculations
    32-bit, display only
  • 3D view of the part

    Draws the part, its edges, highlights and result colors in the 3D view, and finds what is under the pointer.

    • PartCraft
    Display only
    3 calculations
    32-bit, display only
  • Analysis results drawn on the model

    The deflected shape, force diagrams and colored plate contours shown on the 3D view.

    • CadCraft
    • BimCraft
    • DetailCraft
    Display only
    3 calculations in 2 files
    32-bit, display only
  • Building mass mesh for the 3D view

    Builds the walls and roof of a building mass as a triangle mesh for drawing.

    • CivilCraft
    Display only
    1 calculation
    32-bit, display only
  • Cabinets as 3D viewport bodies

    Turns the cabinet job into boxes and meshes for the 3D viewport: every panel, the floor and the walls with their openings (CabinetCraft add-on).

    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    Display only
    2 calculations
    32-bit, display only
  • Drawing NURBS curves and surfaces

    Turns tessellated curves and surfaces into the buffers the 3D view draws, with zebra stripes and curvature colors.

    • ModelCraft
    • PartCraft
    Display only
    2 calculations
    32-bit, display only
  • Drawing the 3D check view and CAD sheets on screen

    Draws the 3D check view with three.js and a DWG or DXF sheet on the canvas.

    • TakeoffCraft
    Display only
    2 calculations in 2 files
    32-bit, display only
  • DWG and DXF views on screen

    Draws a compiled drawing in the 2D view and in the 3D view.

    • BimCraft
    Display only
    3 calculations in 2 files
    32-bit, display only
  • Element outlines in the IFC view

    Finds the edge lines drawn on each element in the IFC view.

    • BimCraft
    Display only
    2 calculations
    32-bit, display only
  • Erection movie player

    Draws the erection sequence as a moving 3D picture in the exported movie page.

    • DetailCraft
    Display only
    2 calculations
    32-bit, display only
  • Fast render lights and texture placement

    Sets lamp strength, soft sun shadows and where a material's texture falls on a surface for the fast render and the 3D views.

    • BimCraft
    • ModelCraft
    Display only
    3 calculations in 2 files
    32-bit, display only
  • Freeform bodies: display mesh

    Makes the triangles the Form workspace draws for the smooth surface.

    • PartCraft
    Display only
    1 calculation
    32-bit, display only
  • Illustrate: projection, hidden lines and vector pictures

    Projects a manual view onto the picture, removes hidden lines and writes the result as line art and PDF pages.

    • PartCraft
    Display only
    4 calculations in 4 files
    32-bit, display only
  • Library 3D preview

    The 3D view of an item on its Library page and on the configure page.

    Every app Display only
    3 calculations in 2 files
    32-bit, display only
  • Magnetics add-on: the result drawn as display bodies

    Draws a magnet study's field bands, flux lines, bodies and force arrows in the part's view.

    • PartCraft
    Display only
    3 calculations
    32-bit, display only
  • Manual scene in the 3D view

    Draws the parts of an illustrated manual, their edges and the filled cut faces in the 3D view.

    • PartCraft
    Display only
    2 calculations
    32-bit, display only
  • Map layers under the drawing

    Draws map pictures and tiles under the drawing, warped from the map's coordinate system to the drawing's.

    • CadCraft
    • BimCraft
    Display only
    2 calculations
    32-bit, display only
  • Map pictures warped onto the plan

    Picks the tile level for the screen and cuts a map picture into pieces that are each drawn with one affine transform.

    • CadCraft
    • BimCraft
    • CivilCraft
    Display only
    3 calculations
    32-bit, display only
  • Material flow drawing and playback

    Draws the layout in the 3D view and moves the loads and vehicles of a finished or running simulation.

    • ModelCraft
    Display only
    4 calculations in 2 files
    32-bit, display only
  • Material graphs baked to textures

    Turns a node material, a decal or a texture bake (ambient occlusion, curvature, normals, lighting) into the pictures the renderers read.

    • BimCraft
    • ModelCraft
    Display only
    4 calculations in 4 files
    32-bit, display only
  • Path tracer kernels

    Follows light paths through the packed scene to work out each pixel of a high-quality render.

    • BimCraft
    • ModelCraft
    Display only
    4 calculations in 4 files
    32-bit, display only
  • Path tracer scene, light and sky buffers

    Packs the model's triangles, materials, lamps, light profiles and sky into the 32-bit buffers the path-tracing kernels read to draw a picture.

    • BimCraft
    • ModelCraft
    Display only
    4 calculations in 3 files
    32-bit, display only
  • Pit and solar table meshes in the 3D view

    The 3D view geometry for open pits (haul ramp ribbons, bench rims) and ground solar tables.

    • CivilCraft
    Display only
    4 calculations in 3 files
    32-bit, display only
  • Plan view of elements drawn from their mesh

    Cuts imported and library elements at the plan's cut height and joins the cut lines into outlines to draw.

    • BimCraft
    Display only
    3 calculations
    32-bit, display only
  • Plant 3D models for the 3D view

    Reads a plant's own 3D model from a GLB file and scales it to a unit box so the 3D view can draw it at the plant's size.

    • CivilCraft
    Display only
    4 calculations in 2 files
    32-bit, display only
  • Polygon mesh: shading normals

    The normal at each face corner that makes a mesh shade smooth or faceted on screen.

    • CadCraft
    • ModelCraft
    Display only
    1 calculation
    32-bit, display only
  • Ray casting for rendering and the render bench

    Finds what a camera ray hits in the scene and shades a preview picture; used to draw and to time the renderers.

    • BimCraft
    • ModelCraft
    Display only
    4 calculations in 3 files
    32-bit, display only
  • Real-time view

    Draws the live 3D view, its walk mode, its 360° panoramas and the standalone viewer file, with bounce light from baked probes.

    • BimCraft
    • ModelCraft
    Display only
    4 calculations in 4 files
    32-bit, display only
  • Real-time view and render bench

    Draws the real-time 3D view, bakes its bounce light, times the path tracers and writes the standalone viewer's scene.

    • BimCraft
    • ModelCraft
    Display only
    4 calculations in 4 files
    32-bit, display only
  • Rendered picture: sample sums and color tables

    Adds up the light samples of a CPU render into the picture and applies .cube color tables to it.

    • BimCraft
    • ModelCraft
    Display only
    5 calculations in 2 files
    32-bit, display only
  • Rendered pictures

    Draws still pictures and video frames of the model: the fast render, the path-traced render and the textures of the material library.

    • BimCraft
    • ModelCraft
    Display only
    4 calculations in 4 files
    32-bit, display only
  • Rendering: sun direction, lamps and painted faces

    Prepares the 3D model for a rendered picture: the sun's direction, the light fixtures as lamps, and which library material each painted face shows.

    • BimCraft
    Display only
    3 calculations in 2 files
    32-bit, display only
  • Scene handed to the renderer

    Turns what the view shows into the renderer's geometry: positions, normals and texture coordinates per color, with material displacement on meshes.

    • ModelCraft
    Display only
    3 calculations
    32-bit, display only
  • Section caps: which elements are closed solids

    Decides which elements have a closed surface, so the section view paints a cut face only where there is an inside to fill.

    • BimCraft
    Display only
    2 calculations
    32-bit, display only
  • Section view plane

    The cutting plane of the live section view: its normal and position, and the range of its slider.

    • PartCraft
    Display only
    2 calculations
    32-bit, display only
  • Section volumes in the 3D view

    Works out the planes, corners and edges of the free-form section volumes that cut the 3D view.

    • BimCraft
    Display only
    3 calculations
    32-bit, display only
  • Sheet compare picture

    Mixes the renderings of an old and a new sheet into one picture that colors what was removed and what was added.

    • MarkupCraft
    Display only
    1 calculation
    32-bit, display only
  • Simulation and flow result plots

    Draws the colored cut plane, the surface colors and the streamlines of a result, and makes the finer mesh the colors are drawn on.

    • PartCraft
    Display only
    4 calculations in 3 files
    32-bit, display only
  • Sketch editor drawing

    Draws the sketch, its dimensions and their labels on the canvas over the 3-D view.

    • PartCraft
    Display only
    2 calculations
    32-bit, display only
  • Skinning on the graphics card

    Vertex skinning by bones on the GPU for the real-time view and the path tracer.

    • ModelCraft
    Display only
    2 calculations
    32-bit, display only
  • Smooth shading and texture placement

    The normals that make faces joined by soft edges shade as one surface, and where an imported texture lies on a face.

    • CadCraft
    • ModelCraft
    Display only
    3 calculations
    32-bit, display only
  • Surface display meshes, curvature map and zebra stripes

    Makes the triangles that draw a surface body and colors a mesh by curvature or by zebra stripes.

    • PartCraft
    Display only
    3 calculations
    32-bit, display only
  • Texture bake inputs

    Gathers the triangles, normals and ray distance that the texture bake (ambient occlusion, curvature, normals, lighting) reads to make pictures.

    • ModelCraft
    Display only
    2 calculations
    32-bit, display only
  • Truss layout 3D picture

    Draws the truss layout as a wireframe picture seen from an angle.

    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    Display only
    3 calculations
    32-bit, display only

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

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.

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.

A point C almost on the line from A to B. Magnified, C is a tiny distance to one side of the line. A B C C left or right?
C lies a rounding error away from the line through A and B. Which side it is on decides how the geometry is built.

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.