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
-
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
-
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
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.