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
-
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
-
Layers of a wall type at another thickness
The layer thicknesses of a starter wall type made thicker or thinner.
thickest layer = wanted thickness − Σ other layers
Wall dimensions, heights and quantities model-walls.js64-bit- BimCraft
-
Type key for a thickness
Names the wall type that has a given total thickness.
key = base@(Math.round(mm × 10) ÷ 10)
Wall dimensions, heights and quantities model-walls.js64-bit- BimCraft
-
Total thickness of a type
The sum of a wall type's layer thicknesses.
t = Σ layer thickness
Wall dimensions, heights and quantities model-walls.js64-bit- BimCraft
-
Wall ends from the stored placement
The start point, end point, length and thickness of a wall as read back from the file.
a = (M₁₂, M₁₃); b = a + (M₀, M₁) ÷ |(M₀, M₁)| × chord; chord = chordFor(Length, Bulge)
Wall dimensions, heights and quantities model-walls.js64-bit- BimCraft
-
Wall height
A wall's height from the level its top follows, or its own fixed height.
h = (top elevation + top offset) − (base elevation + base offset)
Wall dimensions, heights and quantities model-walls.js64-bit- BimCraft
-
Walls cut by another level's plan
Finds walls of other levels that pass through a level's plan cut height.
base + 1 < level elevation + cut < top − 1 (mm)
Wall dimensions, heights and quantities model-walls.js64-bit- BimCraft
-
New wall: angle and stored sizes
The placement angle and the Length, Thickness, Height and offsets stored for a new wall.
angle = atan2(b_y − a_y, b_x − a_x) × 180 ÷ π; Length = arc length (chord when straight)
Wall dimensions, heights and quantities model-walls.js64-bit- BimCraft
-
Moved wall: placement and length
Rewrites a wall's start point, angle and Length after its ends move.
Wall dimensions, heights and quantities model-walls.js64-bit- BimCraft
-
Whether a wall's shape is out of date
Compares the stored outline, depth and axis length with the ones just computed.
|stored − computed| < 0.001 mm for depth, length and every outline point
Wall dimensions, heights and quantities model-walls.js64-bit- BimCraft
-
Outline in the wall's own axes
Turns the plan outline into coordinates along and across the wall.
x′ = (x − a_x)·cos θ + (y − a_y)·sin θ; y′ = −(x − a_x)·sin θ + (y − a_y)·cos θ
Wall dimensions, heights and quantities model-walls.js64-bit- BimCraft
-
Stored shape read back
The outline, extrusion depth and axis length a wall's shape holds now.
arc axis length = R × |Δangle|
Wall dimensions, heights and quantities model-walls.js64-bit- BimCraft
-
Wall quantities
Footprint area, side areas and volumes of a wall, with its openings taken off the net values.
footprint = |shoelace(outline)|; gross side = length × height; net side = max(0, gross side − Σ w·h); gross volume = footprint × height; net volume = max(0, gross volume − Σ w·h·t)
Wall dimensions, heights and quantities model-walls.js64-bit- BimCraft
-
Outline area
The signed area of the site outline.
A = ½ Σ (xᵢ·yᵢ₊₁ − yᵢ·xᵢ₊₁)
Site outline, building placement and levels model-site.js64-bit- BimCraft
-
Site area and perimeter
The GrossArea and GrossPerimeter stored for the site.
A = |shoelace|; P = Σ √(Δx² + Δy²)
Site outline, building placement and levels model-site.js64-bit- BimCraft
-
Outline saved as text
The site outline written to the CadCraft_Site Points property.
x,y;x,y;… each rounded to 3 decimals of the file unit
Site outline, building placement and levels model-site.js64-bit- BimCraft
-
Building position and angle on the site
Where the building sits on the site and how far it is turned.
M = site⁻¹ × building; at = (M₁₂, M₁₃); angle = atan2(M₁, M₀) × 180 ÷ π
Site outline, building placement and levels model-site.js64-bit- BimCraft
-
Plan points to site axes
Moves points drawn on a level's plan into the site's own axes.
p′ = site⁻¹ × level × p
Site outline, building placement and levels model-site.js64-bit- BimCraft
-
Building placed on the site
Writes the building's new position and turn relative to the site.
Site outline, building placement and levels model-site.js64-bit- BimCraft
-
Levels at given elevations
Adds levels at heights above the building's base.
z = base + e; height = next e − e, at least 1000 mm
Site outline, building placement and levels model-site.js64-bit- BimCraft
-
Height split into equal levels
Divides a building height into a number of equal levels.
h = T ÷ n; zᵢ = base + i × h
Site outline, building placement and levels model-site.js64-bit- BimCraft
-
Footprint of a site-study mass
The outline of a mass in world millimeters, read from its extruded profile.
p = world matrix × (profile point × unit)
Site outline, building placement and levels model-site-mass.js64-bit- BimCraft
-
A point inside the footprint
Finds a point inside a possibly concave outline, used as the seed for the floor.
x = aₓ + (y − a_y) ÷ (b_y − a_y) × (bₓ − aₓ); seed = middle of the widest span
Site outline, building placement and levels model-site-mass.js64-bit- BimCraft
-
Walls round the footprint
Makes a wall along every edge of the mass footprint on each of its levels.
Site outline, building placement and levels model-site-mass.js64-bit- BimCraft
-
Room quantities
Height, perimeters, floor areas and volume of a room.
h = elevation above − elevation; gross area = |shoelace(outline)|; volume = net area × h
Room, floor and ceiling quantities model-slabs.js64-bit- BimCraft
-
Floor slab quantities
Thickness, perimeter, areas and volume of a floor slab.
net area = |A(outline)| − Σ |A(hole)|; volume = net area × thickness; solid from offset − thickness, depth = thickness
Room, floor and ceiling quantities model-slabs.js64-bit- BimCraft
-
Ceiling quantities
Thickness and areas of a ceiling.
net area = |A(outline)| − Σ |A(hole)|
Room, floor and ceiling quantities model-slabs.js64-bit- BimCraft
-
Change key of a shape
A short key of what a shape was made from, used to decide whether to write it again.
numbers rounded to 0.01 mm → text → 32-bit FNV-1a hash + text length
Room, floor and ceiling quantities model-slabs.js64-bit- BimCraft
-
Height a roof sits at
The top of the tallest wall under a roof.
top = max(base offset + height) over the walls, else the level's height
Room, floor and ceiling quantities model-slabs.js64-bit- BimCraft
-
Default roof sizes
The pitch, overhang and thickness a new roof gets when none are given.
pitch = 26.565°; overhang = 12 × 25.4 mm; thickness = 8 × 25.4 mm
Room, floor and ceiling quantities model-slabs.js64-bit- BimCraft
-
Drawing units to millimeters
The factor that turns drawing units into millimeters, by the drawing's INSUNITS code.
1 → 25.4, 2 → 304.8, 4 → 1, 5 → 10, 6 → 1000, 10 → 914.4
Walls and openings traced from a drawing model-trace.jsExact- BimCraft
-
Extents of a block
The bounding box of a block's lines, polylines, circles, arcs and nested blocks.
arc: its two ends and every quarter point k × π ÷ 2 inside the sweep
Walls and openings traced from a drawing model-trace.js64-bit- BimCraft
-
Box of a placed block
The box of a block reference in plan millimeters.
corner = (insert + R(rotation) · (scale · block corner)) × unit; box = min and max of the four corners
Walls and openings traced from a drawing model-trace.js64-bit- BimCraft
-
Joining lines into chains
Links line segments that share an end point into chains.
key = round(x ÷ tol), round(y ÷ tol)
Walls and openings traced from a drawing model-trace.js64-bit- BimCraft
-
Chain offset to the wall's center line
Moves a chain of face lines sideways by half the wall thickness, with mitred corners.
n = (−Δy, Δx) ÷ L × d; corner = axisMeet of neighboring offset lines
Walls and openings traced from a drawing model-trace.js64-bit- BimCraft
-
Walls from pairs of parallel lines
Pairs two parallel lines as the faces of a wall and gives its center line and thickness.
d = (q.a − p.a)·n; overlap = [max(0, min(s₀, s₁)), min(L, max(s₀, s₁))]; center line = p + (d ÷ 2)·n over the overlap; t = |d|
Walls and openings traced from a drawing model-trace.js64-bit- BimCraft
-
Closing traced corners
Runs a wall end that stops short of another wall to that wall's center line.
gap = |end − meeting point| ≤ 0.75 × max(t₁, t₂) + 1 mm
Walls and openings traced from a drawing model-trace.js64-bit- BimCraft
-
Doors and windows from blocks
Places a door or window on the wall nearest a block's box, with its offset and width along the wall.
s = (c − a)·u; width = |Δx·uₓ| + |Δy·u_y| of the box, between 400 mm and L − 50 mm; offset = s − width ÷ 2
Walls and openings traced from a drawing model-trace.js64-bit- BimCraft
-
Wall type for a traced thickness
Chooses the wall type for a traced wall from its measured thickness.
|t − t₀| > 1 mm → type at Math.round(t) mm, else the chosen type
Walls and openings traced from a drawing model-trace.js64-bit- BimCraft
-
Underlay line points
The points of the reference drawing stored with the level.
round(mm ÷ unit, 6)
Walls and openings traced from a drawing model-trace.js64-bit- BimCraft
-
Number format in the file
Turns a number into the text written in the PDF.
toFixed(4), trailing zeros removed; |v| < 5e-5 → 0
Vector PDF output pdf.js64-bit- BimCraft
- DetailCraft
-
Millimeters to points
The factor between millimeters and PDF points.
K = 72 ÷ 25.4
Vector PDF output pdf.jsExact- BimCraft
- DetailCraft
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.