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.
Calculations
-
Outline simplified
Removes corners that lie within a tolerance of the line between their neighbors.
d = |(p − a) × (b − a)| ÷ |b − a| ≤ 1.0 px
Room outline by flood fill roomfill.js64-bit- TakeoffCraft
-
Room outline back in sheet units
Sets the raster scale and the door gap in pixels, and maps the outline's pixel corners back to sheet coordinates.
gapPx = gap ÷ ftPerUnit × per × w; p = T⁻¹·(q ÷ w)
Room outline by flood fill takeoffcraft.js64-bit- TakeoffCraft
-
Where the two sheets differ
Marks each pixel as removed, added or unchanged, and counts both kinds.
removed: old ≥ 0.35 and max(new within r) < 0.2; added: the reverse
Revision overlay: what changed under a mark overlay.js64-bit- TakeoffCraft
-
How much changed along a mark
The share of a mark's path with changed ink beside it, whether a corner changed, and the changed pixels near it.
share = samples with changed ink within the buffer ÷ samples
Revision overlay: what changed under a mark overlay.js64-bit- TakeoffCraft
-
Changed pixels in a box
How many changed pixels lie in a rectangle of the mask.
n = S[y₁+1][x₁+1] − S[y₀][x₁+1] − S[y₁+1][x₀] + S[y₀][x₀]
Revision overlay: what changed under a mark overlay.jsExact- TakeoffCraft
-
Raster sizes and the mark test
Chooses the two raster scales, builds the pixel map between them and tests every mark of the old sheet.
px = min(2, √(12,000,000 ÷ (W × H)))
Revision overlay: what changed under a mark takeoffcraft.js64-bit- TakeoffCraft
-
Arcs as Bézier curves for drawing
Turns a run or an outline into move, line and curve commands.
k = 4 ÷ 3 × tan(φ ÷ 4); c₁ = p₀ + k·r·tangent₀; c₂ = p₃ − k·r·tangent₁
Marks and sheets written to PDF geom.js64-bit- TakeoffCraft
-
A mark's path written to the page
Writes a mark's commands as PDF path operators.
Marks and sheets written to PDF pdfmarks.js64-bit- TakeoffCraft
-
Quantities printed in the legend
The quantity of each item on that sheet, as text in the page's legend.
Marks and sheets written to PDF pdfmarks.js64-bit- TakeoffCraft
-
A drawing's lines written as vector paths
Writes each batch of the drawing's lines to the PDF page under the sheet's matrix.
width = max(0.25, lw × 72 ÷ 25.4 [× 0.5]) ÷ scale
Marks and sheets written to PDF cadpdf.js64-bit- TakeoffCraft
-
Unit conversions to the factor table's basis
How many meters, square meters, cubic meters or items one of each takeoff unit is.
CY → m³: × 0.764554858 (exact: 0.9144³ = 0.764554857984)
Embodied carbon from quantities carbon.js64-bit- TakeoffCraft
-
Quantity in the factor's basis
Converts a line's quantity with waste into the unit its carbon factor is given in.
qty = qtyW × factor; kg basis: qtyW × factor × density
Embodied carbon from quantities carbon.js64-bit- TakeoffCraft
-
Kilograms per line and the total
The carbon of each line for the chosen modules, and their sum.
kg = qty × (A1–A3 + A4 + A5); total = Σ kg
Embodied carbon from quantities carbon.js64-bit- TakeoffCraft
-
Carbon lines written to a file
Writes each line's quantity and kilograms to a CSV file.
written = round(v × 100) ÷ 100
Embodied carbon from quantities carbon.js64-bit- TakeoffCraft
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.