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

  • A viewport's window on the model

    The box in model space that a viewport shows, used to say when it looks at nothing.

    half width = w ÷ 2 × viewHeight ÷ h; half height = viewHeight ÷ 2; corners turned by the twist

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Picture placement

    The transform from a picture's pixels to drawing coordinates.

    world = P + u·px − v·py + v·h (pixel y runs down; P is the lower left corner)

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Lines of a paragraph of text

    Where each line of a multi-line text starts.

    pitch = h × 1.667 × line spacing; line i at insert + (top − pitch × i) along the up direction

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Text position, height and angle

    One line of text carried through the entity's transform.

    H = h × |second column of M|; angle = atan2(m₁, m₀) ± rotation (− when M mirrors)

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Paper unit of a sheet

    Whether a sheet is in inches or millimeters.

    unit = mm when the sheet is wider than 100 units, else inches

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Line weight in millimeters

    A stored line weight, in hundredths of a millimeter, as millimeters.

    mm = v ÷ 100 for 0 ≤ v ≤ 211, else 0.25

    DWG and DXF drawings compiled for the plan view dwg-compile.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Pointer position in drawing coordinates

    The drawing coordinates under the pointer, for the coordinate readout.

    x = cx + (px − W ÷ 2) ÷ zoom; y = cy − (py − H ÷ 2) ÷ zoom

    DWG and DXF drawings compiled for the plan view dwg-view.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Model to sheet through a viewport

    The transform that carries a model point onto the sheet through one viewport.

    k = h ÷ viewHeight; paper = center + k · R(twist) · (model − view point)

    DWG and DXF drawings compiled for the plan view dwg-view.js
    • BimCraft
    • TakeoffCraft
    64-bit
  • Millimeters per paper unit

    The size of one paper unit of a sheet in millimeters, for line weights.

    1 for millimeters, 25.4 for inches

    DWG and DXF drawings compiled for the plan view dwg-view.js
    • BimCraft
    • TakeoffCraft
    Exact
  • Combine two 3D transforms

    The product of two 3 × 4 transforms.

    DWG and DXF drawings in 3D dwg-compile3d.js
    • BimCraft
    64-bit
  • Transform a point

    A point carried through a 3 × 4 transform.

    x′ = m₀·x + m₁·y + m₂·z + m₃ (and the same for y′, z′)

    DWG and DXF drawings in 3D dwg-compile3d.js
    • BimCraft
    64-bit
  • Extrusion direction

    The unit extrusion direction of an entity, or straight up when it has none.

    N = (x, y, z) ÷ √(x² + y² + z²)

    DWG and DXF drawings in 3D dwg-compile3d.js
    • BimCraft
    64-bit
  • Object coordinate system

    The transform from an entity's own plane to world coordinates.

    Ax = unit(Wz × N) (or Wy × N when |Nx| and |Ny| < 1/64); Ay = unit(N × Ax); columns Ax, Ay, N

    DWG and DXF drawings in 3D dwg-compile3d.js
    • BimCraft
    64-bit
  • Thickness vector

    The offset between the bottom and top of an entity that has thickness.

    up = M · (N × thickness), without the translation

    DWG and DXF drawings in 3D dwg-compile3d.js
    • BimCraft
    64-bit
  • Block insert transform in 3D

    Where the content of a block lands in 3D, with rows and columns.

    M = OCS · T(insert) · Rz(rotation) · T(col × colSpacing, row × rowSpacing, 0) · S(sx, sy, sz) · T(−base)

    DWG and DXF drawings in 3D dwg-compile3d.js
    • BimCraft
    64-bit
  • Ellipse in 3D

    An ellipse or elliptical arc as 3D points.

    minor = (N × major) × ratio; p(t) = c + cos t · major + sin t · minor

    DWG and DXF drawings in 3D dwg-compile3d.js
    • BimCraft
    64-bit
  • Half width of a wide polyline

    The offset to each side of a polyline that has a start and end width.

    w(k) = (sw + (ew − sw) × length so far ÷ segment length) ÷ 2, along the normal of the path at k

    DWG and DXF drawings in 3D dwg-compile3d.js
    • BimCraft
    64-bit
  • Spline in 3D

    A spline as 3D points: its fit points, or samples of the B-spline from its control points.

    de Boor on (w·x, w·y, w·z, w); point = (Σ w·P) ÷ Σ w

    DWG and DXF drawings in 3D dwg-compile3d.js
    • BimCraft
    64-bit
  • Extents of the drawing

    The smallest box round everything drawn, in drawing units.

    DWG and DXF drawings in 3D dwg-compile3d.js
    • BimCraft
    64-bit
  • Section plane offset

    Where a section plane cuts the drawing, from a typed offset in drawing units.

    at = lo + clamp(offset × s, 0, hi − lo); offset shown = (at − lo) ÷ s, s = 100 ÷ largest extent

    DWG and DXF drawings in 3D dwg-view3d.js
    • BimCraft
    64-bit
  • Section range

    The largest offset a section plane can take along an axis, in drawing units.

    size = (max − min) ÷ s

    DWG and DXF drawings in 3D dwg-view3d.js
    • BimCraft
    64-bit
  • Drawing coordinates to scene coordinates

    The positions sent to the GPU: centered on the drawing and scaled to about 100 units across.

    scene = (p − center) × 100 ÷ largest extent

    DWG and DXF views on screen dwg-view3d.js
    • BimCraft
    32-bit, display only
  • Nearest line to the pointer

    The distance in pixels from the pointer to a line, for picking.

    t = clamp(((p − a) · (b − a)) ÷ |b − a|², 0, 1); d = |a + t·(b − a) − p|

    DWG and DXF views on screen dwg-view3d.js
    • BimCraft
    32-bit, display only
  • Zoom to the drawing

    The zoom and center that show the whole drawing or sheet.

    zoom = min(W ÷ w, H ÷ h) × 0.92; center = middle of the bounds

    DWG and DXF views on screen dwg-view.js
    • BimCraft
    32-bit, display only
  • Viewport windows on the model

    For each sheet viewport, the half width and half height of the model area it shows.

    k = h ÷ viewHeight; half width = w ÷ 2 ÷ k; half height = h ÷ 2 ÷ k

    Equipment list from drawing tags dwg-equipment.js
    • BimCraft
    64-bit
  • Sheets that show a point

    Which sheets show a given model point.

    u = dx·cos − dy·sin, v = dx·sin + dy·cos; inside when |u| ≤ half width and |v| ≤ half height

    Equipment list from drawing tags dwg-equipment.js
    • BimCraft
    64-bit
  • Quantity of a row

    The scheduled quantity of an item tagged in several places.

    qty = Σ tag quantities

    Equipment list from drawing tags dwg-equipment.js
    • BimCraft
    64-bit
  • Heat capacity of air per volume

    The energy to warm one cubic meter of air by one kelvin, in watt-hours.

    ρ·c = 1.2 kg/m³ × 1005 J/kgK ÷ 3600 = 0.335 Wh/m³K

    Heating and cooling loads per room energy-bim.js
    • BimCraft
    64-bit
  • Does a ray reach a box

    Whether a ray passes through an element's bounding box within its reach.

    Heating and cooling loads per room energy-bim.js
    • BimCraft
    64-bit
  • Where a ray crosses triangles

    Every distance along a ray at which it crosses a triangle of an element.

    det = e₁ · (d × e₂); u = (t · (d × e₂)) ÷ det; v = (d · (t × e₁)) ÷ det; distance = (e₂ · (t × e₁)) ÷ det

    Heating and cooling loads per room energy-bim.js
    • BimCraft
    64-bit
  • Is a point inside a room

    Whether a point lies inside the closed shell of a space.

    inside when a slanted ray crosses the shell an odd number of times

    Heating and cooling loads per room energy-bim.js
    • BimCraft
    64-bit
  • Room volume

    The volume enclosed by a room's triangles.

    V = |Σ a · (b × c)| ÷ 6 over the triangles

    Heating and cooling loads per room energy-bim.js
    • BimCraft
    64-bit
  • Sample pieces of a room's surface

    Cuts each triangle of the room's shell into small pieces and starts one ray from each.

    k = ⌈longest edge ÷ 0.25 m⌉; k² pieces of area (triangle area ÷ k²); start = piece center + 1e-4 m × normal

    Heating and cooling loads per room energy-bim.js
    • BimCraft
    64-bit
  • What lies beyond a bounding element

    Whether a piece of the room's surface faces another room, the ground or the outside.

    probe = start + normal × (farthest crossing + 0.25 m)

    Heating and cooling loads per room energy-bim.js
    • BimCraft
    64-bit
  • Window and door areas

    Sets each window's and door's area to its own width times height and takes the difference from its wall.

    A = OverallWidth × OverallHeight (in m); wall area = wall area − (A − sampled area)

    Heating and cooling loads per room energy-bim.js
    • BimCraft
    64-bit
  • U-value from material layers

    The U-value of an element from the thickness and conductivity of its layers.

    U = 1 ÷ (Rsi + Σ dᵢ ÷ λᵢ + Rse); Rsi, Rse = 0.13, 0.04 sideways; 0.10, 0.04 upward; 0.17, 0.04 downward

    Heating and cooling loads per room energy-bim.js
    • BimCraft
    64-bit
  • Heating load, annual energy and cooling peak

    Each room's design heat loss, its degree-day year and its cooling peak.

    H_vent = 0.335 × n × V; heat = H_out·ΔT + H_ground·ΔT_g + H_vent·ΔT; annual kWh = (H_out + H_vent + H_ground × ΔT_g ÷ ΔT) × DD × 24 ÷ 1000

    Heating and cooling loads per room energy-bim.js
    • BimCraft
    64-bit
  • Degree-days from a CSV file

    The sum of the degree-day column of a CSV file, for a year.

    total = Σ of the last numeric cell of each row

    Heating and cooling loads per room energy-bim.js
    • BimCraft
    64-bit
  • A number in the file

    A value written into the input file as text.

    text = round(x × 10ᵈ) ÷ 10ᵈ, d = 4 unless stated

    Energy model input file (IDF) and its results energy-ep.js
    • BimCraft
    64-bit
  • Triangles grouped into planes

    The triangles of a room's shell sorted into the flat faces they belong to.

    key = (round(1000·n), round(1000·d)), n = unit normal, d = n · A

    Energy model input file (IDF) and its results energy-ep.js
    • BimCraft
    64-bit
  • Outline of a face

    One polygon from the triangles of a flat face.

    Energy model input file (IDF) and its results energy-ep.js
    • BimCraft
    64-bit
  • Which way a polygon faces

    The normal of a polygon, used to order its corners counter-clockwise seen from outside.

    n = Σ ((yᵢ − yⱼ)(zᵢ + zⱼ), (zᵢ − zⱼ)(xᵢ + xⱼ), (xᵢ − xⱼ)(yᵢ + yⱼ))

    Energy model input file (IDF) and its results energy-ep.js
    • BimCraft
    64-bit
  • Construction by U-value

    The thermal resistance written for a wall, roof or floor that has no layer build-up.

    R = max(0.001, 1 ÷ U − Rs), Rs = 0.17 wall, 0.14 roof, 0.21 floor

    Energy model input file (IDF) and its results energy-ep.js
    • BimCraft
    64-bit
  • Mean U-value of a room's walls, roof and floor

    The area-weighted U-value of each kind of surface in a room.

    U = Σ (Aᵢ × Uᵢ) ÷ Σ Aᵢ

    Energy model input file (IDF) and its results energy-ep.js
    • BimCraft
    64-bit
  • Boundary of a surface

    Whether a surface of a room faces another room, the ground or the outside, and its corners as written.

    probe = mean of the corners + 0.6 m × outward normal

    Energy model input file (IDF) and its results energy-ep.js
    • BimCraft
    64-bit
  • Window rectangle on its wall

    The four corners of a window as written on the wall it faces.

    k = √(area ÷ (span × height)); half width = span × k ÷ 2; half height = height × k ÷ 2; corners projected onto the wall plane

    Energy model input file (IDF) and its results energy-ep.js
    • BimCraft
    64-bit
  • Glazing written for every window

    The one window construction every window in the file uses.

    U = 1.4 W/m²K, solar heat gain 0.6, visible transmittance 0.7

    Energy model input file (IDF) and its results energy-ep.js
    • BimCraft
    64-bit
  • Site and time zone

    The latitude, longitude and time zone written to the file.

    time zone = round(longitude ÷ 15)

    Energy model input file (IDF) and its results energy-ep.js
    • BimCraft
    64-bit
  • Design loads read back

    Each zone's design heating and cooling load in watts, from the engine's sizing report.

    Energy model input file (IDF) and its results energy-ep.js
    • BimCraft
    64-bit
  • Yearly energy per zone

    Each zone's yearly heating and cooling energy in kilowatt-hours.

    kWh = J ÷ 3.6 × 10⁶

    Energy model input file (IDF) and its results energy-ep.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.