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
-
Grid line ends read from the file
A grid line's two ends in building millimeters, from its polyline and the grid's placement.
world = M × (x × unit, y × unit, 0)
Grid lines model-grids.js64-bit- BimCraft
-
Grid lines in a story's plan
Grid line ends moved from building coordinates into one story's plan axes.
plan = (story world)⁻¹ × point
Grid lines model-grids.js64-bit- BimCraft
-
Link matrix through both files' map positions
The matrix from the linked file's millimeters to the open model's, through the map grid both are placed on.
m = S(host unit) × host map⁻¹ × S(1 ÷ host map unit) × S(link map unit) × link map × S(1 ÷ link unit)
Placing a linked model model-links.js64-bit- BimCraft
-
Link matrix from two pairs of points
The turn and move that carry two picked points of the linked model onto two picked points of the open one.
a = atan2(h₁ − h₀) − atan2(l₁ − l₀); t = h₀ − R(a) × l₀
Placing a linked model model-links.js64-bit- BimCraft
-
The same change in the scene
Carries a link matrix between the file's millimeters and the viewer's scene.
A = F × m × F⁻¹; m = F⁻¹ × A × F
Placing a linked model model-links.js64-bit- BimCraft
-
Saving the link matrix
The matrix written into the model as text.
entry = round(v × 10⁹) ÷ 10⁹
Placing a linked model model-links.js64-bit- BimCraft
-
Boxes of the things that move
The plan box of each wall, drawn floor, column and placed item.
wall corners = end ± n × t ÷ 2
Move, align and distribute model-modify.js64-bit- BimCraft
-
Align
The move that brings each element's chosen side or middle to a common line.
move = target − own; middle = (min + max) ÷ 2
Move, align and distribute model-modify.js64-bit- BimCraft
-
Distribute
The moves that space elements evenly between the first and the last.
gap = (span − Σ sizes) ÷ (n − 1)
Move, align and distribute model-modify.js64-bit- BimCraft
-
Where placed items stand
The position and rotation of each placed library item in its story's plan.
rot = atan2(M[1], M[0]) × 180 ÷ π
Move, align and distribute model-move.js64-bit- BimCraft
-
Moving and turning placed items
The new position and rotation of an item moved by an amount or turned, on its own or about a shared point.
p′ = c + R(Δ) × (p − c); rot = ((rot mod 360) + 540) mod 360 − 180
Move, align and distribute model-move.js64-bit- BimCraft
-
Rejoining wall corners after a type change
The new corner point of two walls that met end to end, after their center lines moved.
s = ((B.a − A.a) × v) ÷ (u × v); p = A.a + s u
Move, align and distribute model-ops.js64-bit- BimCraft
-
Doors and windows when a wall end slides
How far a wall's start moved along its own line, so that what it hosts keeps its place.
shift = (B.a − A.a) · u_A; new offset = offset − shift
Move, align and distribute model-ops.js64-bit- BimCraft
-
Fitting an opening in a wall
The offset along the wall at which an opening of a given width fits.
offset = max(gap, min(len − width − gap, offset))
Doors and windows in walls model-openings.js64-bit- BimCraft
-
Sill of a door
Whether a door stands on its wall's own level or on an upper level the wall passes.
kept when |level elevation − base elevation − sill| ≤ 1 mm
Doors and windows in walls model-openings.js64-bit- BimCraft
-
Offset, size and sill read back
Where an existing door or window sits and how big it is, from the file.
sill = M[14] + base offset; width = stored × unit
Doors and windows in walls model-openings.js64-bit- BimCraft
-
Default offset and height check
Where a new opening goes when no offset is given, and the check that it is not taller than the wall.
offset = (len − W) ÷ 2; refused when sill + height > wall height + 1
Doors and windows in walls model-openings.js64-bit- BimCraft
-
The box that cuts the wall
The body of the opening that is subtracted from the wall.
box: x from 0 to width, y from −t ÷ 2 − 10 to t ÷ 2 + 10, z from 0 to height
Doors and windows in walls model-openings.js64-bit- BimCraft
-
Width, height and area written
The quantities and sizes written on a door or window.
area = width × height
Doors and windows in walls model-openings.js64-bit- BimCraft
-
Shift of a wall's start along its line
How far a wall's start moved along the wall, so hosted openings can keep their place in the world.
shift = (a′ − a) · u
Doors and windows in walls model-openings.js64-bit- BimCraft
-
Door body
The boxes a starter door is built from: frame, leaves, glass.
frame = min(1.5 in, W ÷ 6)
Doors and windows in walls model-openings.js64-bit- BimCraft
-
Window body
The boxes a starter window is built from: frame, rails, stiles, glass and an optional well.
frame = min(2 in, W ÷ 6, H ÷ 6)
Doors and windows in walls model-openings.js64-bit- BimCraft
-
Slope and outline kind
Turns the pitch into a slope and chooses the method for the outline.
s = tan(pitch)
Roof planes over an outline model-roof.js64-bit- BimCraft
-
Faces of a roof over a convex outline
Each pitched edge's face, the eave, the ridges and the area.
keep p where (nᵢ − nⱼ) · p ≤ nᵢ · aᵢ − nⱼ · aⱼ; area = plan area × √(1 + s²)
Roof planes over an outline model-roof.js64-bit- BimCraft
-
Clipping a polygon by a half-plane
Keeps the part of a convex polygon on one side of a line.
t = f_a ÷ (f_a − f_b); point = a + t (b − a)
Roof planes over an outline model-roof.js64-bit- BimCraft
-
Where two offset edges meet
The corner of the eave where two neighboring edges, pushed out by the overhang, cross.
t = ((p₂ − p₁) × d₂) ÷ (d₁ × d₂)
Roof planes over an outline model-roof.js64-bit- BimCraft
-
Roof over an outline with square corners
A hip roof for every largest rectangle that fits in the outline with its overhang.
m = min(w, h) ÷ 2; ridge from (x₀ + m, c_y) to (x₁ − m, c_y)
Roof planes over an outline model-roof.js64-bit- BimCraft
-
Height of the roof over a point
The roof's underside height above the top of the walls at a plan point.
z = z₀ + s × (distance inside the face's eave edge)
Roof planes over an outline model-roof.js64-bit- BimCraft
-
Is the outline convex
Chooses between the two roof methods.
convex when every corner turns the same way
Roof planes over an outline model-roof.js64-bit- BimCraft
-
Plan area of a polygon
The shoelace area used for the eave and the faces.
A = ½ Σ (xᵢ yᵢ₊₁ − yᵢ xᵢ₊₁)
Roof planes over an outline model-roof.js64-bit- BimCraft
-
Dimension chain of a wall
The overall length of a wall along one face and the chain of lengths between its ends and its openings.
overall = e₁ − e₀; piece = sᵢ₊₁ − sᵢ with s rounded to 0.01 mm
Plan view: picked points, wall outlines and dimensions model-plan.js64-bit- BimCraft
-
Wall outline with openings taken out
The pieces of a wall's plan outline left between the openings the cut plane passes through.
Plan view: picked points, wall outlines and dimensions model-plan.js64-bit- BimCraft
-
Clipping a polygon at a position along the wall
Keeps the part of a polygon on one side of x = k.
t = (k − a_x) ÷ (b_x − a_x); y = a_y + t (b_y − a_y)
Plan view: picked points, wall outlines and dimensions model-plan.js64-bit- BimCraft
-
Viewer coordinates to a story's plan
The matrix from the viewer's Y-up meters to a story's plan millimeters.
M = (story world)⁻¹ × S × C⁻¹
Plan view: picked points, wall outlines and dimensions model-plan.js64-bit- BimCraft
-
Pointer position to plan millimeters
The plan point under the pointer, which the drawing tools then snap and use.
x = (px − w ÷ 2) ÷ scale + cx; y = (h ÷ 2 − py) ÷ scale + cy
Plan view: picked points, wall outlines and dimensions model-planview.js64-bit- BimCraft
-
Cutting a story's elements
The cut segments of every element the cut plane passes through, and the edges of what lies below or above.
Plan view of elements drawn from their mesh model-plan.js32-bit, display only- BimCraft
-
Cutting one triangle
The segment where a triangle crosses the cut plane.
t = (h − zᵢ) ÷ (zⱼ − zᵢ); point = pᵢ + t (pⱼ − pᵢ)
Plan view of elements drawn from their mesh model-plan.js32-bit, display only- BimCraft
-
Joining cut segments into loops
Closed outlines from the cut segments, for the fill.
Plan view of elements drawn from their mesh model-plan.js32-bit, display only- BimCraft
-
Sheet and scale
The paper size, the drawing's extent and the scale it prints at.
fits when W ÷ r ≤ room width and H ÷ r ≤ room height
Plan as a vector PDF model-pdf.js64-bit- BimCraft
-
Plan millimeters to the sheet
The scale factor and offsets that place the plan on the page.
k = 1 ÷ ratio; paper = offset + plan × k; points = paper × 72 ÷ 25.4
Plan as a vector PDF model-pdf.js64-bit- BimCraft
-
Coordinate written to the PDF
How a path coordinate in points is turned into text.
text = Number(v.toFixed(6))
Plan as a vector PDF model-pdf.js64-bit- BimCraft
-
Arcs as short lines
Door swings and other arcs written as polylines.
steps = max(8, ⌈|a₁ − a₀| ÷ (π ÷ 32)⌉)
Plan as a vector PDF model-pdf.js64-bit- BimCraft
-
Rounding of a stored value
Rounds a number to a given count of decimals before it is written to the file.
round(v, d) = Math.round(v × 10ᵈ) ÷ 10ᵈ, d = 6 by default
Numbers written into the IFC model model-write.js64-bit- BimCraft
-
Placement position and turn
The origin and X direction of an element's placement from a point in millimeters and an angle in degrees.
location = round(mm ÷ unit, 6); X direction = (round(cos θ, 12), round(sin θ, 12), 0), θ = degrees × π ÷ 180
Numbers written into the IFC model model-write.js64-bit- BimCraft
-
Profile and polyline points
A 2D point of a profile, axis or outline as it is stored.
(round(x ÷ unit, 6), round(y ÷ unit, 6))
Numbers written into the IFC model model-write.js64-bit- BimCraft
-
Extrusion base and depth
The start height and depth of a swept solid.
position z = round(z₀ ÷ unit, 6); depth = round(depth ÷ unit, 6)
Numbers written into the IFC model model-write.js64-bit- BimCraft
-
Sloped placement frame
A placement with its own Z and X directions, used for sloped parts.
Numbers written into the IFC model model-write.js64-bit- BimCraft
-
Quantity values
Converts a length, area or volume in millimeter units to the value stored in a quantity set.
length = round(mm ÷ unit, 6); area = round(mm² ÷ 10⁶, 6); volume = round(mm³ ÷ 10⁹, 6)
Numbers written into the IFC model model-write.js64-bit- BimCraft
-
World matrix in millimeters
Converts a placement matrix from file units to millimeters.
translation × unit in mm; rotation part unchanged
Numbers written into the IFC model model-write.js64-bit- BimCraft
-
Placement relative to a parent
Where an element sits in the axes of its level or site.
M = P⁻¹ × C
Numbers written into the IFC model model-write.js64-bit- 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.