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

  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    32-bit, display only
  • 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.js
    • BimCraft
    32-bit, display only
  • Joining cut segments into loops

    Closed outlines from the cut segments, for the fill.

    Plan view of elements drawn from their mesh model-plan.js
    • BimCraft
    32-bit, display only
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • Sloped placement frame

    A placement with its own Z and X directions, used for sloped parts.

    Numbers written into the IFC model model-write.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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

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.