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

  • Backslash for dense matrices

    Solves A x = b, or the least-squares problem when A is not square.

    CraftScript array arithmetic cs-tensor.js
    • PartCraft
    64-bit
  • Number of elements in a range

    How many values a:s:b has.

    n = ⌊(b − a) ÷ s + max(3ε × max(|a|, |b|) ÷ |s|, 1e-10)⌋ + 1

    CraftScript array arithmetic cs-tensor.js
    • PartCraft
    64-bit
  • Values of a range

    The values a, a + s, a + 2s … up to b.

    x_k = a + k × s

    CraftScript array arithmetic cs-tensor.js
    • PartCraft
    64-bit
  • Sum, product, mean, maximum and minimum

    Reduces an array along one dimension.

    mean = (Σ xₖ) ÷ n

    CraftScript array arithmetic cs-tensor.js
    • PartCraft
    64-bit
  • Unit factors

    The factors that turn the given force, length and torque units into newtons, millimeters and newton millimeters.

    Design-it sizing and hand checks design-it.js
    • PartCraft
    64-bit
  • Arguments to working units

    Converts the given force, lengths and torque to N, mm and N·mm.

    value × unit factor

    Design-it sizing and hand checks design-it.js
    • PartCraft
    64-bit
  • Rounding to stock sizes and to reported decimals

    Rounds a thickness up to a stock plate or a 0.5 mm step, and rounds reported values.

    r2(v) = round(100 v) ÷ 100; r3(v) = round(1000 v) ÷ 1000

    Design-it sizing and hand checks design-it.js
    • PartCraft
    64-bit
  • Bolt positions in the flange

    The heights of the two bolts and the flange height.

    y_b = t + 1.5 × hole; spacing = clamp(round(a ÷ 10) × 5, 30, 100); H = y_t + 1.5 × hole

    Design-it sizing and hand checks design-it.js
    • PartCraft
    64-bit
  • Bracket checks

    Bending and shear stress, tip deflection and bolt loads of the bracket, each with its limit and safety factor.

    σ = 6 F a ÷ (b t²); τ = 1.5 F ÷ (b t); δ = F a³ ÷ (3 E I), I = b t³ ÷ 12; T = M y₂ ÷ (y₁² + y₂²); (T ÷ T_all)² + (V ÷ V_all)² ≤ 1

    Design-it sizing and hand checks design-it.js
    • PartCraft
    64-bit
  • Bracket sizing, volume and mass

    The thickness for strength and for the deflection limit, the bolt size, and the bracket's volume and mass.

    t = √(6 M ÷ (b σ_allow)); t = ∛(4 F a³ ÷ (E b δ)); V = b (L t + (H − t) t) − 2 (π ÷ 4) hole² t; mass = V × density × 1e-6

    Design-it sizing and hand checks design-it.js
    • PartCraft
    64-bit
  • Shaft checks

    Von Mises stress, torsional shear and twist of a round shaft.

    σ' = 32 ÷ (π d³) × √(M² + ¾T²); τ = 16 T ÷ (π d³); θ = T L ÷ (G J), G = E ÷ (2(1 + ν)), J = π d⁴ ÷ 32

    Design-it sizing and hand checks design-it.js
    • PartCraft
    64-bit
  • Shaft sizing, volume and mass

    The required diameter, the standard size above it, and the shaft's volume and mass.

    d = ∛(32 SF √(M² + ¾T²) ÷ (π S_y)); V = (π ÷ 4) d² L

    Design-it sizing and hand checks design-it.js
    • PartCraft
    64-bit
  • The built part

    Sketches and extrudes the sized bracket or shaft as part features.

    density (g/cm³) = density (kg/m³) ÷ 1000

    Design-it sizing and hand checks design-it.js
    • PartCraft
    64-bit
  • Edges and facet normals

    Finds the mesh's edges, each facet's unit normal, and which edges are sharp.

    sharp when n₁ · n₂ < cos 20°

    Drawing sheet views, dimensions and PDF drawing.js
    • PartCraft
    64-bit
  • One projected view with hidden lines

    Projects the mesh onto a view plane, finds the view's extents, and splits each drawn edge into visible and hidden parts.

    (u, v, w) = (p · right, p · up, p · dir)

    Drawing sheet views, dimensions and PDF drawing.js
    • PartCraft
    64-bit
  • Merging collinear segments

    Joins touching or overlapping segments on the same line and removes hidden lines under visible ones.

    Drawing sheet views, dimensions and PDF drawing.js
    • PartCraft
    64-bit
  • Section hatching

    Hatch lines at an angle inside the cut outline.

    Drawing sheet views, dimensions and PDF drawing.js
    • PartCraft
    64-bit
  • Clip to the detail circle

    Keeps the parts of segments inside the detail view's circle.

    A t² + B t + C = 0; t = (−B ± √(B² − 4AC)) ÷ 2A

    Drawing sheet views, dimensions and PDF drawing.js
    • PartCraft
    64-bit
  • Holes for the hole table

    Collects each hole's axis, diameter and callout from the kernel's cylindrical faces.

    diameter = 2 × smallest radius on the axis

    Drawing sheet views, dimensions and PDF drawing.js
    • PartCraft
    64-bit
  • Hole table rows

    The X and Y of each hole measured from the view's lower-left corner, and its tag.

    x = o · right − u₀; y = o · up − v₀

    Drawing sheet views, dimensions and PDF drawing.js
    • PartCraft
    64-bit
  • Sheet scale

    Picks the drawing scale for a paper size.

    first s in the ISO 5455 series with width × s ≤ 0.82 × area width and height × s ≤ 0.82 × area height

    Drawing sheet views, dimensions and PDF drawing.js
    • PartCraft
    Exact
  • Dimension text

    The text of an overall dimension or a hole table position.

    text = value rounded to 2 decimals

    Drawing sheet views, dimensions and PDF drawing.js
    • PartCraft
    64-bit
  • Overall dimensions

    The width and height on the front view and the depth on the top view.

    width = u₁ − u₀; height = v₁ − v₀

    Drawing sheet views, dimensions and PDF drawing.js
    • PartCraft
    64-bit
  • Numbers in the PDF

    Writes one coordinate or size into the PDF content.

    Drawing sheet views, dimensions and PDF drawing.js
    • PartCraft
    64-bit
  • PDF page content

    Writes the sheet's lines, fills and texts in millimeters under a millimeter to point transform.

    1 mm = 72 ÷ 25.4 pt

    Drawing sheet views, dimensions and PDF drawing.js
    • PartCraft
    64-bit
  • Section of a faceted mesh

    The section view's visible lines, cut outline, extents and the cutting plane's trace.

    Drawing section view of a faceted part drawing.js
    • PartCraft
    32-bit in part
  • Binary STL

    Writes each triangle's unit normal and three corners.

    n = (v₁ − v₀) × (v₂ − v₀) ÷ |(v₁ − v₀) × (v₂ − v₀)|

    Part export to STL, 3MF, DXF and STEP export.js
    • PartCraft
    64-bit
  • Numbers in a 3MF file

    Writes one vertex coordinate as text.

    Part export to STL, 3MF, DXF and STEP export.js
    • PartCraft
    64-bit
  • 3MF model

    Writes the mesh's vertices and triangles as a 3MF package in millimeters.

    Part export to STL, 3MF, DXF and STEP export.js
    • PartCraft
    64-bit
  • Numbers in a DXF file

    Writes one coordinate, radius or angle as text.

    Part export to STL, 3MF, DXF and STEP export.js
    • PartCraft
    64-bit
  • Sketch to DXF

    Writes a sketch's lines, circles, arcs, splines and points as DXF R12 entities.

    angle in degrees = radians × 180 ÷ π, reduced to [0, 360)

    Part export to STL, 3MF, DXF and STEP export.js
    • PartCraft
    64-bit
  • Flat pattern to DXF

    Writes a sheet metal flat pattern's outline, bend lines and bend notes.

    Part export to STL, 3MF, DXF and STEP export.js
    • PartCraft
    64-bit
  • Numbers in a STEP file

    Writes one real number in STEP's exponent form.

    Part export to STL, 3MF, DXF and STEP export.js
    • PartCraft
    64-bit
  • Outer loop of a planar STEP face

    Picks the outer boundary of a planar face as the loop with the largest signed area.

    area = ½ n · Σ pᵢ × pᵢ₊₁

    Part export to STL, 3MF, DXF and STEP export.js
    • PartCraft
    64-bit
  • Plane placement of a STEP face

    The x direction of the plane a planar face lies on.

    x = (e − (e · n) n) ÷ |e − (e · n) n|, e = (1,0,0) unless |n_x| ≥ 0.9, then (0,1,0)

    Part export to STL, 3MF, DXF and STEP export.js
    • PartCraft
    64-bit
  • Triangle normal

    The unit normal of one triangle and twice its area.

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

    Planar faces of a mesh faces.js
    • PartCraft
    64-bit
  • Coplanar triangle groups

    Joins triangles that share an edge and lie in one plane.

    n₁ · n₂ > 1 − 1e-5 and |d₁ − d₂| < 1e-5 × max(1, max |coordinate|)

    Planar faces of a mesh faces.js
    • PartCraft
    64-bit
  • Groups from the kernel's faces

    Uses the kernel's own face of each triangle as the group.

    Planar faces of a mesh faces.js
    • PartCraft
    64-bit
  • Face outline and area in its plane

    The outline loops of a planar face in two dimensions and the face's area.

    area = ½ Σ (x_j y_i − x_i y_j)

    Planar faces of a mesh faces.js
    • PartCraft
    64-bit
  • Dropping collinear outline vertices

    Removes outline vertices that lie on a straight run.

    |u × v| ÷ (|u| |v|) < 1e-6 and u · v > 0

    Planar faces of a mesh faces.js
    • PartCraft
    64-bit
  • Elastic matrix

    The 6 × 6 isotropic stress-strain matrix for a unit modulus.

    λ = ν ÷ ((1 + ν)(1 − 2ν)); μ = 1 ÷ (2(1 + ν)); D_ii = λ + 2μ, D_ij = λ, shear = μ

    Voxel stress analysis: elements, loads, reactions and modes fea.js
    • PartCraft
    64-bit
  • Hexahedron stiffness and stress operators

    The 24 × 24 stiffness of a unit cube and the operators that give stress at its corners and center.

    K = Σ_gauss Bᵀ D B × ⅛; K_e = K_cc − K_ci K_ii⁻¹ K_ic; σ = (E ÷ h) S u

    Voxel stress analysis: elements, loads, reactions and modes fea.js
    • PartCraft
    64-bit
  • Small dense solve

    Solves a small system by Gaussian elimination with row exchanges.

    Voxel stress analysis: elements, loads, reactions and modes fea.js
    • PartCraft
    64-bit
  • Stiffness times displacement

    Applies the whole model's stiffness to a vector, element by element.

    y = Σ_e s_e × K_e x_e, s_e = E h × scale_e

    Voxel stress analysis: elements, loads, reactions and modes fea.js
    • PartCraft
    64-bit
  • Node-block preconditioner

    Inverts each node's 3 × 3 diagonal block of the stiffness.

    A⁻¹ = adj(A) ÷ det(A)

    Voxel stress analysis: elements, loads, reactions and modes fea.js
    • PartCraft
    64-bit
  • Constraint projections

    Turns each node's held directions into a projection that removes them.

    P = I − Σ q qᵀ over the orthonormal held directions q

    Voxel stress analysis: elements, loads, reactions and modes fea.js
    • PartCraft
    64-bit
  • Eigenvalues of a small symmetric matrix

    Eigenvalues and vectors by cyclic Jacobi rotations.

    t = sign(θ) ÷ (|θ| + √(θ² + 1)), θ = (a_qq − a_pp) ÷ (2 a_pq)

    Voxel stress analysis: elements, loads, reactions and modes fea.js
    • PartCraft
    64-bit
  • Is the body held

    Checks that the supports stop all six rigid motions.

    Voxel stress analysis: elements, loads, reactions and modes fea.js
    • PartCraft
    64-bit
  • Gravity load

    Shares each element's weight equally to its eight corners.

    corner force = scale × ρ g h³ ÷ 8 × unit direction

    Voxel stress analysis: elements, loads, reactions and modes fea.js
    • PartCraft
    64-bit
  • Stress at element corners and center

    The six stress components and von Mises stress at each element's eight corners and center, and the largest center value.

    σ = scale × (E ÷ h) × S u_e − scale × E α ΔT ÷ (1 − 2ν) on the direct components

    Voxel stress analysis: elements, loads, reactions and modes fea.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.