Resources Numerical accuracy

Calculations

Every calculation under our calculation policies: what it works out, its formula and the precision it runs at. Open one to see its code as it is in the released app.

  • 6,917 calculations in 1,248 source files
  • 143 exact
  • 6,286 in 64-bit
  • 335 with a 32-bit step
  • Last reviewed

Calculations

  • Origin of the cached paths

    The point the cached drawing paths are stored relative to.

    origin = middle of the extents of the visible objects; path point = point − origin

    2D drawing on screen view.js
    • CadCraft
    32-bit, display only
  • Grid spacing

    The spacing of the background grid: 1, 2 or 5 times a power of ten, at least 14 pixels apart.

    target = 14 ÷ zoom; p = 10^⌊log₁₀ target⌋; step = first of p, 2p, 5p, 10p that is ≥ target; major = 5 × step

    2D drawing on screen view.js
    • CadCraft
    32-bit, display only
  • Pixels per paper millimeter

    How many CSS pixels one millimeter of the sheet takes, used to draw lineweights at their paper width.

    √(T₀² + T₁²) ÷ (25.4 when the paper is in inches, else 1)

    2D drawing on screen view.js
    • CadCraft
    32-bit, display only
  • Kept solids as screen meshes

    The vertex positions and edge lines of the kept 3D solids as drawn on the 3D tab.

    position = (P − corner) × k, stored as 32-bit

    3D tab drawing of the 2D lines and kept solids ws3d.js
    • CadCraft
    32-bit, display only
  • 2D lines as screen lines

    The 2D drawing's line pieces as drawn on the ground of the 3D tab.

    position = (x − min x, y − min y, 0), stored as 32-bit

    3D tab drawing of the 2D lines and kept solids ws3d.js
    • CadCraft
    32-bit, display only
  • Triangles of a panel outline

    Cuts a panel's outline into triangles for drawing.

    ear when (b − a) × (c − a) > 1e-9 and no other point is inside the triangle

    Cabinets as 3D viewport bodies addons/cabinetcraft/lib/bodies3d.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    32-bit, display only
  • Room coordinates to viewport coordinates

    A point of the room in the viewport's axes and millimeters.

    k = 25.4 (inch job) or 1; (x, y, z) → (x·k, z·k, −y·k)

    Cabinets as 3D viewport bodies addons/cabinetcraft/lib/bodies3d.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    32-bit, display only
  • Member lines for the picture

    The 3D end points of every member, for drawing.

    Truss layout 3D picture addons/trusscraft/lib/view3d.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    32-bit, display only
  • View projection

    Turns 3D points into picture coordinates for a view direction.

    x′ = x cos A − y sin A; y′ = −(z cos E + (x sin A + y cos A) sin E)

    Truss layout 3D picture addons/trusscraft/lib/view3d.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    32-bit, display only
  • Picture output

    Scales the projected lines to the picture size and writes them as SVG.

    Truss layout 3D picture addons/trusscraft/lib/view3d.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    32-bit, display only
  • Deflected shape

    The members' deflected shape, enlarged so it can be seen.

    drawn point = point + scale × displacement; scale = 0.015 × model size ÷ largest displacement

    Analysis results drawn on the model frame/frame-draw.js
    • CadCraft
    • BimCraft
    • DetailCraft
    32-bit, display only
  • Force diagram beside a member

    A filled diagram of one internal force drawn square to each member, with its largest value labeled.

    height = value × 0.08 × model size ÷ largest value

    Analysis results drawn on the model frame/frame-draw.js
    • CadCraft
    • BimCraft
    • DetailCraft
    32-bit, display only
  • Plate contours

    Each plate as two triangles colored by its corner values, with the largest values labeled.

    color = ramp(|value| ÷ largest |value|); kN·m/m = N·mm/mm ÷ 1000

    Analysis results drawn on the model frame/plate-draw.js
    • CadCraft
    • BimCraft
    • DetailCraft
    32-bit, display only
  • Smooth shading normals

    The normal at each corner of faces joined by soft edges.

    n = normalize(Σ n_f × area_f) over the joined faces that meet at the corner

    Smooth shading and texture placement m3d/model.js
    • CadCraft
    • ModelCraft
    32-bit, display only
  • Fitting a texture to a face

    The map from a point on a face to its place on an imported image.

    u = U · p + u₀, v = V · p + v₀, with U · n = 0 and V · n = 0

    Smooth shading and texture placement m3d/model.js
    • CadCraft
    • ModelCraft
    32-bit, display only
  • Texture coefficients as stored

    The eight numbers of a texture's placement as they are kept in the face's paint.

    text = x rounded to 7 significant digits

    Smooth shading and texture placement m3d/model.js
    • CadCraft
    • ModelCraft
    32-bit, display only
  • Normal per corner

    A unit normal for every corner of every face.

    n = normalize(Σ N_f) over the faces of a smooth group

    Polygon mesh: shading normals m3d/mesh.js
    • CadCraft
    • ModelCraft
    32-bit, display only
  • Mesh buffers for the graphics card

    The vertex positions, normals and colors of a definition's faces as the arrays the graphics card draws.

    3D view drawing m3d/view3d.js
    • CadCraft
    • ModelCraft
    32-bit, display only
  • Box of a placement as drawn

    The world-space box of one placed definition, used to frame the view and place the lights.

    3D view drawing m3d/view3d.js
    • CadCraft
    • ModelCraft
    32-bit, display only
  • Overlay line clipped to the near plane

    A 3D line cut at the camera's near plane and projected to screen points for the 2D overlay.

    cut at depth 1.01 × near: a′ = a + (b − a) × (near′ − da) ÷ (db − da)

    3D view drawing m3d/view3d.js
    • CadCraft
    • ModelCraft
    32-bit, display only
  • Mass prism mesh

    The triangles of the walls and roof of a mass.

    Building mass mesh for the 3D view massing.js
    • CivilCraft
    32-bit, display only
  • Ground mesh with elevation bands

    The triangles, normals and colors of a ground surface, cut at the elevation band levels.

    position = (x + dx, y + dy, (z − origin z) × exaggeration); normal = normalized sum of face normals

    3D site view scene site3d.js
    • CivilCraft
    32-bit, display only
  • Map picture coordinates on the ground

    Where each ground vertex falls in the map picture draped over it.

    u = (x + origin x − min x) ÷ width; v = (y + origin y − min y) ÷ height

    3D site view scene site3d.js
    • CivilCraft
    32-bit, display only
  • Road body mesh

    The lanes, shoulders, curbs and walks of a corridor as triangles between neighboring sections.

    3D site view scene site3d-landscape.js
    • CivilCraft
    32-bit, display only
  • Rail mesh

    Each rail as a swept I-shaped outline along the track's sections.

    3D site view scene site3d-rail.js
    • CivilCraft
    32-bit, display only
  • Positions and indices from an accessor

    Reads a primitive's vertex positions and triangle indices from the file's binary chunk.

    Plant 3D models for the 3D view landscape/glb.js
    • CivilCraft
    32-bit, display only
  • Node transform

    The 4×4 matrix of a node from its matrix, or from its translation, rotation and scale.

    M = T · R(q ÷ |q|) · S

    Plant 3D models for the 3D view landscape/glb.js
    • CivilCraft
    32-bit, display only
  • Transform to the model's frame, Y up to Z up

    Applies each node's transform to its vertices and gathers all triangles into one mesh.

    p′ = M·p; (x, y, z) → (x, −z, y)

    Plant 3D models for the 3D view landscape/glb.js
    • CivilCraft
    32-bit, display only
  • Scale a model to the unit box

    Centers a model in plan, sets its base at zero and scales it to one unit wide and one unit tall, with a normal per triangle.

    x′ = (x − cx) ÷ w; z′ = (z − z min) ÷ h; n = (b − a) × (c − a) ÷ |…|

    Plant 3D models for the 3D view landscape/symbols.js
    • CivilCraft
    32-bit, display only
  • Model point to screen

    Where a model point is drawn on the canvas.

    Erection movie player erection-html.js
    • DetailCraft
    32-bit, display only
  • Where a pick is at a given minute

    The offset of a lifted piece from its final place while the movie plays.

    Erection movie player erection-html.js
    • DetailCraft
    32-bit, display only
  • A part's solid for drawing

    The mesh of a part: its profile extruded, with copes cut.

    3D view view3d.js
    • DetailCraft
    32-bit, display only
  • Mitre ends on the mesh

    Moves the end vertices of a mesh onto the mitre's cut plane.

    3D view view3d.js
    • DetailCraft
    32-bit, display only
  • The part under the pointer

    Which part a click hits and where the ray meets it.

    3D view view3d.js
    • DetailCraft
    32-bit, display only
  • Open or closed surface

    The elements of a batch whose triangles do not close.

    key = round(x × 1e4), round(y × 1e4), round(z × 1e4); open if any edge count is odd

    Section caps: which elements are closed solids caps-closed.js
    • BimCraft
    32-bit, display only
  • Elements split over several batches

    Checks again, over all its parts, an element that is drawn in more than one batch.

    Section caps: which elements are closed solids caps-closed.js
    • BimCraft
    32-bit, display only
  • Adding tile results to the picture

    The sums of red, green, blue and sample count of every pixel after a pass.

    out[pixel] += tile[pixel]

    Rendered picture: sample sums and color tables compute/cpu-render.js
    • BimCraft
    • ModelCraft
    32-bit, display only
  • Mean radiance of each pixel

    The picture as the average of its samples.

    color = Σ ÷ n

    Rendered picture: sample sums and color tables compute/cpu-render.js
    • BimCraft
    • ModelCraft
    32-bit, display only
  • Color through a .cube table

    A color after the table's 1D and 3D look-ups.

    x = clamp((r − lo) ÷ (hi − lo)); trilinear: c = c₀ + (c₁ − c₀) × d along each axis in turn

    Rendered picture: sample sums and color tables exr/cube.js
    • BimCraft
    • ModelCraft
    32-bit, display only
  • Table rows read from a .cube file

    The entries of a color table as they are held in memory.

    Rendered picture: sample sums and color tables exr/cube.js
    • BimCraft
    • ModelCraft
    32-bit, display only
  • Numbers written to a .cube file

    A table entry as text in a saved color table.

    text = Number(v.toPrecision(7))

    Rendered picture: sample sums and color tables exr/cube.js
    • BimCraft
    • ModelCraft
    32-bit, display only
  • Filmic tone curve

    Maps scene brightness to screen brightness for the filmic view transform.

    h(x) = (x (0.15 x + 0.05) + 0.004) ÷ (x (0.15 x + 0.5) + 0.06) − 0.02 ÷ 0.3; output = h(2 c) ÷ h(11.2)

    Real-time view and render bench rt/rt-post.js
    • BimCraft
    • ModelCraft
    32-bit, display only
  • Baked probe light

    Collects the bounce light at each probe and removes the sky's own part.

    shᵢ,ₖ = bakedᵢ,ₖ − skyₖ (k = 0…11)

    Real-time view and render bench rt/rt-gi.js
    • BimCraft
    • ModelCraft
    32-bit, display only
  • Mean radiance per pixel

    Averages the accumulated samples of each pixel for the bench and the parity comparison.

    mean = Σ samples ÷ n

    Real-time view and render bench render/bench-kernels.js
    • BimCraft
    • ModelCraft
    32-bit, display only
  • Scene for the standalone viewer

    Packs the drawn scene into the viewer's file.

    Real-time view and render bench rt/rt-export.js
    • BimCraft
    • ModelCraft
    32-bit, display only
  • Part geometry for the view

    Builds the triangles and feature lines of a part for drawing.

    Manual scene in the 3D view illustrate/scene3d.js
    • PartCraft
    32-bit, display only
  • Cut faces lifted off the section plane

    Places the filled cut faces so they are not hidden by the plane that cut them.

    Manual scene in the 3D view illustrate/scene3d.js
    • PartCraft
    32-bit, display only
  • Old and new sheet mixed per pixel

    The color of each pixel of the compare picture, and counts of removed, added and unchanged pixels.

    Sheet compare picture compare.js
    • MarkupCraft
    32-bit, display only
  • Bench rim line segments

    Segment pairs for the rim of each bench.

    Pit and solar table meshes in the 3D view site3d-pit.js
    • CivilCraft
    32-bit, display only
  • Haul ramp ribbon

    A road-wide ribbon on the pit walls for the haul ramp.

    offset = (−dy, dx) ÷ length × width ÷ 2; lift = 0.02 × width

    Pit and solar table meshes in the 3D view site3d-pit.js
    • CivilCraft
    32-bit, display only

A calculation is added only after its source was read. Each statement can be checked in the code shown on its policy's page; the app repositories are public. When a release changes a calculation, its page says so until it has been read again.