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

  • Canvas position to time and value

    The time and value under a canvas point.

    t = t₀ + (x − pad) ÷ (w − 2 pad) × (t₁ − t₀); v = v₀ + (h − pad − y) ÷ (h − 2 pad) × (v₁ − v₀)

    Keys dragged in the graph editor anim/graph.js
    • ModelCraft
    64-bit
  • A key dragged to a new time and value

    Moves a key in time and sets one number of its value.

    time = max(0, round(t × 1000) ÷ 1000); value = v

    Keys dragged in the graph editor anim/graph.js
    • ModelCraft
    64-bit
  • A handle dragged

    The handle's new offset from its key in time and value.

    Δt = t − key time (≤ 0 for the left handle, ≥ 0 for the right); Δv = v − key value

    Keys dragged in the graph editor anim/graph.js
    • ModelCraft
    64-bit
  • 4×4 matrix product

    The product of two column-major 4×4 matrices.

    Bone frames and pose matrices anim/rig.js
    • ModelCraft
    64-bit
  • 4×4 matrix inverse

    The inverse of a 4×4 matrix by cofactors.

    M⁻¹ = adjugate(M) ÷ det(M)

    Bone frames and pose matrices anim/rig.js
    • ModelCraft
    64-bit
  • A bone's rest frame

    The matrix from a bone's own frame to the mesh: Y from head to tail, Z as near the mesh's +Z as it can be, turned by the roll.

    y = (tail − head) made unit; z = (up − y (up · y)) made unit; x = y × z; roll turns x and z about y

    Bone frames and pose matrices anim/rig.js
    • ModelCraft
    64-bit
  • Posed bone and skin matrices

    Each bone's posed frame and the matrix that moves rest points to the pose.

    W = W_parent × R_parent⁻¹ × R × local; skin = W × R⁻¹

    Bone frames and pose matrices anim/rig.js
    • ModelCraft
    64-bit
  • Skin matrices as dual quaternions

    Each bone's turn and move as a unit dual quaternion, for dual-quaternion skinning.

    dual part = ½ × (t, 0) × q

    Bone frames and pose matrices anim/rig.js
    • ModelCraft
    64-bit
  • A bone's pose from a drag

    The location or rotation a bone gets when it is dragged in the view.

    turn: angle swept round the bone's head on screen, about the view axis carried into the bone's frame; move: pixels × pixel size, along the camera's right and up, carried into the bone's frame

    Bone frames and pose matrices anim/rig-view.js
    • ModelCraft
    64-bit
  • Axes and unit

    The matrix that takes the file's coordinates to Z up and meters.

    k = UnitScaleFactor × 0.01; columns = ± k along the model axis each file axis maps to

    FBX import: axes, units and transforms io/fbx-import.js
    • ModelCraft
    64-bit
  • Node matrices into the model's axes

    Carries a node's matrix from the file's axes and unit into the model's.

    M′ = A × M × A⁻¹

    FBX import: axes, units and transforms io/fbx-import.js
    • ModelCraft
    64-bit
  • Euler angles to a matrix

    The rotation matrix of three angles in degrees in the file's rotation order.

    XYZ order: R = Rz × Ry × Rx, angles × π ÷ 180

    FBX import: axes, units and transforms io/fbx-import.js
    • ModelCraft
    64-bit
  • An object's own matrix

    Builds a model's local matrix from its translation, offsets, pivots, pre-, own and post-rotation, and scaling.

    M = T × Roff × Rp × Rpre × R × Rpost⁻¹ × Rp⁻¹ × Soff × Sp × S × Sp⁻¹

    FBX import: axes, units and transforms io/fbx-import.js
    • ModelCraft
    64-bit
  • Mesh points into the model

    Carries each control point through the axis and unit matrix.

    p′ = A × p

    FBX import: axes, units and transforms io/fbx-import.js
    • ModelCraft
    64-bit
  • Lamps

    A lamp's position, direction and brightness from an FBX light.

    lumens = Intensity × 8; direction = the node's −Y, made unit

    FBX import: axes, units and transforms io/fbx-import.js
    • ModelCraft
    64-bit
  • Cameras

    A saved view's eye, target and field of view from an FBX camera.

    target = eye + 10 × forward; parallel view height = OrthoZoom × 10

    FBX import: axes, units and transforms io/fbx-import.js
    • ModelCraft
    64-bit
  • Reading a vertex

    Parses the three coordinates of a 'v' line.

    OBJ import and export io/obj.js
    • ModelCraft
    64-bit
  • Points into Z up

    Copies an object's points into the model's coordinates.

    (x, y, z) → (x, −z, y)

    OBJ import and export io/obj.js
    • ModelCraft
    64-bit
  • Sharp edges

    Marks an edge sharp where the file's normals break across it, where smoothing groups differ, or where the faces bend.

    with normals: sharp unless n₁ · n₂ > 0.9995 at both ends; without normals or groups: sharp when the face normals' dot product < 0.99996

    OBJ import and export io/obj.js
    • ModelCraft
    64-bit
  • Number format on export

    Prints a number for the exported file.

    text = the number rounded to 6 decimals, trailing zeros removed

    OBJ import and export io/obj.js
    • ModelCraft
    64-bit
  • Exported points

    Carries a mesh point to world coordinates and Y up for the file.

    p′ = placement matrix × p; (x, y, z) → (x, z, −y)

    OBJ import and export io/obj.js
    • ModelCraft
    64-bit
  • Texture coordinates with a map's scale and offset

    Applies a material's map scale and offset to a texture coordinate on import.

    u′ = u × scale_u + offset_u; v′ = v × scale_v + offset_v

    OBJ import and export io/obj.js
    • ModelCraft
    64-bit
  • Rounding of every parameter

    Rounds each number of a converted material.

    v → the number nearest v with 7 significant digits

    Imported material parameters io/pbr.js
    • ModelCraft
    64-bit
  • Film thickness and dispersion

    A thin film's thickness in micrometers and a glass's Abbe number.

    thickness (µm) = maximum thickness (nm) ÷ 1000; Abbe number = 20 ÷ dispersion

    Imported material parameters io/pbr.js
    • ModelCraft
    64-bit
  • Emission strength

    Splits an emissive color into a color with a peak of 1 and a luminance.

    peak = largest channel; color = channels ÷ peak; luminance = peak × strength

    Imported material parameters io/pbr.js
    • ModelCraft
    64-bit
  • Shininess to roughness

    A roughness from a Blinn–Phong shininess exponent.

    roughness = (2 ÷ (s + 2))^¼, clamped to [0, 1]

    Imported material parameters io/pbr.js
    • ModelCraft
    64-bit
  • Knot span

    Finds the knot interval that holds a parameter.

    3DM curves and surfaces: points on them io/3dm/geom.js
    • ModelCraft
    • PartCraft
    64-bit
  • de Boor's algorithm

    A point of a B-spline from its control points and knots.

    a = (t − k₀) ÷ (k₁ − k₀); d_j = (1 − a) d_(j−1) + a d_j, repeated degree times

    3DM curves and surfaces: points on them io/3dm/geom.js
    • ModelCraft
    • PartCraft
    64-bit
  • Rational point

    Divides a homogeneous point by its weight.

    (x, y, z) = (X, Y, Z) ÷ w

    3DM curves and surfaces: points on them io/3dm/geom.js
    • ModelCraft
    • PartCraft
    64-bit
  • Point on a NURBS surface

    A surface point from its control net.

    de Boor along v for each active row, then along u, then the division by the weight

    3DM curves and surfaces: points on them io/3dm/geom.js
    • ModelCraft
    • PartCraft
    64-bit
  • Point on a curve

    A point on a line, arc, polyline, NURBS curve or chain of curves at a parameter.

    arc: a = angle mapped from the parameter; p = o + r cos a × x + r sin a × y

    3DM curves and surfaces: points on them io/3dm/geom.js
    • ModelCraft
    • PartCraft
    64-bit
  • A curve as a polyline

    Cuts a curve into chords that stay within a tolerance of it, keeping every knot and corner.

    a piece is halved while its middle or quarter points lie farther than tol from the chord, at most 10 times

    3DM curves and surfaces: points on them io/3dm/geom.js
    • ModelCraft
    • PartCraft
    64-bit
  • Rotation about an axis

    Turns a point about a line by an angle, for surfaces of revolution.

    p′ = o + v cos a + (z × v) sin a + z (z · v)(1 − cos a)

    3DM curves and surfaces: points on them io/3dm/geom.js
    • ModelCraft
    • PartCraft
    64-bit
  • Point on a surface

    A point on a plane, NURBS surface, surface of revolution or sum surface.

    plane: o + a x + b y; revolution: the profile point turned about the axis; sum: p(u) + q(v) + base

    3DM curves and surfaces: points on them io/3dm/geom.js
    • ModelCraft
    • PartCraft
    64-bit
  • Surface normal

    The unit normal of a surface at a point.

    ∂u ≈ S(u + h, v) − S(u − h, v); ∂v likewise; n = ∂u × ∂v, made unit; h = 1e-5 × parameter range

    3DM curves and surfaces: points on them io/3dm/geom.js
    • ModelCraft
    • PartCraft
    64-bit
  • Selection center

    The mean position of the selected vertices: the pivot for rotate, scale and spin.

    c = (Σ pᵢ) × (1 ÷ n)

    Mesh edit moves: grab, rotate, scale, extrude, spin, knife, bisect mesh/edit-tool.js
    • ModelCraft
    64-bit
  • Point on an axis nearest the pointer

    The point of a line through w along dir that is nearest the pointer's ray; used for axis-locked moves and extrude distances.

    s = (b·e − c·d) ÷ (a·c − b²); point = w + d₁·s

    Mesh edit moves: grab, rotate, scale, extrude, spin, knife, bisect mesh/edit-tool.js
    • ModelCraft
    64-bit
  • Grab, rotate and scale

    Builds the move applied to every affected vertex in world space.

    grab: p′ = p + d; rotate: p′ = R(k, θ)(p − P) + P; scale: p′ = P + f·(p − P), or along a locked axis a: p′ = p + a·((p − P)·a)·(f − 1)

    Mesh edit moves: grab, rotate, scale, extrude, spin, knife, bisect mesh/edit-tool.js
    • ModelCraft
    64-bit
  • Rotation about an axis

    Turns a point about the axis k through c by the angle a.

    q = p − c; p′ = c + q·cos a + (n × q)·sin a + n·(n·q)·(1 − cos a)

    Mesh edit moves: grab, rotate, scale, extrude, spin, knife, bisect mesh/edit-tool.js
    • ModelCraft
    64-bit
  • Extrude distance

    Moves the new vertices of an extrusion by the dragged or typed distance along the region's normal, or along each face's own normal.

    d = (line point now − line point at start)·dir; p′ = p + dirL·d, dirL = M⁻¹·dir

    Mesh edit moves: grab, rotate, scale, extrude, spin, knife, bisect mesh/edit-tool.js
    • ModelCraft
    64-bit
  • Knife point on an edge

    Where along an edge a knife click lands, as a fraction of the edge from its start.

    s = clamp((q − a)·(b − a) ÷ L², 0, 1)

    Mesh edit moves: grab, rotate, scale, extrude, spin, knife, bisect mesh/edit-tool.js
    • ModelCraft
    64-bit
  • Bisect plane

    The cutting plane through two clicked points as seen from the camera, in the mesh's own space.

    n = unit((p₂ − p₁) × ray direction); plane = {M⁻¹·p₁, unit(M⁻¹ applied to n as a direction)}

    Mesh edit moves: grab, rotate, scale, extrude, spin, knife, bisect mesh/edit-tool.js
    • ModelCraft
    64-bit
  • Spin center, axis and angle

    The center, axis and total angle handed to the spin operator, in the mesh's own space.

    center = M⁻¹·c; axis = unit(M⁻¹ applied to the world axis); angle = typed × π ÷ 180, or −(a₁ − a₀)

    Mesh edit moves: grab, rotate, scale, extrude, spin, knife, bisect mesh/edit-tool.js
    • ModelCraft
    64-bit
  • Vertex normals

    A unit normal per vertex from the faces round it, weighted by face area.

    N(v) = unit(Σ Newell normal of each face at v)

    Inset, bevel and moves along normals mesh/ops.js
    • ModelCraft
    64-bit
  • Inset corner

    Where a face corner goes when both of its edges move inward by d.

    bis = unit(in₁ + in₂); c = bis·in₁; k = d ÷ c; p′ = p + bis·k

    Inset, bevel and moves along normals mesh/ops.js
    • ModelCraft
    64-bit
  • Inset of a region's border

    The new border vertices of a region inset, each from the two border edges that meet at it, raised by the depth.

    n = unit(n(face in) + n(face out)); p′ = insetCorner(p, a, b, n, thickness) + n·depth

    Inset, bevel and moves along normals mesh/ops.js
    • ModelCraft
    64-bit
  • Bevel: slide along plain edges

    How far a new point slides along an edge that is not bevelled, so the bevel is the stated width inside the face.

    sin = |u_in × u_out|; slide = width ÷ sin; point = v + u·min(slide, cap)

    Inset, bevel and moves along normals mesh/ops.js
    • ModelCraft
    64-bit
  • Bevel: where two bevelled edges meet

    The point inside a face where the offset lines of two bevelled edges cross.

    k = width ÷ |u_in × u_out|; point = v + (u_in + u_out)·k

    Inset, bevel and moves along normals mesh/ops.js
    • ModelCraft
    64-bit
  • Bevel: profile points

    The points between the two sides of a bevelled edge when it has more than one segment.

    M = (p₀ + p₁) ÷ 2; Q = M + (p_c − M)·2·profile; B(t) = (1 − t)²·p₀ + 2t(1 − t)·Q + t²·p₁, t = k ÷ segments

    Inset, bevel and moves along normals mesh/ops.js
    • ModelCraft
    64-bit
  • Shrink or fatten

    Moves each listed vertex along its normal by d.

    p′ = p + N(v)·d

    Inset, bevel and moves along normals mesh/ops.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.