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

  • Smooth minimum

    Blends two shapes with a radius k.

    h = clamp(½ + (b − a) ÷ 2k, 0, 1); s = b + (a − b)h − k·h(1 − h)

    Field shapes: signed distance functions field/field.js
    • PartCraft
    64-bit
  • Offset and shell

    Grows or shrinks a shape, or hollows it to a wall thickness.

    offset: d − δ; shell inward: max(d, −d − t); shell centered: |d| − t ÷ 2

    Field shapes: signed distance functions field/field.js
    • PartCraft
    64-bit
  • Move, turn and scale

    A shape under a rigid motion and a uniform scale.

    q = Rᵀ(p − move) ÷ s; d = d₀(q) × s

    Field shapes: signed distance functions field/field.js
    • PartCraft
    64-bit
  • Rotation matrix

    The 3 × 3 matrix of a turn about an axis by an angle.

    R = c·I + s·[u]ₓ + (1 − c)·u uᵀ, c = cos θ, s = sin θ

    Field shapes: signed distance functions field/field.js
    • PartCraft
    64-bit
  • Beam or round cone

    Signed distance to a beam whose radius changes from one end to the other.

    t = clamp((p − a)·(b − a) ÷ |b − a|², 0, 1); d = |p − a − t(b − a)| − (r₀ + (r₁ − r₀)t)

    Field shapes: signed distance functions field/field.js
    • PartCraft
    64-bit
  • Lattice of beams

    The least distance to many beams.

    Field shapes: signed distance functions field/field.js
    • PartCraft
    64-bit
  • Ramped cell size and wall

    A number that changes linearly along an axis or with radius.

    v = v₀ + (v₁ − v₀) × clamp((p − a) ÷ (b − a), 0, 1)

    Field shapes: signed distance functions field/field.js
    • PartCraft
    64-bit
  • Phase of a graded lattice

    Maps a point to the lattice's own period coordinates when the cell size changes.

    fixed cell: X = 2π·p ÷ cell; ramp: X = ∫k dp with k linear in p

    Field shapes: signed distance functions field/field.js
    • PartCraft
    64-bit
  • Gyroid, Schwarz P and diamond

    Signed distance to a triply periodic minimal surface, as a sheet or a network.

    d ≈ g ÷ |∇g|; near the surface: two projections q ← q − g∇g ÷ |∇g|², d = ±|p − q|

    Field shapes: signed distance functions field/field.js
    • PartCraft
    64-bit
  • Brick classification

    Decides whether a ball of space is wholly outside, wholly inside or near the surface.

    outside when f − L·r > band; inside when f + L·r < −band

    Field shapes: signed distance functions field/field.js
    • PartCraft
    64-bit
  • Bricks to compute

    Which bricks of the lattice can hold the surface.

    brick range = floor((box ∓ band × h) ÷ h ÷ 8); ball radius = 3.5√3 × h

    Distance grid: baking, sampling and volume field/bake.js
    • PartCraft
    64-bit
  • Node values of a brick

    The signed distance at each of a brick's 512 nodes.

    value = clamp(f(i·h, j·h, k·h), −band × h, band × h)

    Distance grid: baking, sampling and volume field/bake.js
    • PartCraft
    32-bit in part
  • Brick key

    One whole number that names a brick.

    key = ((bx + 65536) × 131072 + (by + 65536)) × 131072 + (bz + 65536)

    Distance grid: baking, sampling and volume field/grid.js
    • PartCraft
    Exact
  • Value at a point

    The signed distance at any point, between the lattice nodes.

    trilinear: a + (b − a) × t along x, then y, then z

    Distance grid: baking, sampling and volume field/grid.js
    • PartCraft
    32-bit in part
  • Gradient at a point

    The direction and rate of change of the distance.

    g = (f(p + h/2) − f(p − h/2)) ÷ h, per axis

    Distance grid: baking, sampling and volume field/grid.js
    • PartCraft
    32-bit in part
  • Box of the stored bricks

    The world box that holds every stored node.

    lo = brick × 8 × h; hi = (brick × 8 + 7) × h

    Distance grid: baking, sampling and volume field/grid.js
    • PartCraft
    64-bit
  • Enclosed volume

    The volume inside the surface.

    V = h³ × Σ clamp(½ − d ÷ h, 0, 1)

    Distance grid: baking, sampling and volume field/grid.js
    • PartCraft
    32-bit in part
  • Welding corners

    Merges mesh corners that sit at the same position.

    Distance grid: baking, sampling and volume field/mesh-sdf.js
    • PartCraft
    64-bit
  • Angle-weighted normals

    The pseudo-normal at each corner and edge, used for the sign.

    angle = acos(e₁·e₂ ÷ (|e₁||e₂|)); N_vertex = Σ angle × n_face

    Distance grid: baking, sampling and volume field/mesh-sdf.js
    • PartCraft
    64-bit
  • Signed distance at a node

    The distance from a lattice node to the mesh, negative inside.

    d = √(least squared distance); sign = sign((p − closest)·N)

    Distance grid: baking, sampling and volume field/mesh-sdf.js
    • PartCraft
    32-bit in part
  • Closest point on a triangle

    The nearest point of a triangle to a point, and which face, edge or corner it lies on.

    Distance grid: baking, sampling and volume field/mesh-sdf.js
    • PartCraft
    64-bit
  • Inside or outside far from the surface

    Marks bricks no triangle comes near as inside or outside.

    x_cross = (w₀a_x + w₁b_x + w₂c_x) ÷ (w₀ + w₁ + w₂); inside when an odd number of crossings lie before the brick

    Distance grid: baking, sampling and volume field/mesh-sdf.js
    • PartCraft
    64-bit
  • Density map as stored

    Keeps a density map that steers a wall thickness or cell size.

    Distance grid: baking, sampling and volume field/field.js
    • PartCraft
    32-bit in part
  • Number that follows a density map

    The wall thickness or cell size at a point, from the density map.

    v = v₀ + (v₁ − v₀) × density(p), density by trilinear interpolation between cell centers

    Distance grid: baking, sampling and volume field/field.js
    • PartCraft
    32-bit in part
  • Edge crossing and its normal

    Where the surface crosses a cell edge, and the surface direction there.

    t = vᵢ ÷ (vᵢ − vₒ); p = p_in + (p_out − p_in) × t

    Surface mesh from a distance grid (dual contouring) field/contour.js
    • PartCraft
    32-bit in part
  • Vertex of a surface cell

    The point that best fits the crossing planes of one cell.

    (AᵀA + λI)y = Aᵀb, x = m + y, λ = 0.1

    Surface mesh from a distance grid (dual contouring) field/contour.js
    • PartCraft
    64-bit
  • Gradient inside a cell

    The gradient of the interpolated distance inside one cell.

    Surface mesh from a distance grid (dual contouring) field/contour.js
    • PartCraft
    64-bit
  • Which diagonal splits a quad

    Chooses how each four-sided face becomes two triangles.

    use diagonal 0–2 when |p₀ − p₂|² ≤ |p₁ − p₃|²

    Surface mesh from a distance grid (dual contouring) field/contour.js
    • PartCraft
    64-bit
  • Positions and box as returned

    The mesh's corner positions and its bounding box.

    Surface mesh from a distance grid (dual contouring) field/contour.js
    • PartCraft
    32-bit in part
  • Mesh volume

    The signed volume enclosed by a triangle mesh.

    V = Σ a·(b × c) ÷ 6

    Mesh volume, area and watertightness checks field/measure.js
    • PartCraft
    64-bit
  • Mesh area

    The total area of a triangle mesh.

    A = Σ |(b − a) × (c − a)| ÷ 2

    Mesh volume, area and watertightness checks field/measure.js
    • PartCraft
    64-bit
  • Closed and manifold checks

    Counts open, non-manifold and flipped edges, bad vertices, pieces and the Euler number.

    Euler number = vertices used − edges + triangles

    Mesh volume, area and watertightness checks field/measure.js
    • PartCraft
    Exact
  • Number format of the text exports

    How a number is written into the 3MF and VTI text.

    Generated part exports: data sheet, VTK, 3MF and OpenVDB field/export.js
    • PartCraft
    64-bit
  • Values on the PDF data sheet

    How each value is printed on the data sheet's PDF.

    Generated part exports: data sheet, VTK, 3MF and OpenVDB field/export.js
    • PartCraft
    64-bit
  • Field as VTK ImageData

    The signed distance and an inside mask on the node lattice.

    origin = lowest index × h; spacing = h; inside = value < 0

    Generated part exports: data sheet, VTK, 3MF and OpenVDB field/export.js
    • PartCraft
    32-bit in part
  • Surface as VTK UnstructuredGrid

    The surface triangles with each triangle's area and unit normal.

    n = (b − a) × (c − a); area = |n| ÷ 2; normal = n ÷ |n|

    Generated part exports: data sheet, VTK, 3MF and OpenVDB field/export.js
    • PartCraft
    32-bit in part
  • 3MF vertices

    The mesh corners as text in the 3MF model, in millimeters.

    Generated part exports: data sheet, VTK, 3MF and OpenVDB field/export.js
    • PartCraft
    64-bit
  • OpenVDB leaves and active voxels

    Maps the grid's bricks onto OpenVDB leaves and marks the narrow band active.

    background = fround(band × h); active when −background < value < background

    Generated part exports: data sheet, VTK, 3MF and OpenVDB field/vdb.js
    • PartCraft
    32-bit in part
  • OpenVDB value compression

    Chooses how a node's inactive values are stored and writes the values.

    Generated part exports: data sheet, VTK, 3MF and OpenVDB field/vdb.js
    • PartCraft
    32-bit in part
  • OpenVDB voxel size

    The transform from lattice index to millimeters.

    scale = h; also 1 ÷ h, 1 ÷ h² and 1 ÷ (2h)

    Generated part exports: data sheet, VTK, 3MF and OpenVDB field/vdb.js
    • PartCraft
    64-bit
  • Distance transform along one row

    The squared distance to the nearest empty voxel along one row.

    s = ((f[q] + q²) − (f[p] + p²)) ÷ (2q − 2p); d[q] = (q − v)² + f[v]

    Printability checks on a voxel solid field/mfg.js
    • PartCraft
    64-bit
  • Squared distance transform

    For each voxel in a set, the squared distance in voxels to the nearest voxel outside it.

    Printability checks on a voxel solid field/mfg.js
    • PartCraft
    32-bit in part
  • Connected pieces

    Labels each connected piece and counts its voxels.

    Printability checks on a voxel solid field/mfg.js
    • PartCraft
    Exact
  • Thin regions

    The parts of a solid (or of the empty space) thinner than a limit, with each one's thickness.

    dk = (max(1, t − 1) + 1) ÷ 2; thickness = max(1, 2√(largest d²) − 0.5) voxels

    Printability checks on a voxel solid field/mfg.js
    • PartCraft
    32-bit in part
  • Loose pieces and sealed cavities

    The volume and position of each loose piece and each sealed cavity.

    volume = voxel count × h³; position = origin + (mean index − pad + ½) × h

    Printability checks on a voxel solid field/mfg.js
    • PartCraft
    64-bit
  • Thin wall and gap sizes in millimeters

    The thickness and volume of each thin wall and narrow gap.

    thickness = thickness in voxels × h; volume = voxel count × h³

    Printability checks on a voxel solid field/mfg.js
    • PartCraft
    32-bit in part
  • Rounding in the problem list

    Rounds sizes, volumes and positions for the problem list.

    Printability checks on a voxel solid field/mfg.js
    • PartCraft
    64-bit
  • Overhang area

    The downward-facing area steeper than a process prints without support.

    counts when −n_z ÷ |n| > sin(angle) + 1e-9; share = overhang area ÷ total area

    Printability checks on a voxel solid field/mfg.js
    • PartCraft
    64-bit
  • Plane of a curve

    The normal of the plane a hull line lies in.

    n = (p_mid − p₀) × (p_end − p₀), made unit

    Hull lines: fairness measures and fairing hull/fair.js
    • PartCraft
    64-bit
  • Signed curvature

    The curvature of a curve at a parameter, signed in its plane.

    κ = (C′ × C″)·n ÷ |C′|³

    Hull lines: fairness measures and fairing hull/fair.js
    • 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.