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

  • Buckling factors by subspace iteration

    The lowest positive buckling load factors and their mode shapes.

    Z = K⁻¹ G X; reduce (Zᵀ G Z, Zᵀ K Z); Kr = L Lᵀ; eig(L⁻¹ Gr L⁻ᵀ) = μ; λ = 1 ÷ μ

    Buckling load factors and thermal stress setup buckling.js
    • PartCraft
    64-bit
  • Solver tolerances of a buckling study

    How tightly the pre-stress solve and each inner solve are converged.

    pre-stress: 1e-10; each K⁻¹ solve: 1e-9

    Buckling load factors and thermal stress setup buckling.js
    • PartCraft
    64-bit
  • Temperature rise at each node

    The temperature change that drives thermal stress: a uniform rise, or the temperature field minus the stress-free temperature.

    ΔT = T − T_ref, T_ref = 20 when not given

    Buckling load factors and thermal stress setup buckling.js
    • PartCraft
    64-bit
  • Time step for a transient thermal load

    Which saved time step of a transient run is nearest the requested time.

    step = round(time ÷ (t ÷ steps)), held in [0, steps]; time = step × dt

    Buckling load factors and thermal stress setup buckling.js
    • PartCraft
    64-bit
  • Voxel model volume and mass

    The volume and mass of the analysis model listed with the study.

    volume = elements × h³; mass = volume × density (tonne/mm³) × 1000

    Buckling load factors and thermal stress setup buckling.js
    • PartCraft
    64-bit
  • Numbers written to the deck

    Formats every coordinate, material value, load and penalty for the input deck.

    text = v.toExponential(10)

    CalculiX deck export and result import calculix.js
    • PartCraft
    64-bit
  • Material cards

    Writes elastic constants, density and the two-point plastic curve of each part's material.

    density (tonne/mm³) = density (kg/m³) × 1e-12; plastic: (σ_y, 0) and (σ_y + H, 1)

    CalculiX deck export and result import calculix.js
    • PartCraft
    64-bit
  • Support directions

    Writes each held direction, and a local axis system for supports on slanted faces.

    axis when ||v| − 1| < 1e-9; slanted: local x = n, local y = unit(t − (t · n) n)

    CalculiX deck export and result import calculix.js
    • PartCraft
    64-bit
  • Nodal loads

    Writes the nodal forces of the study as concentrated loads.

    one line per non-zero force component

    CalculiX deck export and result import calculix.js
    • PartCraft
    64-bit
  • Load increments

    The first and smallest load increment given to the other program.

    first = 1 ÷ steps; smallest = 1 ÷ (64 × steps); total and largest = 1

    CalculiX deck export and result import calculix.js
    • PartCraft
    64-bit
  • Reading the result file

    Reads node positions and result values from the text result file.

    value = parseFloat(12-character field, D exponent read as E)

    CalculiX deck export and result import calculix.js
    • PartCraft
    64-bit
  • Default penalty stiffness

    The contact stiffness used when none is given.

    kn = 20 × E ÷ h

    Contact between parts in stress analysis contact.js
    • PartCraft
    64-bit
  • Closest point on a triangle

    The point of a flat triangle nearest a given point, as weights of the three corners.

    region tests on d₁ … d₆ = dot products of edges with corner-to-point vectors; inside: v = v_b ÷ (v_a + v_b + v_c)

    Contact between parts in stress analysis contact.js
    • PartCraft
    64-bit
  • Closest point on a curved face

    The nearest point of a six-node master face, in the face's own coordinates.

    best of 4 flat sub-triangles (corners and midsides); (L₁, L₂) = weights × reference coordinates

    Contact between parts in stress analysis contact.js
    • PartCraft
    64-bit
  • Point and normal on a face

    The position and outward unit normal of a six-node face at given face coordinates.

    x = Σ N_k x_k; n = unit(Σ ∂N_k/∂L₁ x_k × Σ ∂N_k/∂L₂ x_k)

    Contact between parts in stress analysis contact.js
    • PartCraft
    64-bit
  • Integration weights on the slave face

    The area each contact point on a slave face stands for.

    w = w_q × |∂x/∂L₁ × ∂x/∂L₂| ÷ 2

    Contact between parts in stress analysis contact.js
    • PartCraft
    64-bit
  • Pairing slave points with the master

    Finds the master point each slave point faces, and reports whether the pairing changed.

    paired when d² ≤ cutoff²; moved when the face changes or |ΔL| > 2e-3

    Contact between parts in stress analysis contact.js
    • PartCraft
    64-bit
  • Gap, contact force and stiffness

    The normal gap at a contact point and the force and stiffness it adds.

    g = n · (x_s − x_m); force = kn × w × (−g) when g < 0; stiffness = kn × w × c cᵀ ⊗ n nᵀ; pressure = force ÷ w

    Contact between parts in stress analysis contact.js
    • PartCraft
    64-bit
  • Bonded tie

    Holds a slave point to the master point it started nearest to.

    rel = (x_s − x_m) − (x_s − x_m) at the first call; force = −kt × w × rel

    Contact between parts in stress analysis contact.js
    • PartCraft
    64-bit
  • Machined part: stock, cutting, holes, handling

    The cost rows of a part cut from a block of stock.

    stock = (size + 2 × allowance) per axis; stock cost = stock volume × density × 1e-9 × price per kg; cutting minutes = (stock volume − volume) ÷ removal rate × finishing; cost = minutes ÷ 60 × rate per hour

    Manufacturing cost estimate cost.js
    • PartCraft
    64-bit
  • Printed part: filament and machine time

    The cost rows of a 3D-printed part.

    printed volume = volume × fill; filament = printed volume × density × 1e-9 × price per kg; hours = printed volume ÷ volume per hour

    Manufacturing cost estimate cost.js
    • PartCraft
    64-bit
  • Cost per part and rounding

    The cost of each part at the given quantity, the share of each row, and the rounded figures returned.

    total = unit + setup ÷ quantity; share = row ÷ total; returned amounts = round to 0.01

    Manufacturing cost estimate cost.js
    • PartCraft
    64-bit
  • Rounding to two decimals

    Rounds an amount or a listed quantity to hundredths.

    r2(v) = round(v × 100) ÷ 100

    Manufacturing cost estimate cost.js
    • PartCraft
    64-bit
  • Number of holes

    Counts the holes the part has, for the time per hole.

    hole features + circles in cut sketches, each × (pattern count − 1) more for patterns

    Manufacturing cost estimate cost.js
    • PartCraft
    Exact
  • One-dimensional squared distance transform

    For each cell of a row, the squared distance to the nearest marked cell, by lower envelopes of parabolas.

    d(q) = min_p ((q − p)² + f(p)); parabolas meet at s = ((f(q) + q²) − (f(p) + p²)) ÷ (2q − 2p)

    Adaptive clearing passes cam-adaptive.js
    • PartCraft
    64-bit
  • Distance to the nearest marked cell

    The straight-line distance, in cells, from every cell to the nearest cell of a mask.

    columns then rows of the 1D transform; distance = √(squared distance)

    Adaptive clearing passes cam-adaptive.js
    • PartCraft
    64-bit
  • Grid over the region

    Lays a grid over the region and stores, per cell, whether it is inside and its exact distance to the walls.

    cell h = R ÷ 12 (× 1.25 until the grid fits); wall distance from the region's lines and arcs

    Adaptive clearing passes cam-adaptive.js
    • PartCraft
    64-bit
  • Contour of the distance field

    Traces the line where the field crosses zero, which becomes a pass.

    crossing on a cell edge at t = a ÷ (a − b)

    Adaptive clearing passes cam-adaptive.js
    • PartCraft
    64-bit
  • Field whose contour is the next pass

    Sets up the field that is zero where the tool center cuts the set width into the remaining material.

    F = (R − w) − distance to material (allowed cells); positive elsewhere

    Adaptive clearing passes cam-adaptive.js
    • PartCraft
    64-bit
  • Keeping passes off the walls

    Moves any pass point that came nearer the walls than the tool radius plus stock to leave.

    p ← nearest wall point + unit(p − nearest) × (R + leave + 1e-6)

    Adaptive clearing passes cam-adaptive.js
    • PartCraft
    64-bit
  • Simplifying a pass

    Drops points of a pass that lie within a tolerance of the line between their neighbors.

    keep the point farthest from the chord when its distance > cell ÷ 4, then repeat on both halves

    Adaptive clearing passes cam-adaptive.js
    • PartCraft
    64-bit
  • Marking what a pass clears

    Marks every grid cell the tool covers along a pass.

    cell cleared when its center is within R of the segment

    Adaptive clearing passes cam-adaptive.js
    • PartCraft
    64-bit
  • Engagement check

    Re-simulates the passes on a finer grid and reports the largest engagement angle, the equivalent cutting width, uncut area and the smallest wall clearance.

    angle = 360 × (rim points in material) ÷ 360; width = R (1 − cos angle); gouge = min(dist to walls − R − leave)

    Adaptive clearing passes cam-adaptive.js
    • PartCraft
    64-bit
  • Simulation grid

    Sets the cell size of the stock grid and the tolerances used to call a gouge.

    cell = min(2, max(0.1, max(w, h) ÷ 500)); lateral tolerance = 2e-4 × diagonal + 0.01

    Stock simulation and machining time cam-sim.js
    • PartCraft
    64-bit
  • Cutting along a level move

    Lowers the stock cells under one level move of the tool.

    z_cell = min(z_cell, z + h(distance from cell center to the track))

    Stock simulation and machining time cam-sim.js
    • PartCraft
    64-bit
  • Cutting along a sloping move

    Cuts a move that changes height as a series of short level moves.

    n = ceil(|Δz| ÷ 0.01); piece i cut at the lower of its two end heights

    Stock simulation and machining time cam-sim.js
    • PartCraft
    64-bit
  • Stock volume

    The volume of stock left, from which the volume removed by each operation is found.

    V = cell² × Σ (z − stock bottom) over cells in the stock

    Stock simulation and machining time cam-sim.js
    • PartCraft
    64-bit
  • Part height with lateral tolerance

    The part's height at a cell, taken as the lowest of the center and eight points a small distance round it.

    min over the center and 8 points at the lateral tolerance, 45° apart

    Stock simulation and machining time cam-sim.js
    • PartCraft
    64-bit
  • Gouge detection

    Finds cells where the stock was cut below the part's surface.

    gouge when z_cell < eroded part height − 0.02

    Stock simulation and machining time cam-sim.js
    • PartCraft
    64-bit
  • Stock left and deepest gouge

    The volume of stock left above the part, the thickest stock left and the deepest gouge.

    remaining = cell² × Σ (z − max(part height, stock bottom)) where that exceeds 0.02

    Stock simulation and machining time cam-sim.js
    • PartCraft
    64-bit
  • Machining time

    The time a program takes: cutting moves at their feed, rapid moves at the machine's rapid rate, plus tool changes.

    seconds = 60 × (Σ L ÷ feed + Σ L ÷ rapid) + changes × change time

    Stock simulation and machining time cam-sim.js
    • PartCraft
    64-bit
  • Arc center words I and J

    The arc center written relative to the arc's start point.

    I = round₃(c_x − round₃(start_x)); J = round₃(c_y − round₃(start_y))

    G-code and toolpath exports cam-post.js
    • PartCraft
    64-bit
  • Axis words

    Writes X, Y and Z only when they change at the output resolution.

    write an axis when round₃(new) ≠ round₃(last written)

    G-code and toolpath exports cam-post.js
    • PartCraft
    64-bit
  • Toolpath as CSV

    Writes every segment's start, end, arc center, sweep and feed as text.

    value = toFixed(6); sweep in degrees = sweep × 180 ÷ π

    G-code and toolpath exports cam-post.js
    • PartCraft
    64-bit
  • Toolpath as JSON

    Writes the setup, tools and every operation's moves.

    JSON.stringify of the moves

    G-code and toolpath exports cam-post.js
    • PartCraft
    64-bit
  • Spindle speed and feeds

    The spindle speed, cutting feed, plunge feed and ramp feed for a tool.

    rpm = round(1000 vc ÷ (π d)), limited to the machine's range; feed = rpm × flutes × f_z; plunge = feed ÷ 3; ramp = feed ÷ 2

    Cutting speeds, feeds and tool profiles cam-tools.js
    • PartCraft
    64-bit
  • Rounding feeds to one decimal

    Rounds a feed rate to tenths.

    round1(v) = round(v × 10) ÷ 10

    Cutting speeds, feeds and tool profiles cam-tools.js
    • PartCraft
    64-bit
  • Tool tip profile

    The height of the cutting surface above the tool's tip at a given distance from its axis.

    ball: R − √(R² − ρ²); bull: r_c − √(r_c² − (ρ − a)²) beyond a = R − r_c; drill and chamfer: (ρ − r_t) ÷ tan(angle ÷ 2); flat: 0

    Cutting speeds, feeds and tool profiles cam-tools.js
    • PartCraft
    64-bit
  • Elementary functions

    The one-argument math functions a script can call: roots, exponentials, logarithms, trigonometry, hyperbolic functions, rounding and angle conversion.

    log1p(x) = x − x² ÷ 2 + x³ ÷ 3 for |x| < 1e-4, else log(1 + x); asinh(x) = sign × log(|x| + √(x² + 1)); atanh(x) = ½ log((1 + x) ÷ (1 − x)); sind(x) = sin(x × π ÷ 180)

    CraftScript core math functions cs-lib-core.js
    • PartCraft
    64-bit
  • Rounding to a number of decimals

    round(x, d): rounds to d decimal places.

    round(x × 10^d) ÷ 10^d

    CraftScript core math functions cs-lib-core.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.