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
-
Where two face lines meet
The point where two lines, each given by a point and a direction, cross.
s = ((p₂ − p₁) × d₂) ÷ (d₁ × d₂); point = p₁ + s·d₁
Wall joins and plan outlines model-walls.js64-bit- BimCraft
-
Nodes and tees
Groups wall ends that meet and finds ends that land on another wall's side.
Wall joins and plan outlines model-walls.js64-bit- BimCraft
-
Corner points at a node
The mitre or corner point between each pair of neighboring walls at a node.
c = left face of A ∩ right face of B; kept when |c − node| ≤ 4 × max(h_A, h_B) + tol
Wall joins and plan outlines model-walls.js64-bit- BimCraft
-
Faces of curved walls
Where a straight face meets a circular face, or two circular faces meet, nearest a given point.
line and circle: t = −b ± √(b² − c); two circles: x = (d² + r₁² − r₂²) ÷ 2d, y = √(r₁² − x²)
Wall joins and plan outlines model-walls.js64-bit- BimCraft
-
Curved wall outline
The outline of a curved wall with each arc edge kept as a bulge.
bulge = tan(sweep ÷ 4)
Wall joins and plan outlines model-walls.js64-bit- BimCraft
-
Removing repeated and collinear points
Drops outline points that repeat or lie on a straight run.
collinear when |ab × bc| ≤ 1e-6 × (|ab|·|bc| + 1e-12) and ab·bc ≥ 0
Wall joins and plan outlines model-walls.js64-bit- BimCraft
-
Signed outline area
The signed area of an outline, used for the footprint and to check its direction.
A = ½ Σ (xᵢ·yᵢ₊₁ − yᵢ·xᵢ₊₁)
Wall joins and plan outlines model-walls.js64-bit- BimCraft
-
Outline validity test
Decides whether an outline is anticlockwise and does not cross itself.
Wall joins and plan outlines model-walls.js64-bit- BimCraft
-
Location line offset
How far a wall's location line is from its center line for each justification.
face: ± t ÷ 2; core: ± (t ÷ 2 − layer thickness up to the core face or core middle)
Wall joins and plan outlines model-walls.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
-
Point along a snapped direction
The point at an orthogonal or stepped angle from the last point, stopping at a wall it crosses or at a rounded length.
θ = round(θ ÷ step) × step; l = len × cos(θ₀ − θ); p = from + l × (cos θ, sin θ)
Drawn points: angle, length and wall-face paths model-tools.js64-bit- BimCraft
-
Nearest point on a wall line or face
The point on a wall's center line or face nearest the pointer.
s = clamp((p − a)·u, 0, L); q = a + s·u
Drawn points: angle, length and wall-face paths model-tools.js64-bit- BimCraft
-
Signed area of a drawn loop
The signed area of a closed chain of points, used to tell which side is outside.
A = ½ Σ (xᵢ·yᵢ₊₁ − yᵢ·xᵢ₊₁)
Drawn points: angle, length and wall-face paths model-tools.js64-bit- BimCraft
-
Center lines for a path drawn on a wall face
Offsets a drawn path by half the wall thickness and mitres the corners.
offset = ± t ÷ 2 along the left normal; corner = intersection of neighboring offset lines
Drawn points: angle, length and wall-face paths model-tools.js64-bit- BimCraft
-
Where two center lines meet
The meeting point of line a→b and line c→d, with its position along each.
den = r × s; t = ((c − a) × s) ÷ den; u = ((c − a) × r) ÷ den; p = a + t·r
Trim, extend and corner walls model-trim.js64-bit- BimCraft
-
New ends of a trimmed wall
Which part of the wall stays and where its moved end goes.
inside when 0.5 ÷ L < t < 1 − 0.5 ÷ L; click side by t_c = (click − a)·(b − a) ÷ L²
Trim, extend and corner walls model-trim.js64-bit- BimCraft
-
Trim or extend to a wall
A wall's new ends when it is trimmed or extended to another wall.
allowed when −slack ≤ u ≤ 1 + slack, slack = (t_edge ÷ 2) ÷ L_edge
Trim, extend and corner walls model-trim.js64-bit- BimCraft
-
Corner two walls
Both walls' new ends at the point their center lines meet.
Trim, extend and corner walls model-trim.js64-bit- BimCraft
-
Whether a trim cuts through an opening
Checks each door and window on the wall against the wall's new extent.
s₀ = offset − shift, s₁ = s₀ + width; cut when the opening is not wholly outside and s₀ < −0.5 or s₁ > L + 0.5
Trim, extend and corner walls model-trim.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
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.