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

  • Proportional editing weights

    For every vertex, how much of the selected vertices' move it follows: 1 for the selected ones, falling to 0 at the radius.

    t = distance ÷ radius; smooth: x²(3 − 2x) with x = 1 − t; sphere: √(1 − t²); root: √x; linear: x; sharp: x²; constant: 1

    Proportional editing weights and edge creases mesh/ops.js
    • ModelCraft
    32-bit in part
  • Set a crease

    Stores the crease (0 smooth to 1 sharp) on each listed edge for subdivision.

    v = clamp(value, 0, 1)

    Proportional editing weights and edge creases mesh/ops.js
    • ModelCraft
    32-bit in part
  • Crease shared by edges

    The crease the selected edges have in common, shown as the starting value when a crease is edited.

    Proportional editing weights and edge creases mesh/ops.js
    • ModelCraft
    32-bit in part
  • Applying a move with proportional weights

    Writes each affected vertex's new position while a grab, rotate or scale is in progress.

    q = T(p); r = p + (q − p)·w; stored position = M⁻¹·r

    Proportional editing weights and edge creases mesh/edit-tool.js
    • ModelCraft
    32-bit in part
  • Crease from the pointer or the wheel

    Turns the pointer's distance from the selection's center, or a wheel step, into a crease between 0 and 1.

    pointer: crease = clamp(round(px ÷ 2) ÷ 100, 0, 1); wheel: crease = clamp(round((crease ± 0.1) × 10) ÷ 10, 0, 1)

    Proportional editing weights and edge creases mesh/edit-tool.js
    • ModelCraft
    32-bit in part
  • 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
  • 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
  • Vertex quadrics

    Adds each triangle's plane to the error quadric of its three vertices.

    n = unit((b − a) × (c − a)), d = −n·a; Q(v) += [a², ab, ac, ad, b², bc, bd, c², cd, d²]

    Decimate modifier mesh/modifiers.js
    • ModelCraft
    64-bit
  • Border planes

    Adds a plane square to the face through each open border edge, so borders stay in place.

    n = unit((B − A) × face normal), d = −n·A; added four times with n and d multiplied by 10

    Decimate modifier mesh/modifiers.js
    • ModelCraft
    64-bit
  • Collapse cost

    The error of collapsing an edge to its midpoint.

    p = (P_a + P_b) ÷ 2; e = pᵀ·(Q_a + Q_b)·p = q₀x² + 2q₁xy + 2q₂xz + 2q₃x + q₄y² + 2q₅yz + 2q₆y + q₇z² + 2q₈z + q₉

    Decimate modifier mesh/modifiers.js
    • ModelCraft
    64-bit
  • Collapse test

    Decides whether the cheapest edge is collapsed now, put back with a new cost, or skipped.

    put back when e > e₀·(1 + 1e-9) + 1e-18; skip when (new normal)·(old normal) ≤ 0 for any triangle that stays

    Decimate modifier mesh/modifiers.js
    • ModelCraft
    64-bit
  • Boolean of two meshes

    Runs the union, intersection or difference and copies the result's vertex positions.

    Boolean modifier mesh/modifiers.js
    • ModelCraft
    32-bit in part
  • Mesh from triangles

    Builds a mesh from triangle positions and indices, welds coincident vertices and marks sharp edges; used after a boolean and after decimate.

    weld within 1e-9; sharp when n₁·n₂ < cos(30°)

    Boolean modifier 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
  • Squared distance to a triangle

    The squared distance from a point to the nearest point of a triangle.

    q = nearest point by region (vertex, edge or interior); d² = |p − q|²

    Voxel remesh and snapping onto a surface mesh/remesh.js
    • ModelCraft
    64-bit
  • Distance samples near the surface

    For every grid point within two voxels of a triangle, the distance to the nearest triangle.

    g = voxel ÷ 2; d(i, j, k) = √(min over triangles of d²), capped at 2·voxel

    Voxel remesh and snapping onto a surface mesh/remesh.js
    • ModelCraft
    32-bit in part
  • Inside or outside

    Marks each grid point as inside or outside the mesh by counting the faces a ray along +x crosses.

    crossing when w₀, w₁, w₂ share a sign; x = (w₀·x_A + w₁·x_B + w₂·x_C) ÷ (w₀ + w₁ + w₂); inside when the winding count before x is above 0

    Voxel remesh and snapping onto a surface mesh/remesh.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.