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

  • Ray and triangle

    Whether a ray meets a triangle and at what distance t and barycentric u, v.

    t = (e2 · (s × e1)) ÷ (e1 · (d × e2))

    Ray hits against 32-bit triangle records compute/bvh-core.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Ray and box slab test

    The distance at which a ray enters a box, or Infinity.

    t = (box − o) ÷ d, max of the near, min of the far

    Ray hits against 32-bit triangle records compute/bvh-core.js
    • BimCraft
    • ModelCraft
    64-bit
  • Instance inverse matrix

    The world-to-object matrix of an instance as 12 numbers.

    M⁻¹ = adj(M) ÷ det(M), translation = −M⁻¹ t

    Ray hits against 32-bit triangle records compute/bvh-scene.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Ray into object space of an instance

    The ray origin and direction in an instance frame, and the triangle test that follows.

    Ray hits against 32-bit triangle records compute/bvh-scene.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Triangle records from world triangles

    The 12-number triangle records the scatter ray tests use.

    e1 = v1 − v0; e2 = v2 − v0

    Ray hits against 32-bit triangle records rt/rt-scatter-ui.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Ray against boxes

    Calls back for every item whose box a ray passes through.

    t₀ = max(nearₐ), t₁ = min(farₐ); hit if t₀ ≤ t₁

    Box tree for picking and collisions m3d/bvh.js
    • CadCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Boxes of point lists

    The box of each item from its points, grown by a pad.

    Box tree for picking and collisions m3d/bvh.js
    • CadCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Accumulation buffer read back

    The per-pixel sums of red, green, blue and sample count.

    Path-traced picture sums and the saved file render/pt-gpu.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Sum of an exact range of samples

    The sum of samples s0 to s0 + spp − 1 for every pixel.

    Path-traced picture sums and the saved file render/pt-gpu.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Render elements read back

    The per-pixel render elements and light-group sums.

    Path-traced picture sums and the saved file render/pt-gpu.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • EXR channels from the sums

    The mean (or raw sum) of each channel for the EXR and render file.

    mean = Σ ÷ max(samples, 1)

    Path-traced picture sums and the saved file render/pt-output.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • 16-bit PNG

    The picture as 16 bits per channel.

    v₁₆ = round(clamp(v, 0, 1) × 65535)

    Path-traced picture sums and the saved file render/pt-output.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Reopening a render file

    The sums and counts read back from the layers file.

    Path-traced picture sums and the saved file render/pt-output.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Save as 16-bit PNG

    Chooses the 32-bit or the 8-bit path to write the 16-bit PNG.

    Path-traced picture sums and the saved file render/render-ui.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Material and band thicknesses

    The thickness of each library sheet and edge band in millimeters and in inches.

    Cabinet material sizes, grooves and drill files addons/cabinetcraft/lib/materials.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    Exact
  • Rules from the material picks

    The thicknesses, groove and band thicknesses that the construction rules use.

    groove = min(tback, 0.6 × tcarcass)

    Cabinet material sizes, grooves and drill files addons/cabinetcraft/lib/materials.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Sheet size for a material

    The sheet width and height a material is cut from.

    in = round(mm ÷ 25.4 × 4) ÷ 4

    Cabinet material sizes, grooves and drill files addons/cabinetcraft/lib/materials.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Hole positions in the drill XML

    The x and y of each hole as written in the drill file.

    x = round(x × 1000) ÷ 1000

    Cabinet material sizes, grooves and drill files addons/cabinetcraft/lib/export.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • G-code scale and thickness

    The unit scale and cut depth passed to the sheet G-code writer.

    thickness_mm = thickness × scale

    Cabinet material sizes, grooves and drill files addons/cabinetcraft/lib/export.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Vertices and loose edges

    The point positions of a model definition and its loose edges.

    Model points written to USD usd/m3d.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    32-bit in part
  • Mesh arrays

    The point, normal, UV and color arrays of a mesh.

    Model points written to USD usd/m3d.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    32-bit in part
  • Number to text

    The text a number is written as, by type.

    f32: text = shortest s with fround(+s) = fround(x)

    Number text in USD files usd/usda-write.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    32-bit in part
  • Shortest digits

    A number to p significant digits without trailing zeros.

    Number text in USD files usd/usda-write.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Type name to number type

    Which number type a USD type name uses (32-bit float, half or 64-bit double).

    Number text in USD files usd/sdf.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    Exact
  • Inline values

    A value that the file stores inside its 32-bit payload word.

    Floats read from USD files usd/usdc-read.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    32-bit in part
  • Raw arrays

    A packed array of numbers of one type.

    Floats read from USD files usd/usdc-read.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    32-bit in part
  • Compressed float arrays

    An array stored as whole numbers or as a lookup table and indexes.

    Floats read from USD files usd/usdc-read.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    32-bit in part
  • Float text rounding

    A float or half value read from .usda text.

    Floats read from USD files usd/usda-read.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    32-bit in part
  • Arrays from text

    A list of parsed numbers as a typed array of the right type.

    Floats read from USD files usd/usda-read.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    32-bit in part
  • Half to float

    The value of a 16-bit half float.

    v = ± (1 + m ÷ 1024) × 2^(e − 15)

    Half floats in USD usd/util.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    32-bit in part
  • Float to half

    The 16-bit half closest to a number.

    Half floats in USD usd/util.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    32-bit in part
  • Half to float

    The value of a 16-bit half float.

    v = ± (1 + m ÷ 1024) × 2^(e − 15)

    Half floats in EXR exr/util.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Float to half

    The 16-bit half closest to a number.

    Half floats in EXR exr/util.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Measure to SI

    A property value in meters, square meters or cubic meters.

    area = v × L²; volume = v × L³

    IFC measures in SI for USD usd/ifc.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Start editing a key

    Saves the current points as the basis and shows the key at full strength.

    point = basis + offset

    Shape keys: offsets, editing and blending anim/shapes.js
    • ModelCraft
    32-bit in part
  • Finish editing a key

    Turns the edited points into the key's offsets and puts the mesh back to its basis.

    offset = edited − basis; point = basis

    Shape keys: offsets, editing and blending anim/shapes.js
    • ModelCraft
    32-bit in part
  • Key from imported positions

    Makes a key that moves the basis to a list of positions (glTF morph targets, USD blend shapes).

    offset = position − basis point

    Shape keys: offsets, editing and blending anim/shapes.js
    • ModelCraft
    32-bit in part
  • Blend of the keys

    The points of a mesh with each key at its weight.

    pᵢ = basisᵢ + Σ wₖ × offsetₖ,ᵢ

    Shape keys: offsets, editing and blending anim/shapes.js
    • ModelCraft
    32-bit in part
  • Deformed copy of a mesh

    The mesh moved by its shape keys and then its skin, which the view, picking and exports read.

    points = blend of keys; then skin applied to the same array

    Shape keys: offsets, editing and blending anim/deform.js
    • ModelCraft
    32-bit in part
  • Bone data for the card

    Packs the bone matrices (or dual quaternions) for the kernel.

    Skinning on the graphics card anim/skin-gpu.js
    • ModelCraft
    32-bit, display only
  • Skinned points read back

    Runs one skin on the card and reads the points back.

    Skinning on the graphics card anim/skin-gpu.js
    • ModelCraft
    32-bit, display only
  • Key time of a baked frame

    The timeline time given to each baked frame.

    t = round((from + f ÷ fps) × 1000) ÷ 1000

    Baked physics key times anim/bake.js
    • ModelCraft
    64-bit
  • Time of day to seconds

    Turns HH:MM text into seconds.

    seconds = h × 3600 + m × 60

    Shift calendar working time addons/flow/lib/calendar.js
    • ModelCraft
    Exact
  • Weekly on-intervals

    The merged list of on-intervals in a week, with windows that pass midnight wrapped.

    length = to − from (+ one day if the end is not after the start)

    Shift calendar working time addons/flow/lib/calendar.js
    • ModelCraft
    Exact
  • On time between two instants

    The total seconds the calendar is on between two times.

    Σ (off − on) over the on-intervals inside [a, b]

    Shift calendar working time addons/flow/lib/calendar.js
    • ModelCraft
    64-bit
  • Factor from text

    A factor from a plain number, a percent of the size, or a percent change.

    f = n; n ÷ 100; 1 ± n ÷ 100

    Typed scale factors and shrinkage allowance scale-factors.js
    • ModelCraft
    • PartCraft
    64-bit
  • Shrinkage allowance

    The pattern factor for a casting that shrinks by a percentage.

    add: 1 + s ÷ 100; exact: 1 ÷ (1 − s ÷ 100)

    Typed scale factors and shrinkage allowance scale-factors.js
    • ModelCraft
    • PartCraft
    64-bit
  • Meters per file unit

    The conversion factor for each unit system a 3DM file can name.

    meters = file value × factor

    Units and tolerance read from a 3DM file io/3dm/read.js
    • ModelCraft
    • PartCraft
    64-bit
  • Units and tolerance from the file settings

    Reads the unit system, custom meters-per-unit and the tolerance from a file's settings record.

    Units and tolerance read from a 3DM file io/3dm/read.js
    • ModelCraft
    • PartCraft
    64-bit
  • Box and cylinder

    A 20 mm cube and a 20 mm cylinder, standing on z = 0 and centered on the origin.

    S = 0.02; R = S ÷ 2; box: S × S square pulled up by S; cylinder: 32-sided polygon of radius R pulled up by S

    Beginner shapes, align and drop to ground beginner.js
    • ModelCraft
    64-bit

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.