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.

  • 6,917 calculations in 1,248 source files
  • 143 exact
  • 6,286 in 64-bit
  • 335 with a 32-bit step
  • Last reviewed

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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • Outline validity test

    Decides whether an outline is anticlockwise and does not cross itself.

    Wall joins and plan outlines model-walls.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • Total thickness of a type

    The sum of a wall type's layer thicknesses.

    t = Σ layer thickness

    Wall dimensions, heights and quantities model-walls.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • Outline area

    The signed area of the site outline.

    A = ½ Σ (xᵢ·yᵢ₊₁ − yᵢ·xᵢ₊₁)

    Site outline, building placement and levels model-site.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • Ceiling quantities

    Thickness and areas of a ceiling.

    net area = |A(outline)| − Σ |A(hole)|

    Room, floor and ceiling quantities model-slabs.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • Corner two walls

    Both walls' new ends at the point their center lines meet.

    Trim, extend and corner walls model-trim.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    Exact
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit

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.