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

  • Matrix product

    Combines two transforms into one.

    o[c][r] = Σₖ a[k][r] × b[c][k]

    USD transforms and placement usd/geom.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Matrix inverse

    The transform that undoes another.

    inverse = cofactor matrix ÷ determinant

    USD transforms and placement usd/geom.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Transforming a point

    Applies a transform to a point.

    p′ = (M × [x, y, z, 1]) ÷ w

    USD transforms and placement usd/geom.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Rotation about an axis

    The matrix of a rotation by an angle in degrees about X, Y or Z.

    a = deg × π ÷ 180; entries cos a, ± sin a

    USD transforms and placement usd/geom.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Quaternion to rotation matrix

    The rotation matrix of an orientation stored as a quaternion.

    q ÷ |q|; R₀₀ = 1 − 2(y² + z²), R₀₁ = 2(xy + wz), …

    USD transforms and placement usd/geom.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Value at a time

    An animated value at a given time, between its stored samples.

    v = a + (b − a) × (t − t₀) ÷ (t₁ − t₀)

    USD transforms and placement usd/geom.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • An object's own transform

    Builds the transform of one object from its list of translate, rotate, scale and matrix operations.

    M = op₁ × op₂ × … in the listed order; an inverted operation uses its inverse

    USD transforms and placement usd/geom.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • World transform

    The transform of an object in the scene, through all its parents.

    W = M_root × … × M_parent × M_own

    USD transforms and placement usd/geom.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Scene units and up axis

    The transform from the scene's own units and up axis to meters with Z up.

    scale by metersPerUnit; Y-up scenes: rotate 90° about X

    USD transforms and placement usd/geom.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Placement of instanced copies

    The transform of each copy of a point instancer from its position, orientation and scale.

    M = translate(p) × rotate(q) × scale(s)

    USD transforms and placement usd/scene.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Writing an object's transform

    Stores an object's placement in the exported scene.

    USD transforms and placement usd/build.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Attribute value to its storage type

    Converts a list of numbers to the number type its USD attribute type calls for.

    USD mesh coordinates in saved and exported files usd/build.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    32-bit in part
  • Mesh points and extent

    Stores the points of a mesh and its bounding box in the scene.

    extent = [min x, min y, min z, max x, max y, max z] of the points

    USD mesh coordinates in saved and exported files usd/build.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    32-bit in part
  • Lamp intensity

    Converts a lamp's lumens to the intensity a renderer reads.

    intensity = lumens ÷ (683 × area × π)

    USD mesh coordinates in saved and exported files usd/build.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    32-bit, display only
  • Single values in the binary file

    Writes one number, tuple or matrix into the binary USD file.

    USD mesh coordinates in saved and exported files usd/usdc-write.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Arrays in the binary file

    Writes an array of numbers into the binary USD file.

    USD mesh coordinates in saved and exported files usd/usdc-write.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    32-bit in part
  • Reading a mesh

    The points, faces and attached values of a mesh read from a USD scene.

    USD mesh coordinates in saved and exported files usd/geom.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    32-bit in part
  • Built-in shapes as meshes

    A cube, sphere, cylinder, cone, capsule or plane of a USD scene as a mesh.

    ring point = (r·cos θ, r·sin θ, z), θ = 2π·j ÷ 24

    USD mesh coordinates in saved and exported files usd/geom.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Raw double, read

    A 64-bit value read from eight bytes of the bit stream.

    Numbers in a DWG file, read and written bit for bit dwg/bits-read.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Bit double, read

    A value stored as a two-bit code: a full 64-bit value, exactly 1.0 or exactly 0.0.

    Numbers in a DWG file, read and written bit for bit dwg/bits-read.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Double with default, read

    A value stored as the bytes in which it differs from a default value.

    Numbers in a DWG file, read and written bit for bit dwg/bits-read.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • 64-bit whole number, read

    An unsigned 64-bit whole number from two 32-bit halves.

    value = high × 2³² + low

    Numbers in a DWG file, read and written bit for bit dwg/bits-read.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Bit long long, read

    A whole number of up to seven bytes, the count given by three bits.

    value = Σ byteᵢ × 256ⁱ

    Numbers in a DWG file, read and written bit for bit dwg/bits-read.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Handle reference, read

    An object handle, absolute or as an offset from another handle.

    value = Σ byte × 256ᵏ; codes 6, 8, A, C: ref + 1, ref − 1, ref + value, ref − value

    Numbers in a DWG file, read and written bit for bit dwg/bits-read.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Modular char, read

    A signed whole number stored seven bits per byte.

    value = Σ (byte & 0x7F) × 2^(7i); the last byte carries 6 bits and the sign

    Numbers in a DWG file, read and written bit for bit dwg/bits-read.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Raw double, written

    A 64-bit value written as its eight bytes.

    Numbers in a DWG file, read and written bit for bit dwg/bits-write.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Bit double, written

    A value written as a two-bit code for exactly 0.0 or 1.0, or as a full 64-bit value.

    Numbers in a DWG file, read and written bit for bit dwg/bits-write.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Double with default, written

    A value written as a two-bit code when it equals its default, or in full.

    Numbers in a DWG file, read and written bit for bit dwg/bits-write.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Thickness, written

    A thickness written as one bit when it is zero, or as a bit double.

    Numbers in a DWG file, read and written bit for bit dwg/bits-write.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Bit long, written

    A 32-bit whole number in its short or full form.

    Numbers in a DWG file, read and written bit for bit dwg/bits-write.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    Exact
  • Bit short, written

    A 16-bit whole number in its short or full form.

    Numbers in a DWG file, read and written bit for bit dwg/bits-write.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    Exact
  • Bit long long, written

    A 64-bit whole number as a three-bit byte count and its bytes.

    Numbers in a DWG file, read and written bit for bit dwg/bits-write.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    Exact
  • Point, written

    The three coordinates of a point as bit doubles.

    Numbers in a DWG file, read and written bit for bit dwg/bits-write.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Handle bytes, written

    A handle as its bytes, most significant first.

    byte = v mod 256; v = ⌊v ÷ 256⌋

    Numbers in a DWG file, read and written bit for bit dwg/bits-write.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    Exact
  • Lineweight to stored index

    The index written for a lineweight, or the codes for by layer, by block and default.

    index of the list value with the smallest |value − lineweight|

    Lineweights in a DWG file dwg/model.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    Exact
  • Stored index to lineweight

    The lineweight for an index read from a file.

    Lineweights in a DWG file dwg/model.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    Exact
  • Triangles of a polygon with holes

    The triangles of a face as triples of vertex indexes.

    Triangulation of faces with holes m3d/earcut.js
    • CadCraft
    • ModelCraft
    • TakeoffCraft
    64-bit
  • Orientation of three points

    Twice the signed area of a triangle, whose sign says which way three points turn.

    (q_y − p_y)(r_x − q_x) − (q_x − p_x)(r_y − q_y)

    Triangulation of faces with holes m3d/earcut.js
    • CadCraft
    • ModelCraft
    • TakeoffCraft
    64-bit
  • Direction of a ring

    Whether a ring of points runs clockwise or counterclockwise.

    Σ (x_j − x_i)(y_i + y_j)

    Triangulation of faces with holes m3d/earcut.js
    • CadCraft
    • ModelCraft
    • TakeoffCraft
    64-bit
  • Is a corner an ear

    Whether the triangle at a corner is convex and holds no other point of the polygon.

    Triangulation of faces with holes m3d/earcut.js
    • CadCraft
    • ModelCraft
    • TakeoffCraft
    64-bit
  • Point in a triangle

    Whether a point lies in or on a triangle.

    three comparisons (c − p) × (a − p) ≥ 0, each written as product ≥ product

    Triangulation of faces with holes m3d/earcut.js
    • CadCraft
    • ModelCraft
    • TakeoffCraft
    64-bit
  • Duplicate and collinear points removed

    Drops points that repeat their neighbor or lie exactly on the line between their neighbors.

    Triangulation of faces with holes m3d/earcut.js
    • CadCraft
    • ModelCraft
    • TakeoffCraft
    64-bit
  • Bridge from a hole to the outer ring

    The outer-ring point a hole is connected to, found by a ray to the left from the hole's leftmost point.

    x = p_x + (h_y − p_y)(n_x − p_x) ÷ (n_y − p_y); tan = |h_y − p_y| ÷ (h_x − p_x)

    Triangulation of faces with holes m3d/earcut.js
    • CadCraft
    • ModelCraft
    • TakeoffCraft
    64-bit
  • Do two edges cross

    Whether two segments intersect, used to keep a diagonal from crossing the polygon.

    Triangulation of faces with holes m3d/earcut.js
    • CadCraft
    • ModelCraft
    • TakeoffCraft
    64-bit
  • Is a diagonal's midpoint inside

    Whether the middle of a candidate diagonal lies inside the polygon.

    crossing count of a ray from ((a_x + b_x) ÷ 2, (a_y + b_y) ÷ 2)

    Triangulation of faces with holes m3d/earcut.js
    • CadCraft
    • ModelCraft
    • TakeoffCraft
    64-bit
  • Triangulate a polygon with holes

    The triangles of a polygon, as indexes into its point list.

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Winding of a ring

    Whether a ring runs clockwise or counterclockwise.

    sum = Σ (xⱼ − xᵢ) × (yᵢ + yⱼ)

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Orientation of three points

    On which side of the line through two points a third point lies.

    area = (q.y − p.y) × (r.x − q.x) − (q.x − p.x) × (r.y − q.y)

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Removing duplicate and collinear points

    Drops points that repeat their neighbor or lie on the line between their neighbors.

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Ear test

    Whether a corner can be cut off as a triangle: it is convex and no other point of the ring lies inside it.

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    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.