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
-
Quantity with waste
A quantity increased by a waste percentage.
qtyW = qty × (1 + bp ÷ 10000)
Rates, percentages and extended amounts units.js64-bit- TakeoffCraft
-
Cents as dollars text
Writes whole cents as $1,234.56.
Rates, percentages and extended amounts units.jsExact- TakeoffCraft
-
Typed bid amount to cents
Reads an amount typed into the bid leveling sheet as whole cents.
cents = round(rate4 ÷ 100)
Rates, percentages and extended amounts takeoffcraft.jsExact- TakeoffCraft
-
Typed pitch to rise per 12
Reads 6:12, 6/12, 4:10, a bare rise, or an angle in degrees.
rise = tan(a·π ÷ 180) × 12; rise = rise ÷ run × 12
Roof pitch and slope factors units.js64-bit- TakeoffCraft
-
Slope factor of a roof plane
Surface length or area per unit of plan length or area.
f = √(1 + (rise ÷ 12)²)
Roof pitch and slope factors units.js64-bit- TakeoffCraft
-
Hip and valley factor
True length of a hip or valley per unit of its plan length.
f = √(1 + (rise ÷ 12)² ÷ 2)
Roof pitch and slope factors units.js64-bit- TakeoffCraft
-
Pitch as text
Writes the rise as 6:12 or 6.5:12.
Roof pitch and slope factors units.js64-bit- TakeoffCraft
-
Signed coordinate length
Reads one typed coordinate, which may be negative or zero, into feet.
Typed distances and coordinates while drawing typein.js64-bit- TakeoffCraft
-
Sheet direction of a screen direction
The unit vector on the sheet that points along a given direction on the screen.
u = M⁻¹·(sx, −sy); u ÷ |u|
Typed distances and coordinates while drawing typein.js64-bit- TakeoffCraft
-
Point from typed text
Works out the next point from a distance, a distance and angle, or coordinates.
p = last + dir × ft × k, k = 1 ÷ ftPerUnit
Typed distances and coordinates while drawing typein.js64-bit- TakeoffCraft
-
Circle radius typed while drawing
Places a circle's edge point at a typed radius from its center, toward the pointer.
edge = c + (to − c) ÷ |to − c| × ft ÷ ftPerUnit
Typed distances and coordinates while drawing takeoffcraft.js64-bit- TakeoffCraft
-
Typed spot elevation
Reads the elevation typed on a count mark, in decimal feet, feet-inches or meters.
Typed distances and coordinates while drawing takeoffcraft.js64-bit- TakeoffCraft
-
One CAD object as points and bulges
The run or outline that stands for a line, arc, circle, polyline, ellipse, spline or 2D solid.
arc: p = c + r·(cos a, sin a), b = tan(sweep ÷ 4); ellipse: n = max(24, ⌈1440·sweep ÷ 2π⌉) chords
Lengths and areas taken from CAD objects cadgeom.js64-bit- TakeoffCraft
-
Hatch as outlines with holes
The outer loops of a hatch, each with the loops inside it as cut-outs.
Lengths and areas taken from CAD objects cadgeom.js64-bit- TakeoffCraft
-
Object placed on the sheet
Applies the sheet or viewport matrix to an object's points and decides whether a viewport shows it.
p′ = T·(mirror·x, y); b′ = b × sign(det T × mirror)
Lengths and areas taken from CAD objects cadgeom.js64-bit- TakeoffCraft
-
Marks made from picked objects
The point lists a linear or an area item takes from the picked objects.
Lengths and areas taken from CAD objects cadgeom.js64-bit- TakeoffCraft
-
Length and area of what is picked
The total length or net area of the picked objects in page units.
len = Σ length; area = Σ (gross − cut-outs)
Lengths and areas taken from CAD objects cadgeom.js64-bit- TakeoffCraft
-
Picked objects in real units
The length or area of the picked CAD objects shown above the sheet.
SF = area × k²; ft = len × k
Lengths and areas taken from CAD objects takeoffcraft.js64-bit- TakeoffCraft
-
Product of two transforms
Combines two 2 × 3 affine matrices.
Counting blocks, shapes and texts in a CAD drawing cadcount.js64-bit- TakeoffCraft
-
Place of a block reference and its array cells
The point of each copy of a block reference, and the transform its contents get.
p = M·(insert + R(rot)·(c·dx, r·dy))
Counting blocks, shapes and texts in a CAD drawing cadcount.js64-bit- TakeoffCraft
-
Point that stands for a shape
The one point a shape is placed and counted by: a center, a middle, or the middle of its box.
Counting blocks, shapes and texts in a CAD drawing cadcount.js64-bit- TakeoffCraft
-
Count of block references
How many references of the named blocks there are, in total, by variant and by layer.
total = number of matching references
Counting blocks, shapes and texts in a CAD drawing cadcount.jsExact- TakeoffCraft
-
Which sheet shows an object, and where
The page point of a drawing object on a sheet, through the first viewport that contains it.
Counting blocks, shapes and texts in a CAD drawing cadset.js64-bit- TakeoffCraft
-
Bézier curves cut into chords
Turns each cubic or quadratic curve of the page into 8 straight segments.
B(t) = u³p₀ + 3u²t·c₁ + 3u·t²·c₂ + t³p₃, u = 1 − t, t = s ÷ 8
Snapping to and measuring the sheet's own linework snap.js64-bit- TakeoffCraft
-
Where two segments cross
The crossing point of two segments, offered as a snap point.
u = ((c − a) × s) ÷ (r × s); point = a + r·u
Snapping to and measuring the sheet's own linework snap.js64-bit- TakeoffCraft
-
Snap point for a picked point
The end point, midpoint, intersection or nearest point on a line within the snap distance.
Snapping to and measuring the sheet's own linework snap.js64-bit- TakeoffCraft
-
Connected path through a segment
The segment that was clicked and everything joined to it end to end within the gap tolerance.
Snapping to and measuring the sheet's own linework pickpath.js64-bit- TakeoffCraft
-
Next segment at a junction
Chooses which segment a path continues along from an end point.
score = turn angle + (0.01 when the ends are more than 1e-9 apart)
Snapping to and measuring the sheet's own linework pickpath.js64-bit- TakeoffCraft
-
Vertices of a picked path
The points of the path in order, as they will be stored in the mark.
Snapping to and measuring the sheet's own linework pickpath.js64-bit- TakeoffCraft
-
Length of a picked path
The length of the path in sheet units.
L = Σ |pᵢ − pᵢ₋₁|
Snapping to and measuring the sheet's own linework pickpath.js64-bit- TakeoffCraft
-
Area of a picked loop
The area inside a closed path in square sheet units.
A = |Σ (xᵢ·yᵢ₊₁ − xᵢ₊₁·yᵢ)| ÷ 2
Snapping to and measuring the sheet's own linework pickpath.js64-bit- TakeoffCraft
-
Closed loops around a clicked point
Finds the closed paths that have the clicked point inside, smallest first.
Snapping to and measuring the sheet's own linework pickpath.js64-bit- TakeoffCraft
-
A CAD sheet's lines for snapping
The drawing's own line segments in page units, through the sheet and viewport matrices.
Snapping to and measuring the sheet's own linework cadset.js64-bit- TakeoffCraft
-
Picked path in real units
The length and area of what is picked, shown while picking.
ft = L × k; SF = A × k²
Snapping to and measuring the sheet's own linework takeoffcraft.js64-bit- TakeoffCraft
-
Room around a point
Flood-fills the room and returns its outline in pixel corners.
Room outline by flood fill roomfill.js64-bit- TakeoffCraft
-
Outline traced along pixel edges
Walks the outer boundary of the filled region, corner by corner.
Room outline by flood fill roomfill.jsExact- TakeoffCraft
-
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
-
Picture to ink darkness
Turns the canvas pixels of a sheet into darkness from 0 (paper) to 1 (black).
ink = 1 − (lum·a + (1 − a)), lum = (0.299R + 0.587G + 0.114B) ÷ 255
Automatic count by symbol matching match.js32-bit in part- TakeoffCraft
-
Symbol turned to an angle
Rotates the symbol's raster for a search at an angle.
Automatic count by symbol matching match.js32-bit in part- TakeoffCraft
-
Integral images
Running sums of ink and of ink squared, so any window's sum costs four lookups.
sum(window) = S[e] − S[b] − S[c] + S[a]
Automatic count by symbol matching match.js64-bit- TakeoffCraft
-
Match score at every position, and its peaks
Scores how well the symbol matches at each position and keeps the local best ones.
score = Σ (t − t̄)·img ÷ (σₜ·√n × √(v·n)), v = Σimg² ÷ n − (Σimg ÷ n)²
Automatic count by symbol matching match.js32-bit in part- TakeoffCraft
-
Search at each angle
Runs the match at every angle asked for and collects the finds.
Automatic count by symbol matching match.js32-bit in part- TakeoffCraft
-
Angle of a find refined
Tries angles within 7.5° of a find in 1.5° steps and keeps the best.
Automatic count by symbol matching match.js32-bit in part- TakeoffCraft
-
Finds kept at the threshold
Keeps the finds at or above the threshold, best first, and drops any that overlaps a kept one.
keep when score ≥ threshold and IoU with every kept find ≤ 0.25
Automatic count by symbol matching match.js32-bit in part- TakeoffCraft
-
Raster scale for a search
The pixels per sheet unit that make the symbol's longer side about 40 pixels.
w = clamp(40 ÷ max(boxW, boxH), 0.2, 4)
Automatic count by symbol matching match.js64-bit- TakeoffCraft
-
How alike two symbols are
The best normalized correlation of two symbols over shifts of up to one pixel.
likeness = max over shifts of Σ(p − p̄)(q − q̄) ÷ √(Σ(p − p̄)² · Σ(q − q̄)²)
Automatic count by symbol matching legend.js64-bit- TakeoffCraft
-
One find per spot across symbols
Merges overlapping finds of one symbol, and gives a spot two symbols match to the higher score.
Automatic count by symbol matching legend.js32-bit in part- TakeoffCraft
-
Counts per symbol and per sheet
Counts the kept finds for each symbol, in total and on each sheet.
Automatic count by symbol matching legend.jsExact- TakeoffCraft
-
Raster sizes for a sheet at another scale
The pixel sizes to search a sheet at so a symbol drawn to scale keeps its size in pixels.
w′ = w × tgtFt ÷ srcFt when |tgtFt ÷ srcFt − 1| > 0.01
Automatic count by symbol matching legend.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.