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
-
Recognizing copies of a part
Folds parts that are rigid moves of one another into one part with several placements.
copy when fit error ≤ 1e-5 × size and largest corner difference ≤ 4e-5 × size
Manual: imported product meshes, copies and part volume illustrate/import.js64-bit- PartCraft
-
Largest corner difference after a move
How far the moved corners of one mesh are from another's.
Manual: imported product meshes, copies and part volume illustrate/import.js64-bit- PartCraft
-
Placement moved to millimeters
A 3MF placement with its move in millimeters.
Manual: imported product meshes, copies and part volume illustrate/import.js64-bit- PartCraft
-
Mesh in the manual file
A part's mesh as written into the manual file.
Manual: imported product meshes, copies and part volume illustrate/manual.js32-bit in part- PartCraft
-
Explode offsets
How far each part has moved at a point in an exploded view.
offset = Σ dir × dist × clamp(t × n − k, 0, 1) over the steps k
Manual: imported product meshes, copies and part volume illustrate/manual.js64-bit- PartCraft
-
Where each part is drawn
Each instance's matrix in a view.
M = translation(explode offset + view move) × placement
Manual: imported product meshes, copies and part volume illustrate/manual.js64-bit- PartCraft
-
Moving parts in a view
Adds a move to parts in one view.
Manual: imported product meshes, copies and part volume illustrate/manual.js64-bit- PartCraft
-
Part volume and area
The volume and surface area of a part's mesh.
V = |Σ a·(b × c) ÷ 6|; A = Σ |(b − a) × (c − a)| ÷ 2
Manual: imported product meshes, copies and part volume illustrate/manual.js32-bit in part- PartCraft
-
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
-
Learned symbol saved and read back
Stores an accepted symbol in the file and reads it back for a later search.
byte = round(ink × 255); ink′ = byte ÷ 255
Automatic count by symbol matching learn.js32-bit in part- TakeoffCraft
-
Same symbol as one already learned
The normalized correlation of two symbols over their common area.
ncc = Σ(a − ā)(b − b̄) ÷ √(Σ(a − ā)² · Σ(b − b̄)²)
Automatic count by symbol matching learn.js64-bit- TakeoffCraft
-
Find placed on the sheet
Maps a find's pixel box back to sheet coordinates and takes its middle as the count mark's point.
p = T⁻¹·((x + w ÷ 2) ÷ wt, (y + h ÷ 2) ÷ wt)
Automatic count by symbol matching takeoffcraft.js64-bit- TakeoffCraft
-
Feet to meters, Z up to Y up
Converts one vertex from the view's feet to glTF's meters and axes.
(x, y, z) ft → (0.3048·x, 0.3048·z, −0.3048·y) m
3D check view exported as glTF glb.js64-bit- TakeoffCraft
-
Vertex positions and normals written
Fills the position and normal buffers of an object.
n = (b − a) × (c − a) ÷ |…|
3D check view exported as glTF glb.js32-bit in part- TakeoffCraft
-
Bounds of each position buffer
The minimum and maximum of a position buffer, written beside it.
3D check view exported as glTF glb.js32-bit in part- TakeoffCraft
-
Quantities carried with each object
Attaches each object's mark, item, kind and measured values to its node.
3D check view exported as glTF glb.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.