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

  • Registered position of a point

    One point in the registered frame: its stored position plus the scan's origin, moved by the scan's matrix.

    p = M × (pos + origin)

    Registered scans written as LAS and E57 scan-export.js
    • CadCraft
    • BimCraft
    32-bit in part
  • Bounds of the registered cloud

    The minimum and maximum x, y, z over every moved point, and the point count.

    Registered scans written as LAS and E57 scan-export.js
    • CadCraft
    • BimCraft
    32-bit in part
  • LAS scale and offset

    Chooses the scale and offset the LAS file stores its integer coordinates with.

    scale = first of 0.0001, 0.001, 0.01, 0.1, 1 with extent ÷ scale < 2e9; offset = ⌊min ÷ 100⌋ × 100

    Registered scans written as LAS and E57 scan-export.js
    • CadCraft
    • BimCraft
    64-bit
  • LAS point record

    Stores one point's x, y, z as integers in the LAS file.

    X = round((p − offset) ÷ scale)

    Registered scans written as LAS and E57 scan-export.js
    • CadCraft
    • BimCraft
    32-bit in part
  • E57 point record

    Stores one point's x, y, z in an E57 data packet and widens the scan's bounds.

    Registered scans written as LAS and E57 scan-export.js
    • CadCraft
    • BimCraft
    32-bit in part
  • Numbers written as text in the E57 header

    Writes a bound or a time stamp as text in the E57 XML section.

    Registered scans written as LAS and E57 scan-export.js
    • CadCraft
    • BimCraft
    64-bit
  • Parameter values in dependency order

    Evaluates every parameter after the ones it uses and reports cycles and missing values.

    Parameters and equations params.js
    • CadCraft
    • PartCraft
    64-bit
  • Equation results written to their targets

    Evaluates each equation and writes the result into the dimension or feature value it drives.

    written when |current − v| > 1e-12 × max(1, |v|)

    Parameters and equations params.js
    • CadCraft
    • PartCraft
    64-bit
  • Limits on a driven value

    Checks a value against its target's kind: whole number, minimum, maximum.

    Parameters and equations params.js
    • CadCraft
    • PartCraft
    64-bit
  • Backward solve for a driving parameter

    Finds the parameter value that makes an equation give the value a person typed.

    secant: c = b − f(b) × (b − a) ÷ (f(b) − f(a)); stop when |f| ≤ 1e-10 × max(1, |target|, |x₀|)

    Parameters and equations params.js
    • CadCraft
    • PartCraft
    64-bit
  • Rounding of the solved value

    Replaces the solved value by the roundest number near it that still solves the equation.

    first of round(x, d decimals) for d = 0…10, then x to 12 significant digits, that keeps |f| within tolerance; else x

    Parameters and equations params.js
    • CadCraft
    • PartCraft
    64-bit
  • Edited dimension written back to a parameter

    When a driven value is edited, changes the driving parameter behind its equation, or rewrites a constant equation to the new number.

    Parameters and equations params.js
    • CadCraft
    • PartCraft
    64-bit
  • Value typed for a parameter

    Sets a driving parameter to a typed value, or solves the driving parameter behind a driven one.

    Parameters and equations params.js
    • CadCraft
    • PartCraft
    64-bit
  • Removing a parameter and writing its value in

    Removes a parameter and, when asked, writes its current value into every expression that used it.

    Parameters and equations params.js
    • CadCraft
    • PartCraft
    64-bit
  • Design table row made permanent

    Writes a set of override values into the parameters.

    Parameters and equations params.js
    • CadCraft
    • PartCraft
    64-bit
  • Frame a sheet maps onto

    The drawing area a redline sheet is mapped onto: a given box, or the extents of everything drawn.

    Redline items placed in the drawing redline.js
    • CadCraft
    64-bit
  • Item geometry in drawing units

    An item's box, points and center in drawing coordinates.

    x = x0 + fx × (x1 − x0); y = y0 + fy × (y1 − y0); center = midpoint of the box

    Redline items placed in the drawing redline.js
    • CadCraft
    64-bit
  • Cloud arc length and margin

    The arc length of a revision cloud, the margin round the item and the text height of the revision mark.

    base = text height × dimension scale; arc = 4 × base; margin = arc; text = 1.4 × base

    Redline items placed in the drawing redline.js
    • CadCraft
    64-bit
  • Revision cloud outline

    The rectangle a revision cloud is drawn round: the item's box grown by the margin.

    x0 − margin, y0 − margin, x1 + margin, y1 + margin

    Redline items placed in the drawing redline.js
    • CadCraft
    64-bit
  • Picture scale

    Drawing units per pixel of a pasted picture.

    units per pixel = W ÷ pixel width

    Pasted picture size pastepic.js
    • CadCraft
    64-bit
  • Drawing units per millimeter

    The factor that turns a size in millimeters into the drawing's units.

    units per mm = units per point × 72 ÷ 25.4

    Pasted picture size pastepic.js
    • CadCraft
    64-bit
  • Size of a copied area

    The width and height a copied area takes in the drawing, on paper or at its real size.

    size = size in mm × units per mm

    Pasted picture size pastepic.js
    • CadCraft
    64-bit
  • Region size, enclosing triangle and tolerances

    Measures the region and sets the tolerances every later test uses.

    D = max(Δx, Δy); eps = 1e-13 × D; epsA = 1e-13 × D²

    Triangulation of solid faces acis/cdt.js
    • CadCraft
    • ModelCraft
    64-bit
  • Orientation of three points

    Twice the signed area of the triangle a, b, c: positive when anticlockwise.

    (x_b − x_a) × (y_c − y_a) − (y_b − y_a) × (x_c − x_a)

    Triangulation of solid faces acis/cdt.js
    • CadCraft
    • ModelCraft
    64-bit
  • In-circle test

    Whether point d lies inside the circle through a, b and c.

    det of rows (a − d, |a − d|²), (b − d, |b − d|²), (c − d, |c − d|²) > 0

    Triangulation of solid faces acis/cdt.js
    • CadCraft
    • ModelCraft
    64-bit
  • Triangle that holds a point

    Walks from the last triangle to the one a new point falls in.

    Triangulation of solid faces acis/cdt.js
    • CadCraft
    • ModelCraft
    64-bit
  • Inserting a point

    Adds one point: merged into a corner it coincides with, splitting an edge it lies on, or splitting the triangle it is inside.

    Triangulation of solid faces acis/cdt.js
    • CadCraft
    • ModelCraft
    64-bit
  • Do two segments cross

    Whether edge c–d properly crosses boundary segment a–b.

    Triangulation of solid faces acis/cdt.js
    • CadCraft
    • ModelCraft
    64-bit
  • Face corners in model units

    The corners of an add-on's solid in the 3D model's units, and where the solid is placed.

    local = (q − o) × k; translation = o × k

    Add-on solids placed on the 3D tab addons/cadcraft-api.js
    • CadCraft
    64-bit
  • Rule read into the library

    Checks a rule from a file or from storage and sets the base size's move to zero.

    Grade rule library addons/apparel/lib/rules.js
    • CadCraft
    64-bit
  • Rule applied to a piece

    A library rule as moves for a piece's own size range and units.

    move = round to 6 decimals of (m − base) × k; k = 1, 25.4 or 1 ÷ 25.4

    Grade rule library addons/apparel/lib/rules.js
    • CadCraft
    64-bit
  • Rules read from a RUL file

    Turns a RUL file's rules into library entries measured from the sample size.

    move = value for the size − value for the sample size

    Grade rule library addons/apparel/lib/rules.js
    • CadCraft
    64-bit
  • Rules written to a RUL file

    Writes the library's rules as the delta lines of a RUL file.

    Grade rule library addons/apparel/lib/rules.js
    • CadCraft
    64-bit
  • Face-frame default sizes

    The stile and rail width, overlay and door gap a job uses when it sets none.

    stile = rail = 38 mm; overlay = 12 mm; gap = 3 mm; inch job: round(mm ÷ 25.4 × 16) ÷ 16

    CabinetCraft parts, fronts and face frames addons/cabinetcraft/lib/build.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Carcass depth behind a face frame

    The depth the carcass is built with when a face frame takes part of the cabinet's depth.

    d = max(1, d − frame thickness)

    CabinetCraft parts, fronts and face frames addons/cabinetcraft/lib/build.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Face-frame openings and overlay fronts

    The rails, the openings between them and the doors or drawer fronts that cover each opening.

    opening h = (box h − (2 + mids) × rail) ÷ (mids + 1); front h = opening h + lap below + lap above; pair door w = (opening w + 2 × overlay − gap) ÷ 2

    CabinetCraft parts, fronts and face frames addons/cabinetcraft/lib/build.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Door and blind panel of a blind corner

    The door over the open part of a blind corner cabinet and the panel over the blind part.

    door w = (w − blind) − reveal; panel w = blind − reveal; h = box h − reveal

    CabinetCraft parts, fronts and face frames addons/cabinetcraft/lib/build.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Part size stored in the cut list

    Adds one part with its length, width, thickness and material.

    CabinetCraft parts, fronts and face frames addons/cabinetcraft/lib/build.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Frame rail length and counts

    The length of the frame's rails and how many rails and mid rails a cabinet needs.

    rail length = w − 2 × stile − blind

    CabinetCraft parts, fronts and face frames addons/cabinetcraft/lib/build.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Doors and drawer fronts counted by size

    Groups equal fronts into one cut-list line with a quantity.

    CabinetCraft parts, fronts and face frames addons/cabinetcraft/lib/build.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    Exact
  • Drawer boxes of a face-frame cabinet

    The sides, ends and bottom of each drawer box behind a face frame.

    box h = min(front h − clearance, opening h − 20 mm); end = bw − 2t; bottom = (bw − 2t + 2g) × (slide − 2t + 2g); bw = opening w − 2 × slide gap

    CabinetCraft parts, fronts and face frames addons/cabinetcraft/lib/build.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Dowels of a corner cabinet

    The number of dowels a corner cabinet's drilling needs.

    dowels = dowel holes ÷ 2

    CabinetCraft parts, fronts and face frames addons/cabinetcraft/lib/build.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Curved cabinet outline in the cell's own axes

    The outline points of a made-to-order curved cabinet, measured from the cell's origin along its two axes.

    (x′, y′) = ((q − o) · u, (q − o) · n)

    CabinetCraft parts, fronts and face frames addons/cabinetcraft/lib/build.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Closing panel of an angled corner

    The height of the panel that closes a corner which is not a right angle.

    height = cabinet h − plinth height

    CabinetCraft parts, fronts and face frames addons/cabinetcraft/lib/build.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Picked room corner

    A corner of the room outline picked on the plan, snapped to the grid.

    p = round(x ÷ g) × g; g = 50 (mm job) or 2 (inch job)

    CabinetCraft room picking and dry-run units addons/cabinetcraft/main.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Direction of the picked outline

    Whether the corners were picked clockwise, which decides the sign of each arc's sweep.

    Σ (xᵢ × yᵢ₊₁ − xᵢ₊₁ × yᵢ) < 0 means clockwise

    CabinetCraft room picking and dry-run units addons/cabinetcraft/main.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Sheet size in the program's units

    The sheet size, thickness and rapid rate the dry run checks a G-code program against.

    k = (1 ÷ 25.4 or 1) × (25.4 or 1); sheet = job sheet × k; rapid (inch program) = rapid ÷ 25.4

    CabinetCraft room picking and dry-run units addons/cabinetcraft/main.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Numbers on labels and the maker review

    Writes a number with at most 2 decimals.

    text = round(v × 100) ÷ 100

    CabinetCraft room picking and dry-run units addons/cabinetcraft/main.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Job converted to the other unit

    Every size in the job converted from millimeters to inches or back when the job's unit is changed.

    to inches: round(v × (1 ÷ 25.4) × 16) ÷ 16; to millimeters: round(v × 25.4)

    Cabinet job edits that change sizes addons/cabinetcraft/lib/edit.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Gap at a door or window

    The width of the gap put in a run's floor row so that the cabinets after it clear an opening.

    width = ⌈(at + w + clear − start) × 10⌉ ÷ 10

    Cabinet job edits that change sizes addons/cabinetcraft/lib/edit.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • 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.