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

  • Even cuts along an edge

    The new vertices that divide an edge into cuts + 1 parts, shared by both faces on the edge.

    s = k ÷ (cuts + 1); with slide: s = clamp(s + slide ÷ (cuts + 1), 0.001, 0.999); p = A + (B − A)·s

    Subdivide, loop cut, bisect, knife and grid fill mesh/ops.js
    • ModelCraft
    64-bit
  • Subdivide: interior points of a quad

    The points inside a quad whose four edges are all cut, placed so they follow the four sides.

    u = i ÷ N, w = j ÷ N; p = (1 − w)·S₀ + w·S₂ + (1 − u)·S₃ + u·S₁ − [(1 − u)(1 − w)·c₀₀ + u(1 − w)·c₁₀ + uw·c₁₁ + (1 − u)w·c₀₁]

    Subdivide, loop cut, bisect, knife and grid fill mesh/ops.js
    • ModelCraft
    64-bit
  • Bisect by a plane

    Cuts every listed face's edges where the plane crosses them and splits the faces along the cut.

    dist(v) = P(v)·n − p·n; s = dₐ ÷ (dₐ − d_b); point = A + (B − A)·s

    Subdivide, loop cut, bisect, knife and grid fill mesh/ops.js
    • ModelCraft
    64-bit
  • Knife: where the cut crosses an edge

    For each edge of the faces round the current point, whether the cutting plane crosses it and where.

    dₐ = (a − A)·n, d_b = (b − A)·n; s = dₐ ÷ (dₐ − d_b); X = a + (b − a)·s

    Subdivide, loop cut, bisect, knife and grid fill mesh/ops.js
    • ModelCraft
    64-bit
  • Grid fill: interior points

    The points inside an open loop filled with a grid of quads, following the loop's four sides.

    u = i ÷ a, w = j ÷ b; p = ruled blend of the four side points − bilinear blend of the four corners

    Subdivide, loop cut, bisect, knife and grid fill mesh/ops.js
    • ModelCraft
    64-bit
  • Merge at center

    Joins vertices into one at their mean position, at the first or last of them, or at a given point.

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

    Merge, spin, bridge, slide and smooth mesh/ops.js
    • ModelCraft
    64-bit
  • Merge by distance

    Merges every vertex that lies within the given distance of a vertex already kept.

    cell = max(dist, 1e-9); merge v into w when |P(w) − P(v)| ≤ dist

    Merge, spin, bridge, slide and smooth mesh/ops.js
    • ModelCraft
    64-bit
  • Spin

    Extrudes a region or open edges round an axis in a number of steps over a total angle.

    aᵢ = angle·i ÷ n; pᵢ = c + q·cos aᵢ + (k × q)·sin aᵢ + k·(k·q)·(1 − cos aᵢ), q = p₀ − c

    Merge, spin, bridge, slide and smooth mesh/ops.js
    • ModelCraft
    64-bit
  • Source of a copied vertex

    Finds the vertex a fresh copy was made from, so spin can rotate from the starting position.

    Merge, spin, bridge, slide and smooth mesh/ops.js
    • ModelCraft
    64-bit
  • Bridge: pairing two loops

    Chooses the rotation and direction that pair the vertices of two loops with the shortest total distance.

    d(r, dir) = Σᵢ |P(Aᵢ) − P(B₍r + dir·i₎)|; choose the smallest

    Merge, spin, bridge, slide and smooth mesh/ops.js
    • ModelCraft
    64-bit
  • Slide along rails

    Puts each slid vertex a fraction t of the way from its starting place toward the far end of its rail.

    p′ = p + (P(w) − p)·|t|, w = rail end a for t ≥ 0, b for t < 0

    Merge, spin, bridge, slide and smooth mesh/ops.js
    • ModelCraft
    64-bit
  • Smooth vertices

    Moves each vertex part of the way to the average of its neighbors, a number of times.

    c = (Σ neighbors) × (1 ÷ n); p′ = p + (c − p)·factor

    Merge, spin, bridge, slide and smooth mesh/ops.js
    • ModelCraft
    64-bit
  • Scale

    Scales the mesh about its own origin by a factor for each axis.

    p′ = [x·f_x, y·f_y, z·f_z]

    Modifier stack: scale, mirror, array, solidify, displace, lattice, curve, shrinkwrap mesh/modifiers.js
    • ModelCraft
    64-bit
  • Mirror

    Adds a mirrored copy across the x, y or z plane through the origin and merges the seam.

    copy: coordinate k → −k; seam: vertices with |coordinate k| ≤ dist merged within max(2·dist, 1e-12)

    Modifier stack: scale, mirror, array, solidify, displace, lattice, curve, shrinkwrap mesh/modifiers.js
    • ModelCraft
    64-bit
  • Radial array

    Places copies turned round an axis through the origin.

    step = (angle·π ÷ 180) ÷ (n for a full circle, else n − 1); aᵢ = step·i; [u′, v′] = [u·cos aᵢ − v·sin aᵢ, u·sin aᵢ + v·cos aᵢ]

    Modifier stack: scale, mirror, array, solidify, displace, lattice, curve, shrinkwrap mesh/modifiers.js
    • ModelCraft
    64-bit
  • Linear array

    Places copies at a step made of a fraction of the mesh's box size plus a fixed offset.

    d = size ∘ rel + abs; copy i: p′ = p + d·i

    Modifier stack: scale, mirror, array, solidify, displace, lattice, curve, shrinkwrap mesh/modifiers.js
    • ModelCraft
    64-bit
  • Frames along a polyline

    The point, tangent and two cross directions at a given length along a polyline; used by the curve modifier and the array along a curve.

    Lᵢ = Lᵢ₋₁ + |ptsᵢ − ptsᵢ₋₁|; f = (s − Lᵢ₋₁) ÷ (Lᵢ − Lᵢ₋₁); p = ptsᵢ₋₁ + (ptsᵢ − ptsᵢ₋₁)·f; b = unit(t × up), n = b × t

    Modifier stack: scale, mirror, array, solidify, displace, lattice, curve, shrinkwrap mesh/modifiers.js
    • ModelCraft
    64-bit
  • Curve modifier

    Bends the mesh along a curve: each vertex's coordinate on the chosen axis becomes a length along the curve.

    frame = F.at(q_k); p′ = frame.p − b·q_i1 + n·q_i2

    Modifier stack: scale, mirror, array, solidify, displace, lattice, curve, shrinkwrap mesh/modifiers.js
    • ModelCraft
    64-bit
  • Solidify

    Gives a surface thickness by making two copies moved along the vertex normals.

    o₁ = t·(offset + 1) ÷ 2, o₂ = t·(offset − 1) ÷ 2; p′ = p + N(v)·o

    Modifier stack: scale, mirror, array, solidify, displace, lattice, curve, shrinkwrap mesh/modifiers.js
    • ModelCraft
    64-bit
  • Displace noise

    A seeded smooth noise value between −1 and 1 at a point; the displace modifier multiplies it by the strength.

    value = 2 × trilinear blend of 8 lattice values, with smoothstep weights t²(3 − 2t), − 1

    Modifier stack: scale, mirror, array, solidify, displace, lattice, curve, shrinkwrap mesh/modifiers.js
    • ModelCraft
    64-bit
  • Lattice displacement

    The move of a point inside a cage whose boundary points were moved.

    u = (x − min_x) ÷ (max_x − min_x) (same for v, w); d = Σ faces − Σ edges + Σ corners (transfinite interpolation)

    Modifier stack: scale, mirror, array, solidify, displace, lattice, curve, shrinkwrap mesh/modifiers.js
    • ModelCraft
    64-bit
  • Closest point on a triangle

    The point of a triangle nearest a given point; used by shrinkwrap and by snapping onto a retopology target.

    vertex, edge or interior region chosen by the signs of six dot products; interior: a + ab·(v_b ÷ (v_a + v_b + v_c)) + ac·(v_c ÷ (v_a + v_b + v_c))

    Modifier stack: scale, mirror, array, solidify, displace, lattice, curve, shrinkwrap mesh/modifiers.js
    • ModelCraft
    64-bit
  • Nearest point on a triangle mesh

    Finds the nearest point of a target's triangles to a point, with its distance.

    r = size ÷ 64, doubled up to 30 times; best = min over triangles in the box p ± r of |closest − p|; accepted when best ≤ r

    Modifier stack: scale, mirror, array, solidify, displace, lattice, curve, shrinkwrap mesh/modifiers.js
    • ModelCraft
    64-bit
  • Grid

    A flat grid of nx by ny quads, size s, centered on the origin.

    p(i, j) = [(i ÷ nx − 0.5)·s, (j ÷ ny − 0.5)·s, 0]

    Mesh primitives mesh/primitives.js
    • ModelCraft
    64-bit
  • Cube

    A cube of side s standing on z = 0, centered in x and y.

    h = s ÷ 2; corners (±h, ±h, 0) and (±h, ±h, s)

    Mesh primitives mesh/primitives.js
    • ModelCraft
    64-bit
  • Cylinder and cone

    A ring of n points of radius r at z = 0, with a second ring at height h for a cylinder or one apex for a cone.

    a = 2π·i ÷ n; p = [r·cos a, r·sin a, 0 or h]; apex = [0, 0, h]

    Mesh primitives mesh/primitives.js
    • ModelCraft
    64-bit
  • UV sphere

    A sphere of radius r resting on z = 0, made of k rings of n points between two poles.

    θ = π·j ÷ k, φ = 2π·i ÷ n; p = [r·sin θ·cos φ, r·sin θ·sin φ, r − r·cos θ]

    Mesh primitives mesh/primitives.js
    • ModelCraft
    64-bit
  • Ico sphere

    A sphere of radius r resting on z = 0, from an icosahedron whose triangles are split into four a number of times.

    g = (1 + √5) ÷ 2; corners = unit(±1, ±g, 0) and its rotations; midpoint = unit((a + b) ÷ 2); p = unit point·r + [0, 0, r]

    Mesh primitives mesh/primitives.js
    • ModelCraft
    64-bit
  • Torus

    A torus of ring radius R and tube radius r resting on z = 0.

    a = 2π·i ÷ n, b = 2π·j ÷ k; w = R + r·cos b; p = [w·cos a, w·sin a, r + r·sin b]

    Mesh primitives mesh/primitives.js
    • ModelCraft
    64-bit
  • Rotation matrix

    The matrix that turns geometry by an angle about an axis through a point.

    R = c·I + s·[axis]ₓ + (1 − c)·axis·axisᵀ, c = cos(angle·π ÷ 180), s = sin(angle·π ÷ 180); t = p − R·p

    Node graph functions nodes/library.js
    • ModelCraft
    • PartCraft
    64-bit
  • Scale matrix

    The matrix that scales geometry by a factor about a center.

    p′ = f·p + c·(1 − f)

    Node graph functions nodes/library.js
    • ModelCraft
    • PartCraft
    64-bit
  • Applying a matrix to geometry

    Moves a point, a curve, a surface, a mesh or a list of them by a 4 × 4 matrix.

    Node graph functions nodes/library.js
    • ModelCraft
    • PartCraft
    64-bit
  • Divide, power and remainder

    The Divide, Power, Smaller, Larger and Remainder nodes.

    a ÷ b; aᵇ; remainder = a − b·floor(a ÷ b)

    Node graph functions nodes/library.js
    • ModelCraft
    • PartCraft
    64-bit
  • Sine, cosine, tangent and angle

    Trigonometry with angles in degrees.

    sin(x·π ÷ 180), cos(x·π ÷ 180), tan(x·π ÷ 180); angle = atan2(y, x) ÷ (π ÷ 180)

    Node graph functions nodes/library.js
    • ModelCraft
    • PartCraft
    64-bit
  • Series and range

    A list of evenly stepped numbers, by step or between two ends.

    series: start + k·step; range: start + (end − start)·k ÷ (n − 1)

    Node graph functions nodes/library.js
    • ModelCraft
    • PartCraft
    64-bit
  • Sum of a list

    Adds the numbers of a list.

    Σ xᵢ

    Node graph functions nodes/library.js
    • ModelCraft
    • PartCraft
    64-bit
  • Vector length and distance

    The length of a vector and the distance between two points.

    √(Δx² + Δy² + Δz²)

    Node graph functions nodes/library.js
    • ModelCraft
    • PartCraft
    64-bit
  • Point on a circle

    A point at a radius and an angle from a center, in the plane z = center z.

    [c_x + r·cos(a·π ÷ 180), c_y + r·sin(a·π ÷ 180), c_z]

    Node graph functions nodes/library.js
    • ModelCraft
    • PartCraft
    64-bit
  • Point on curve and divide curve

    A point at a fraction of a curve, and the points that divide a curve into a number of parts.

    u = u₀ + (u₁ − u₀)·t; divide: u = u₀ + (u₁ − u₀)·k ÷ n

    Node graph functions nodes/library.js
    • ModelCraft
    • PartCraft
    64-bit
  • Array around an axis

    Copies of geometry turned round an axis in equal steps of a full circle.

    copy k: rotate by 360·k ÷ n degrees

    Node graph functions nodes/library.js
    • ModelCraft
    • PartCraft
    64-bit
  • Surface to mesh

    A triangle mesh of a surface within a tolerance.

    Node graph functions nodes/library.js
    • ModelCraft
    • PartCraft
    64-bit
  • Point on a curve

    The point of a NURBS curve at parameter u.

    C(u) = Σ Nᵢ(u)·wᵢ·Pᵢ ÷ Σ Nᵢ(u)·wᵢ

    NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/curve.js
    • ModelCraft
    • PartCraft
    64-bit
  • Derivatives of a curve

    The point and the first d derivatives of a curve at u.

    C⁽ʳ⁾ = (A⁽ʳ⁾ − Σᵢ₌₁..ᵣ C(r, i)·w⁽ⁱ⁾·C⁽ʳ⁻ⁱ⁾) ÷ w

    NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/curve.js
    • ModelCraft
    • PartCraft
    64-bit
  • Curvature of a curve

    The curvature at u.

    κ = |C′ × C″| ÷ |C′|³

    NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/curve.js
    • ModelCraft
    • PartCraft
    64-bit
  • Curvature vector

    The vector that points to the center of curvature with length equal to the curvature.

    κN = (C″ − t·(C″·t)) ÷ |C′|², t = C′ ÷ |C′|

    NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/curve.js
    • ModelCraft
    • PartCraft
    64-bit
  • Torsion

    The torsion of a curve at u.

    τ = (C′ × C″)·C‴ ÷ |C′ × C″|²

    NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/curve.js
    • ModelCraft
    • PartCraft
    64-bit
  • From homogeneous points

    Turns weighted (homogeneous) control points back into control points and weights.

    P = (wx, wy, wz) ÷ w

    NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/curve.js
    • ModelCraft
    • PartCraft
    64-bit
  • Arc and circle

    A circular arc, or a full circle, as an exact rational quadratic curve.

    pieces of at most 90°; Δθ = θ ÷ pieces; middle weight = cos(Δθ ÷ 2); P₁ = P₀ + T₀·r·tan(Δθ ÷ 2)

    NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/curve.js
    • ModelCraft
    • PartCraft
    64-bit
  • Polyline as a curve

    A degree 1 curve through given points, with knots in proportion to the lengths of its segments.

    Lᵢ = Lᵢ₋₁ + max(1e-12, |Pᵢ − Pᵢ₋₁|); knotᵢ = Lᵢ ÷ L(last)

    NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/curve.js
    • ModelCraft
    • PartCraft
    64-bit
  • Transforming a curve

    Moves a curve by a 4 × 4 matrix.

    NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/curve.js
    • ModelCraft
    • 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.