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

  • Surface mesh buffers

    The positions, normals, parameters and colors of a surface's triangles, for drawing.

    Drawing NURBS curves and surfaces nurbs-ui/display.js
    • ModelCraft
    • PartCraft
    32-bit, display only
  • Strength of connection between nodes

    Decides which neighboring nodes are strongly coupled, from the Frobenius norms of their stiffness blocks.

    strong when ‖A_IJ‖ > θ × √(‖A_II‖ × ‖A_JJ‖), θ = 0.08

    Multigrid preconditioner for stress analysis amg.js
    • PartCraft
    64-bit
  • Tentative prolongator by QR per aggregate

    Orthonormalizes the near-null vectors (the rigid motions) restricted to each aggregate to form the columns of the prolongator.

    q_j ← b_j − Σᵢ (qᵢ·b_j) qᵢ (twice); keep when ‖q_j‖ > 1e-10 × scale × √m

    Multigrid preconditioner for stress analysis amg.js
    • PartCraft
    64-bit
  • Largest eigenvalue of D⁻¹A

    Estimates the largest eigenvalue used to set the prolongator smoothing weight.

    λ ≈ 1.05 × ‖D⁻¹A x‖ ÷ ‖x‖ after 15 power iterations

    Multigrid preconditioner for stress analysis amg.js
    • PartCraft
    64-bit
  • Prolongator smoothing

    Applies one damped Jacobi step to the tentative prolongator.

    P = P̂ − ω D⁻¹ A P̂, ω = 4 ÷ (3 λmax)

    Multigrid preconditioner for stress analysis amg.js
    • PartCraft
    64-bit
  • Sparse matrix product

    Multiplies two sparse matrices, used for A·P and Pᵀ·(A·P).

    C_ij = Σ_r A_ir × B_rj

    Multigrid preconditioner for stress analysis amg.js
    • PartCraft
    64-bit
  • Dense Cholesky on the coarsest level

    Factors the coarsest matrix and solves with it by forward and back substitution.

    L Lᵀ = A_c; pivot = √s when s > 1e-12 × max diag, else √(1e-12 × max diag + |s|)

    Multigrid preconditioner for stress analysis amg.js
    • PartCraft
    64-bit
  • Gauss–Seidel sweep

    One forward or backward relaxation sweep, the smoother of the V-cycle.

    x_r = (b_r − Σ_{c≠r} A_rc x_c) ÷ A_rr

    Multigrid preconditioner for stress analysis amg.js
    • PartCraft
    64-bit
  • V-cycle

    Applies the preconditioner: smooth, restrict the residual, solve the coarse problem, add the correction, smooth again.

    x ← S(b); r = b − A x; x ← x + P × cycle(Pᵀ r); x ← Sᵀ(b)

    Multigrid preconditioner for stress analysis amg.js
    • PartCraft
    64-bit
  • Draft angle

    The angle between a surface normal and the plane square to the pull direction, in degrees.

    angle = asin(clamp(n · pull, −1, 1)) × 180 ÷ π

    Draft and curvature analysis analysis.js
    • PartCraft
    64-bit
  • Areas by draft class

    The surface area with enough draft, with too little, and facing away from the pull.

    area = |(B − A) × (C − A)| ÷ 2; each corner adds area ÷ 3 to its class

    Draft and curvature analysis analysis.js
    • PartCraft
    32-bit in part
  • Curvature color limit

    The curvature value (1/mm) at which the colors reach full blue or red, stated in the panel with its radius.

    lim = 95th percentile of |mean curvature|; color weight = clamp(mean ÷ lim, −1, 1)

    Draft and curvature analysis analysis.js
    • PartCraft
    32-bit in part
  • View scale and position on the sheet

    Picks the drawing scale and maps view coordinates to sheet millimeters.

    scale = first s with w × s ≤ 0.78 × frame width and h × s ≤ 0.78 × frame height; sheet = origin + (u − u₀) × scale

    Assembly drawing sheet and mesh exports asm-drawing.js
    • PartCraft
    64-bit
  • Mass text in the bill of materials

    Formats a part's mass for the drawing's parts table.

    g ≥ 1000: kg with 3 decimals; else g with 2 decimals

    Assembly drawing sheet and mesh exports asm-drawing.js
    • PartCraft
    64-bit
  • Assembly as one mesh

    Moves every part's mesh to its place in the assembly and joins them, for STL export and the 3D-printing check.

    p′ = M × p for each vertex

    Assembly drawing sheet and mesh exports asm-drawing.js
    • PartCraft
    32-bit in part
  • Numbers written to 3MF

    Turns a coordinate or a matrix entry into the text stored in the 3MF file.

    text = toPrecision(9) of v; |v| < 1e-12 → 0

    Assembly drawing sheet and mesh exports asm-drawing.js
    • PartCraft
    64-bit
  • Instance placement in 3MF

    Converts each instance's placement from Y-up to Z-up and writes it as the item transform.

    T = Y_TO_Z × M × Z_TO_Y; 12 entries written row by row

    Assembly drawing sheet and mesh exports asm-drawing.js
    • PartCraft
    64-bit
  • Inverse of a rigid transform

    Inverts a rotation-plus-translation matrix.

    R⁻¹ = Rᵀ; t⁻¹ = −Rᵀ t

    Assembly joints and part placement assembly.js
    • PartCraft
    64-bit
  • Mate frame on a face

    The frame a joint end uses: the face's axes, with the origin moved to where the chosen axis crosses the face.

    o = a + d × ((f − a) · n) ÷ (d · n)

    Assembly joints and part placement assembly.js
    • PartCraft
    64-bit
  • Joint value inside its limits

    A joint's angle or distance, held between its minimum and maximum.

    value = min(max, max(min, v))

    Assembly joints and part placement assembly.js
    • PartCraft
    64-bit
  • Motion of a joint

    The transform of part B relative to part A's mate frame, from the joint's angles and distances.

    revolute, slider, cylindrical, rigid: T(0, 0, offset) × Rz(angle); planar: T(dx, dy, 0) × Rz; ball: Rx(tiltX) × Ry(tiltY) × Rz; pin-slot: T(s cos δ, s sin δ, 0) × Rz

    Assembly joints and part placement assembly.js
    • PartCraft
    64-bit
  • Placement walk and loop mismatch

    Places each part from one already placed through their joint, and measures how far a loop-closing joint is from closing.

    W_B = W_A × F_A × motion × FLIP × F_B⁻¹; off = max |want − have| (rotation entries × 100)

    Assembly joints and part placement assembly.js
    • PartCraft
    64-bit
  • Storing solved joint values

    Writes the values that close the loops into the joints, which is what the file saves.

    stored = round(v × 1e9) ÷ 1e9

    Assembly joints and part placement assembly.js
    • PartCraft
    64-bit
  • Moving a free part by hand

    Applies a typed move or rotation to a part's stored placement.

    M′ = T(move) × R(about, axis, angle) × M

    Assembly joints and part placement assembly.js
    • PartCraft
    64-bit
  • Rotation matrix to rotation vector

    Turns the rotation part of a mismatch into an axis times an angle in radians.

    θ = acos(clamp((trace − 1) ÷ 2, −1, 1)); w = (R − Rᵀ)ᵛ × θ ÷ (2 sin θ)

    Closed-loop joint solver assembly.js
    • PartCraft
    64-bit
  • Loop residuals

    For each loop-closing joint, how far its B end is from where the loop puts it.

    D = have⁻¹ × want; r = (D_x, D_y, D_z, w_x L, w_y L, w_z L)

    Closed-loop joint solver assembly.js
    • PartCraft
    64-bit
  • Jacobian by central differences

    The rate of change of every residual with every unknown joint value.

    J_qc = (r_q(x + h e_c) − r_q(x − h e_c)) ÷ 2h, h = 1e-6 × max(1, L)

    Closed-loop joint solver assembly.js
    • PartCraft
    64-bit
  • Damped least-norm Newton step

    Moves the joint values toward closing the loops while changing them as little as possible.

    dx = Jᵀ (J Jᵀ + μ D)⁻¹ (−r); accept x + α dx when Σr² falls, α = 1, ½, ¼ …

    Closed-loop joint solver assembly.js
    • PartCraft
    64-bit
  • Angle on the nearest turn

    Returns each solved angle on the turn closest to where it started, inside its limits.

    w = s₀ + ((val − s₀ + 180) mod 360) − 180

    Closed-loop joint solver assembly.js
    • PartCraft
    64-bit
  • Rank, mobility and conflicts

    Counts the independent conditions at the answer, how many values could still be set, and which loops did not close.

    mobility = unknowns − rank; conflict when max |r| of a loop > max(1000 × tol, 1e-6)

    Closed-loop joint solver assembly.js
    • PartCraft
    64-bit
  • Overlap volume of a pair

    The common volume of two placed parts and whether it counts as a clash.

    v = volume(A ∩ B); clash when v > 1e-6

    Interference between assembly parts assembly.js
    • PartCraft
    32-bit in part
  • Thread zones

    Tubes around each cosmetic thread, used to tell a bolt in a tapped hole from a real clash.

    r₀ = 0.97 × minor (default 0.8 × major); r₁ = 1.03 × major + 0.001; length = depth + 2 × max(0.05 × major, 0.001)

    Interference between assembly parts assembly.js
    • PartCraft
    64-bit
  • Motion check steps

    Steps one joint value from a start to an end and reports interference at each step.

    value_s = from + (to − from) × s ÷ steps, s = 0 … steps

    Interference between assembly parts assembly.js
    • PartCraft
    64-bit
  • Scale about a point

    The matrix that scales a body by three factors about a fixed point.

    p′ = c + diag(sx, sy, sz) × (p − c); translation = c × (1 − s)

    Body move, scale and path pattern arithmetic bodies.js
    • PartCraft
    64-bit
  • Smallest rotation between two directions

    The rotation that turns one unit direction onto another by the smallest angle.

    k = (a × b) ÷ |a × b|; θ = atan2(|a × b|, a · b)

    Body move, scale and path pattern arithmetic bodies.js
    • PartCraft
    64-bit
  • Rotation about an axis

    The 3 × 3 rotation about a unit axis by an angle in radians.

    R = cos θ I + sin θ [k]× + (1 − cos θ) k kᵀ

    Body move, scale and path pattern arithmetic bodies.js
    • PartCraft
    64-bit
  • Rigid motion about a point

    The 4 × 4 matrix of a rotation about a point followed by a translation.

    p′ = R (p − c) + c + t; offset = c − R c + t

    Body move, scale and path pattern arithmetic bodies.js
    • PartCraft
    64-bit
  • Pattern stations along a path

    The arc length at which each copy of a path pattern sits.

    equal: step = L ÷ count (closed) or room ÷ (count − 1) (open); s_i = s₀ ± step × i, wrapped into [0, L) on a closed path

    Body move, scale and path pattern arithmetic bodies.js
    • PartCraft
    64-bit
  • Nearest point on an edge

    The point of an edge closest to a given point, with the tangent there.

    circle: p = c + r × unit(radial part of (q − c)); other curves: minimize |C(t) − q|²

    Reference geometry, sweep paths and extrude extents brep-design.js
    • PartCraft
    64-bit
  • Midpoint of an edge by length

    The point half way along an edge measured along the curve.

    length = Σ over 32 pieces of Σ₈ wᵢ |C′(tᵢ)| × h; bisect for length(t) = total ÷ 2

    Reference geometry, sweep paths and extrude extents brep-design.js
    • PartCraft
    64-bit
  • Where an edge crosses a plane

    The points at which an edge passes through a plane.

    g(t) = (C(t) − o) · n; bisect each sign change of g between 400 samples

    Reference geometry, sweep paths and extrude extents brep-design.js
    • PartCraft
    64-bit
  • Arc of a sweep path

    Turns a sketch arc into the three points OpenCascade builds the path arc from.

    r = |s − c|; mid = c + r × (cos, sin)((a₀ + a₁) ÷ 2), a₁ raised by 2π when a₁ ≤ a₀

    Reference geometry, sweep paths and extrude extents brep-design.js
    • PartCraft
    64-bit
  • Chaining path pieces

    Decides which curve ends meet when pieces are joined into one path.

    same when |p − q| ≤ 1e-6 × max(1, largest |end point|)

    Reference geometry, sweep paths and extrude extents brep-design.js
    • PartCraft
    64-bit
  • Sweep profile at the path's end

    Checks that the profile's plane passes through one end of the path, and which end.

    |(p − o) · n| ≤ 1e-6 × max(1, |path chord|)

    Reference geometry, sweep paths and extrude extents brep-design.js
    • PartCraft
    64-bit
  • Extrude up to a face

    How far along the extrude direction each profile point is from the target plane.

    t = ((o − x) · n) ÷ (u · n); parallel target: depth = min t; otherwise depth = 1.02 × max t + 1, then cut back by the plane

    Reference geometry, sweep paths and extrude extents brep-design.js
    • PartCraft
    64-bit
  • Through, offset and vertex extents

    The extrude depth for through-all cuts, an offset from a face, and up to a vertex.

    through: far + 1 + 0.01 × body range; offset: o = face − n × side × offset; vertex: b = (p − o) · u

    Reference geometry, sweep paths and extrude extents brep-design.js
    • PartCraft
    64-bit
  • Picking the next face

    Chooses the first face of the body that the extrude meets.

    nearest face by its lowest vertex distance along u, ties (within 1e-7 × scale) by centroid distance

    Reference geometry, sweep paths and extrude extents brep-design.js
    • PartCraft
    64-bit
  • Points along a projected edge

    Turns one edge of a view into the points its line segments join.

    circle: n = max(8, ceil(|t₁ − t₀| ÷ (π ÷ 60))); other curves: n = 96; drop a sample within 1e-7 × size of the chord

    Drawing views of the exact solid brep-draw.js
    • PartCraft
    64-bit
  • Extent of a view

    The smallest box around a view's segments, used to place and scale it.

    u₀ = min, u₁ = max over segment ends (same for v)

    Drawing views of the exact solid brep-draw.js
    • PartCraft
    64-bit
  • Section plane position

    Places the cutting plane square to a view's direction and builds the box that removes the near half.

    o = center − d (center · d) + d × at; box side = 2 × (2 × diagonal + 10)

    Drawing views of the exact solid brep-draw.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.