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
-
Coverage, state and deviation of an element
An element's covered share, its state, and the mean offset and RMS of the scan from its surface.
coverage = max over large faces of covered cells ÷ cells; mean = Σd ÷ n; rms = √(Σd² ÷ n)
Scan compared with the model scan-progress.js32-bit in part- BimCraft
-
Percent complete
The share of judged elements that are built, by count and by box volume.
pct = round(1000 × built ÷ judged) ÷ 10; by volume: round(1000 × V_built ÷ V_judged) ÷ 10
Scan compared with the model scan-progress.js64-bit- BimCraft
-
Progress report as CSV
Writes one row per element with its state, coverage, mean offset, RMS, point count and volume.
coverage: 3 decimals; mean, rms, volume: 4 decimals
Scan compared with the model scan-progress.js32-bit in part- BimCraft
-
Slice turned square
Turns the slice's points by the walls' angle so that every wall runs along one of two axes.
u = x cos(−α) − y sin(−α); v = x sin(−α) + y cos(−α)
Walls, doors and rooms proposed from a scan scan-walls.js64-bit- BimCraft
-
Wall line from a histogram peak
Finds where a wall lies across its direction: a peak in the histogram of the points, then the mean of the points in that peak.
peak: h_b ≥ h_b₋₁, h_b > h_b₊₁, three-cell sum ≥ 2 × minimum points; position = mean of the points in the three cells
Walls, doors and rooms proposed from a scan scan-walls.js64-bit- BimCraft
-
Wall runs and their ends
Splits the points on a wall line into runs and keeps the runs that are long, thin and denser than what lies beside them.
split at gaps > 450 mm; keep when length ≥ 800 mm, min(side counts) ≤ 0.25 × count, core density ≥ 3 × side density
Walls, doors and rooms proposed from a scan scan-walls.js64-bit- BimCraft
-
Door gaps
Finds a door where two wall runs on one line are a door's width apart.
gap = second.from − first.to; door when 600 ≤ gap ≤ 1300; width = Math.round(gap)
Walls, doors and rooms proposed from a scan scan-walls.js64-bit- BimCraft
-
Plan slice of a scanned mesh
Finds where a horizontal plane cuts each triangle of a mesh and samples points along the cut.
f = (z_cut − z_a) ÷ (z_b − z_a); samples every 20 mm along each cut segment
Walls, doors and rooms proposed from a scan scan-propose.js64-bit- BimCraft
-
Plan slice of a point cloud
Takes the cloud's points in a band above the floor as the plan slice, in millimeters from the cloud's origin.
k = 304.8 for feet, 304.8006 for US survey feet, 1000 otherwise
Walls, doors and rooms proposed from a scan scan-propose.js32-bit in part- BimCraft
-
Runs joined across doors and outside walls moved to their middle
Joins two runs on one line with a door between them into one wall, and moves a wall that has points on one side only half its thickness outward.
c = (c₁ + c₂) ÷ 2; outside when the emptier side has < 15% of the other's points; c ← c ± thickness ÷ 2
Walls, doors and rooms proposed from a scan scan-propose.js64-bit- BimCraft
-
Wall ends snapped to corners
Moves a wall's end onto the line of a perpendicular wall when it is within the snap distance.
end ← c_other when |c_other − end| ≤ 350 mm
Walls, doors and rooms proposed from a scan scan-propose.js64-bit- BimCraft
-
Proposed wall coordinates
Turns each wall back into the slice's own axes and writes its two ends.
a, b = round(coordinate × 10) ÷ 10
Walls, doors and rooms proposed from a scan scan-propose.js64-bit- BimCraft
-
Proposed door offset
The distance from a wall's start to the near edge of a door in it.
offset = Math.round(max(0, along − width ÷ 2 − wall start))
Walls, doors and rooms proposed from a scan scan-propose.js64-bit- BimCraft
-
Rooms closed by the proposed walls
The rooms the proposed walls close, each with its area and middle.
area (m²) = round(area_mm² ÷ 1e6 × 10) ÷ 10
Walls, doors and rooms proposed from a scan scan-propose.js64-bit- BimCraft
-
Task duration
A task's duration in days, counting its start and finish day.
duration = finish − start + 1
Construction schedule dates and critical path schedule-io.jsExact- BimCraft
-
Date read from a project file
Turns a date and time from a project XML file into a day number.
day = date part of the text
Construction schedule dates and critical path schedule-io.jsExact- BimCraft
-
Link lag read from a project file
Converts a dependency's lag from tenths of a minute to whole days.
lag (days) = Math.round(LinkLag ÷ 10 ÷ minutes per day)
Construction schedule dates and critical path schedule-io.js64-bit- BimCraft
-
Offset of each dependency
Turns each link type and lag into the least number of days between the two tasks' starts.
FS: d = dur_pred + lag; SS: lag; FF: dur_pred + lag − dur_succ; SF: lag − dur_succ
Construction schedule dates and critical path schedule-io.jsExact- BimCraft
-
Early and late dates, float and the critical path
Each task's earliest start and finish, latest start and finish, float, and whether it is critical.
ES = max(own start, ES_pred + d); EF = ES + dur − 1; LS = min(finish − dur + 1, LS_succ − d); float = LS − ES
Construction schedule dates and critical path schedule-io.jsExact- BimCraft
-
Planes of a section cell
The outward normal and a point of each plane that bounds a section cell, with tilted faces and extra planes.
n = unit(n₀ + tan a × e_u + tan b × e_v); extra: n = (cos el cos az, cos el sin az, sin el)
Section volumes in the 3D view section-volume.js32-bit, display only- BimCraft
-
Corners and edges of a section cell
The corners, faces and edges of the convex cell its planes bound, drawn as the cell's frame.
corner = (d_a (n_b × n_c) + d_b (n_c × n_a) + d_c (n_a × n_b)) ÷ (n_a · (n_b × n_c))
Section volumes in the 3D view section-volume.js32-bit, display only- BimCraft
-
A plane through a point as an extra plane
Turns a plane given by a normal and a point into the azimuth, elevation and offset a section cell keeps.
az = atan2(u_y, u_x); el = asin(clamp(u_z, −1, 1)); off = u · (p − center)
Section volumes in the 3D view section-volume.js32-bit, display only- BimCraft
-
Longitude and latitude to local meters
The position of a point in meters east and north of the address point.
x = (lon − lon₀) × 111320 × cos(lat₀); y = (lat − lat₀) × 111320
Site surroundings in local meters site-context.js64-bit- BimCraft
- ModelCraft
- CivilCraft
-
Local meters back to longitude and latitude
The longitude and latitude of a local point.
lon = lon₀ + x ÷ (111320 × cos(lat₀)); lat = lat₀ + y ÷ 111320
Site surroundings in local meters site-context.js64-bit- BimCraft
- ModelCraft
- CivilCraft
-
Outlines and heights kept in the site file
Converts each outline to local meters, thins and rounds it, and sets the item's height.
ring = round(x × 100) ÷ 100, round(y × 100) ÷ 100; height = source height, else levels × 3
Site surroundings in local meters site-context.js64-bit- BimCraft
- ModelCraft
- CivilCraft
-
Thinning a long outline
Reduces an outline of more than 400 points by keeping every n-th point.
step = ⌈points ÷ 400⌉; keep indexes divisible by step
Site surroundings in local meters site-context.js64-bit- BimCraft
- ModelCraft
- CivilCraft
-
Surface areas and mean absorption of each pair
The area of each pair of opposite surfaces and their mean absorption in a band.
S_x = 2 L_y L_z; ᾱ_x = (α_west + α_east) ÷ 2; −ln(1 − ᾱ)
Reverberation time of a box room stat.js64-bit- BimCraft
-
Sabine, Eyring, Fitzroy and Arau-Puchades times
The four reverberation times of the room in a band.
Sabine: 0.161 V ÷ (S ᾱ + A_air); Eyring: 0.161 V ÷ (−S ln(1 − ᾱ) + A_air); Fitzroy: 0.161 V ÷ S² × Σ Sᵢ ÷ (−ln(1 − ᾱᵢ)); Arau: Π [0.161 V ÷ (−S ln(1 − ᾱᵢ) + A_air)]^(Sᵢ ÷ S)
Reverberation time of a box room stat.js64-bit- BimCraft
-
Local origin and merging of points
Moves every point to a local origin and makes points that fall on the same spot one vertex.
origin = ⌊min x⌋, ⌊min y⌋; key = round(x ÷ 1e-4), round(y ÷ 1e-4)
Ground surface triangulation and contours tin.js64-bit- BimCraft
- CivilCraft
-
Coordinates handed to the triangulator
Packs the local coordinates for Delaunator and runs the Delaunay triangulation.
coords = (x, −y) per vertex
Ground surface triangulation and contours tin.js64-bit- BimCraft
- CivilCraft
-
Boundary clipped to the data and given elevations
Clips the outer boundary to the convex hull of the data and takes each corner's elevation from a first surface built without it.
z_corner = elevationAt(x, y) with a 1e-6 edge tolerance
Ground surface triangulation and contours tin.js64-bit- BimCraft
- CivilCraft
-
Triangles kept inside the boundary
Drops the triangles whose center lies outside the boundary.
keep when the centroid (Σx ÷ 3, Σy ÷ 3) is inside the boundary polygon
Ground surface triangulation and contours tin.js64-bit- BimCraft
- CivilCraft
-
Surface from given triangles
Builds a surface from vertices and faces read from a file, keeping every triangle counter-clockwise.
o = (x_b − x_a)(y_c − y_a) − (y_b − y_a)(x_c − x_a); swap b, c when o < 0
Ground surface triangulation and contours tin.js64-bit- BimCraft
- CivilCraft
-
Crossing of two breakline segments
Finds where two segments properly cross, as a fraction along each.
t = cross(c − a, s) ÷ cross(r, s); u = cross(c − a, r) ÷ cross(r, s)
Ground surface triangulation and contours tin.js64-bit- BimCraft
- CivilCraft
-
Vertex at a breakline crossing
Places a new vertex where two breaklines cross and gives it an elevation.
x = x_a + (x_b − x_a) t; z from the first breakline
Ground surface triangulation and contours tin.js64-bit- BimCraft
- CivilCraft
-
Side of a breakline a vertex is on
Decides whether a vertex lies left of, right of, or on the line of a breakline being forced in.
on the line when |orient| ÷ L < 1e-7 × (1 + L)
Ground surface triangulation and contours tin.js64-bit- BimCraft
- CivilCraft
-
Whether a diagonal can be flipped
Tests that the two triangles on an edge form a strictly convex quadrilateral.
orient(c, d, a) and orient(c, d, b) have opposite signs
Ground surface triangulation and contours tin.jsExact- BimCraft
- CivilCraft
-
Whether an edge crosses a breakline
Tests whether two segments properly cross during the flips that force a breakline in.
each segment's ends lie on opposite sides of the other
Ground surface triangulation and contours tin.jsExact- BimCraft
- CivilCraft
-
Long outer triangles removed
Removes triangles on the outside whose outer edge is longer than a limit, working inward.
remove when outer edge length > maxEdge
Ground surface triangulation and contours tin.js64-bit- BimCraft
- CivilCraft
-
Contour lines
The contour lines of the surface at every multiple of an interval.
level = base + k × interval; t = (L − zᵢ) ÷ (zⱼ − zᵢ); point = pᵢ + (pⱼ − pᵢ) t
Ground surface triangulation and contours tin.js64-bit- BimCraft
- CivilCraft
-
Triangle clipped at an elevation
Keeps the part of a triangle above or below a level, for the elevation bands.
t = f_p ÷ (f_p − f_q); new point = p + (q − p) t at z = L
Ground surface triangulation and contours tin.js64-bit- BimCraft
- CivilCraft
-
Convex hull
The convex hull of a set of points, counter-clockwise.
monotone chain; pop while cross(o, a, b) ≤ 0
Ground surface triangulation and contours tin.js64-bit- BimCraft
- CivilCraft
-
Polygon area
The signed area of a polygon.
A = ½ Σ (xᵢ yᵢ₊₁ − xᵢ₊₁ yᵢ)
Ground surface triangulation and contours tin.js64-bit- BimCraft
- CivilCraft
-
Point inside a polygon
Tests whether a point is inside a polygon.
count crossings of a ray to the right; odd = inside
Ground surface triangulation and contours tin.js64-bit- BimCraft
- CivilCraft
-
Polygon clipped by a convex polygon
Clips a polygon to a convex polygon, used to keep a boundary inside the data's hull.
inside when cross(b − a, p − a) ≥ −1e-9; t = cross(a − p, e) ÷ cross(d, e)
Ground surface triangulation and contours tin.js64-bit- BimCraft
- CivilCraft
-
Corners and edges an element offers to Measure
Collects an element's feature edges and corners in world space for the pointer to snap to.
p_world = M × p_local; corners merged by round(coordinate × 1e4)
Points and faces picked for 3D measuring viewer3d.js32-bit in part- BimCraft
-
Area of the face under the pointer
The area of the flat face the pointer is on, in world units.
area = region area × |det M|^(2 ÷ 3)
Points and faces picked for 3D measuring viewer3d.js32-bit in part- BimCraft
-
Bounding box of each element
The world-space box of each element, over every loaded model.
box = M × (min, max of the element's vertices)
Points and faces picked for 3D measuring viewer3d.js32-bit in part- BimCraft
-
Clipping planes of a section box
Turns each section cell's planes into the viewer's clipping planes and draws the cell's frame a hair inside it.
viewer normal = turn(−n_x, −n_z, n_y); frame inset = Σ sizes × 1e-5 + 1e-4
3D view drawing viewer3d.js32-bit, display only- BimCraft
-
Section frame turned with the building
Rotates a viewer point about the vertical through the model's center into the section frame.
x′ = c_x + x cos a + z sin a; z′ = c_z − x sin a + z cos a
3D view drawing viewer3d.js32-bit, display only- BimCraft
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.