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

  • Where on the sheet

    Names the part of the sheet a point is in, on a 3 × 3 grid (upper left, center, lower right and so on).

    column = ⌊(x − x₀) ÷ w × 3⌋; row = ⌊(y₁ − y) ÷ h × 3⌋, each clamped to 0…2

    Drawing comparison by vector paths changes.js
    • MarkupCraft
    64-bit
  • Amount of change in an area

    How many points of line were removed and added inside one changed area, and whether it counts as added, removed or modified.

    removed = Σ hypot over removed pieces in the box; modified when both ≥ 6 pt

    Drawing comparison by vector paths changes.js
    • MarkupCraft
    64-bit
  • Segments clipped to a region

    The parts of a sheet's segments that lie inside a task's region.

    Liang–Barsky: r = q ÷ p per box side; keep when t₁ − t₀ > 1e-9

    Drawing comparison by vector paths tasks.js
    • MarkupCraft
    64-bit
  • Region snapshot

    What a task's region link stores when it is made: the sheet's lines inside the region.

    keep the 300 longest clipped segments; each coordinate rounded to 0.1 pt

    Drawing comparison by vector paths tasks.js
    • MarkupCraft
    64-bit
  • Has the region changed

    Decides whether the drawing inside a task's region changed between the snapshot and the new revision.

    changed when removed + added ≥ 4 pt and (removed + added) ÷ stored length ≥ 0.02

    Drawing comparison by vector paths tasks.js
    • MarkupCraft
    64-bit
  • Has a model element changed

    Compares the stored state of a linked model element with its state now, number by number.

    same when |x − y| ≤ tol

    Drawing comparison by vector paths tasks.js
    • MarkupCraft
    64-bit
  • Removed and added line reported

    The amount of removed and added line shown after comparing two sheets by their lines.

    amount = round(Σ hypot(Δx, Δy)) in points

    Drawing comparison by vector paths markupcraft.js
    • MarkupCraft
    64-bit
  • Sheets ranked by change

    Ranks the sheet pairs of two sets by how much line changed and marks the ones that changed.

    len = round(Σ hypot over removed and added); changed when len ≥ 6

    Drawing comparison by vector paths markupcraft.js
    • MarkupCraft
    64-bit
  • Clouds round the changes

    Adds a cloud rectangle markup round each group of changes on every changed sheet.

    cloud box = cluster box grown by 8 pt on each side

    Drawing comparison by vector paths markupcraft.js
    • MarkupCraft
    64-bit
  • Product of two transforms

    Combines two affine transforms into one.

    p′ = p × M (row vectors); (m × n) applies m first

    Edits to a page's own content base-content.js
    • MarkupCraft
    64-bit
  • Inverse of a transform

    The inverse of the matrix an object is painted with.

    det = a·d − b·c; inverse = adjugate ÷ det

    Edits to a page's own content base-content.js
    • MarkupCraft
    64-bit
  • Path coordinates rewritten

    The new numbers of one path-building operator after a move, scale or turn.

    U = C × T × C⁻¹; (x′, y′) = (x, y) × U, written with at most 4 decimals

    Edits to a page's own content base-content.js
    • MarkupCraft
    64-bit
  • Matrix round a moved picture or form

    The cm matrix written before a picture or form XObject that was moved, scaled or turned.

    U = C × T × C⁻¹, six entries with at most 4 decimals

    Edits to a page's own content base-content.js
    • MarkupCraft
    64-bit
  • Is this a move at all

    Decides whether an edit's matrix changes anything.

    |M − identity| < 1e-9 on all six entries

    Edits to a page's own content base-content.js
    • MarkupCraft
    64-bit
  • Line width in the path's own units

    Converts a line width given in page units to the units of the path's own space.

    w = page width ÷ √|a·d − b·c|

    Edits to a page's own content base-content.js
    • MarkupCraft
    64-bit
  • Replacement picture fitted into the old one's box

    Scales a replacement picture to fit, centered, inside the box of the picture it replaces, keeping its own proportions.

    ia = W ÷ H; ba = box w ÷ box h; (sx, sy) = ia > ba ? (1, ba ÷ ia) : (ia ÷ ba, 1)

    Edits to a page's own content base-content.js
    • MarkupCraft
    64-bit
  • Advance of a text run as read

    How far each text-showing operator moves the text position when a page's content is read, kept so a later edit can leave the rest of the line in place.

    string: Σ (width ÷ 1000 × size + char spacing + word spacing on a single-byte space) × horizontal scale; number in TJ: −v ÷ 1000 × size × horizontal scale

    Edits to a page's own content base-content.js
    • MarkupCraft
    64-bit
  • Advance of a text run

    How far a string moves the text position, in unscaled text space.

    Σ (glyph width ÷ 1000 × size + char spacing + word spacing on a space) × horizontal scale

    Edits to a page's own content base-content.js
    • MarkupCraft
    64-bit
  • Padding after reworded text

    The adjustment written after a reworded run so the text that follows on the line does not move.

    k = −(old advance − new advance) × 1000 ÷ (size × horizontal scale)

    Edits to a page's own content base-content.js
    • MarkupCraft
    64-bit
  • Matrix of a moved text run

    The text matrix written before a text run that was moved.

    Tm′ = (Tm × C) × T × C⁻¹

    Edits to a page's own content base-content.js
    • MarkupCraft
    64-bit
  • Line position put back after a moved run

    Restores where the text line continues after a run on it was moved.

    Tm = line matrix; then advance by −(start + advance) × 1000 ÷ (size × horizontal scale)

    Edits to a page's own content base-content.js
    • MarkupCraft
    64-bit
  • A move added to an object's edits

    Adds a move, scale or turn to what an object already had.

    T′ = T_old × T_new

    Edits to a page's own content base-edit.js
    • MarkupCraft
    64-bit
  • A moved path point

    The new numbers of a path when one of its points or handles is dragged to a place on the page.

    u = p_page × (C × T)⁻¹; attached handles shift by u − u_old

    Edits to a page's own content base-edit.js
    • MarkupCraft
    64-bit
  • Drawn-in paths written to the page

    Writes paths that were drawn into the page, and the matrix of pasted content, as content stream text.

    Edits to a page's own content base-edit.js
    • MarkupCraft
    64-bit
  • A stored matrix accepted

    Checks a move matrix read from a file or autosave before it is used.

    |a·d − b·c| > 1e-9 and every |number| < 1e7

    Edits to a page's own content base-edit.js
    • MarkupCraft
    64-bit
  • Box of part of a text item

    The box on the sheet round some characters of one piece of the drawing's text.

    s = width × i ÷ n; box corners = origin + u·s + v·t, t from −0.22 to 0.9 of the size

    Text positions: search hits and the OCR text layer textsearch.js
    • MarkupCraft
    64-bit
  • Cloud round a search hit

    The box of the cloud markup placed round a found word.

    box = hit box grown by pad on each side

    Text positions: search hits and the OCR text layer textsearch.js
    • MarkupCraft
    64-bit
  • Picture scale for reading text

    The scale at which a scanned page is drawn before its text is read.

    s = min(dpi ÷ 72, maxSide ÷ max(w, h), √(maxPixels ÷ (w·h))), at least 0.05

    Text positions: search hits and the OCR text layer ocr.js
    • MarkupCraft
    64-bit
  • Matrix that places the text layer

    The matrix that puts the recognizer's text-only page onto the sheet, written into the saved PDF.

    M = viewport⁻¹ ∘ [W_px ÷ W_pt, 0, 0, −H_px ÷ H_pt, 0, H_px]

    Text positions: search hits and the OCR text layer ocr.js
    • MarkupCraft
    64-bit
  • Words placed on the sheet

    The position, direction and size of each word read from a scan, for Find and Select text.

    baseline y at x by linear interpolation along the line's baseline; size = height above the baseline ÷ 0.9

    Text positions: search hits and the OCR text layer ocr.js
    • MarkupCraft
    64-bit
  • Word count and mean confidence

    The number of words read on a page and their mean confidence, for the status line.

    conf = round(Σ confidence ÷ n)

    Text positions: search hits and the OCR text layer ocr.js
    • MarkupCraft
    64-bit
  • Rounding to 0.1 mm

    The rounding applied to every stored mesh coordinate, plan polygon point and item size.

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

    Trees, people and cars from numbers entourage.js
    • ModelCraft
    64-bit
  • Mesh point

    Adds one point to a part's mesh.

    Trees, people and cars from numbers entourage.js
    • ModelCraft
    64-bit
  • Ring loft

    Trunks, pots, limbs and conifer tiers: rings of points round an axis joined into a capped solid.

    a = 2π·i ÷ seg; p = [cx + rx·cos a, cy + ry·sin a, z]

    Trees, people and cars from numbers entourage.js
    • ModelCraft
    64-bit
  • Crown and head blobs

    Tree crowns, shrubs, rocks and heads: an icosphere scaled to an ellipsoid with a seeded bump.

    t = (1 + √5) ÷ 2; unit point p; k = 1 + bump × (2·rand − 1); point = c + p × [rx, ry, rz] × k

    Trees, people and cars from numbers entourage.js
    • ModelCraft
    64-bit
  • Wheel

    A car wheel: a 14-sided cylinder along y.

    a = 2π·i ÷ seg − π ÷ 2; p = [x + r·cos a, y, z + r·sin a]

    Trees, people and cars from numbers entourage.js
    • ModelCraft
    64-bit
  • Canopy plan symbol

    The plan outline of a tree: a 14-point irregular ring, a trunk circle and a cross.

    a = 2π·i ÷ 14; k = r × (0.86 + 0.18·rand); p = [k·cos a, k·sin a]

    Trees, people and cars from numbers entourage.js
    • ModelCraft
    64-bit
  • Library item sizes

    The width, depth and height written into the library item.

    Trees, people and cars from numbers entourage.js
    • ModelCraft
    64-bit
  • Overhanging faces and their area

    Which triangles need support, and their total area.

    overhang if n_z < −cos((90 − angle)·π ÷ 180) and not on the bed; area = Σ triangle areas

    Supports preview and material estimate print-supports.js
    • ModelCraft
    64-bit
  • Support points under the overhangs

    Grid points in plan that fall inside an overhanging triangle, with their height on it.

    s = max(spacing, √(overhang area ÷ maxPoints)); (x, y) = ((i + ½)·s, (j + ½)·s); z = λ₁z_a + λ₂z_b + λ₃z_c

    Supports preview and material estimate print-supports.js
    • ModelCraft
    64-bit
  • Where a support lands

    The height below each support point where a straight line down meets the model, or the bed.

    bottom = z − eps − distance down to the first face, else bed z

    Supports preview and material estimate print-supports.js
    • ModelCraft
    64-bit
  • Column volume

    The material one column adds to the estimate.

    columns: V = s² × density × h; tree style: V = π × tip² × h; drawn radius = s × √(density ÷ π)

    Supports preview and material estimate print-supports.js
    • ModelCraft
    64-bit
  • Tree supports

    Joins nearby support points to one trunk and adds the branches' and trunk's volume.

    joint z = min(zᵢ − horizontal distanceᵢ ÷ tan(branch)); trunk radius = tip × √k; V = Σ π·tip²·lengthᵢ + π·r²·(joint z − base z)

    Supports preview and material estimate print-supports.js
    • ModelCraft
    64-bit
  • Sunrise, sunset and solar noon

    The clock hours of sunrise, sunset and solar noon and the sun's highest altitude on a day.

    hᵢ = min(0.05·i, 23.99), i = 0 … 480; rise = first hᵢ with altitude > 0 after one ≤ 0; noon = hᵢ of the highest altitude

    Time of day, date and exposure from plain words scene-say.js
    • ModelCraft
    64-bit
  • Clock hour for a named time

    The hour that stands for dawn, morning, noon, afternoon, golden hour, dusk or night on a given day.

    dawn = rise + 0.3; morning = rise + 0.45·(noon − rise); afternoon = noon + 0.55·(set − noon); dusk = set − 0.1; night = set + 2; hour = round to 0.01

    Time of day, date and exposure from plain words scene-say.js
    • ModelCraft
    64-bit
  • The look for the choices made

    Combines time, date or season and weather into the sun's date and hour and the render's exposure.

    month, day = round(given); exposure = round((weather + time of day) × 100) ÷ 100

    Time of day, date and exposure from plain words scene-say.js
    • ModelCraft
    64-bit
  • Places things can stand on

    Top-level placements and large flat faces with their box, top height, height and area.

    placement area = Δx × Δy of its box; face area from the model kernel; every number rounded to 0.001

    Placing scene trees and people scene-entourage.js
    • ModelCraft
    64-bit
  • Point inside a face outline

    Whether a plan point lies inside a polygon.

    count edges with (y_a > y) ≠ (y_b > y) and x < (x_b − x_a)·(y − y_a) ÷ (y_b − y_a) + x_a; inside if odd

    Placing scene trees and people scene-entourage.js
    • ModelCraft
    64-bit
  • The ground a request names

    The region to scatter over, the height things stand at, and the boxes to keep clear.

    on a placement: its box in plan, z = top of the box; on a face: its outline, z = first point's z; avoid boxes with top > z + 0.3 and bottom < z + 2.5

    Placing scene trees and people scene-entourage.js
    • ModelCraft
    64-bit
  • Planting trees

    Places a number of trees over the region, each with a random turn and a size within 10% of the library's.

    minimum distance = max(0.5, 0.9 × crown width); yaw = rand × 2π; scale = 0.9 + 0.2 × rand

    Placing scene trees and people scene-entourage.js
    • ModelCraft
    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.