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

  • Scaled layout and first triangles

    The (u, v) points scaled to lengths, the loops given their turning sense, and the first triangulation.

    M = (u × s_u, v × s_v); loop sense = sign of Σ (xᵢ yⱼ − xⱼ yᵢ)

    STEP import: triangles for curved faces step/tess.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Apex of a cone

    The parameter at which a cone's radius reaches zero, for a face that closes at the apex.

    R = |S(0, 0) − S(π, 0)| ÷ 2; k = |S(0, 1) − S(π, 1)| ÷ 2 − R; v_apex = −R ÷ k

    STEP import: triangles for curved faces step/tess.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Interior grid spacing

    How far apart interior points are placed on each kind of surface.

    angle step = min(π ÷ 24, 2 acos(1 − tol ÷ r))

    STEP import: triangles for curved faces step/tess.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Interior points inserted

    Grid points added inside a face and joined into the triangulation.

    STEP import: triangles for curved faces step/tess.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • In-circle test

    Whether a fourth point lies inside the circle through three others.

    det of rows (a − d, |a − d|²), (b − d, |b − d|²), (c − d, |c − d|²)

    STEP import: triangles for curved faces step/tess.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Edge flips

    Inside edges flipped toward a Delaunay triangulation in the scaled (u, v).

    STEP import: triangles for curved faces step/tess.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Refinement to the chord tolerance

    Inside edges split where the surface is farther than the tolerance from the triangles.

    split when |S(mid uv) − (P_a + P_b) ÷ 2| > tol, or when a triangle's center is more than tol from its plane

    STEP import: triangles for curved faces step/tess.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Facing and self-check

    The 3D position of every point, the triangles turned to face outward, and a check of how far the mesh is from the surface.

    worst = max |S(center uv) − center of triangle| over up to 64 triangles; noted when worst > 25 × tol

    STEP import: triangles for curved faces step/tess.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Two-point fit

    The turn and move that carry two model points onto two site points, with the remaining error.

    yaw = atan2(Δw) − atan2(Δm); t = mid(w) − R mid(m); residual = max(|R m₁ + t − w₁|, |R m₂ + t − w₂|); scale off = |Δw| ÷ |Δm| − 1

    AR on site: lining the model up with the building xr/xr-core.js
    • BimCraft
    • ModelCraft
    64-bit
  • A saved alignment applied

    A model point moved to the site by the alignment kept in the file.

    (x′, z′) = (x cos yaw − z sin yaw + t_x, x sin yaw + z cos yaw + t_z)

    AR on site: lining the model up with the building xr/xr-core.js
    • BimCraft
    • ModelCraft
    64-bit
  • Re-check on a later visit

    How far the first reference point is from where the saved alignment puts it, and what to do about it.

    offset = √(Δx² + Δz²); keep < 0.05 m ≤ move < 0.5 m ≤ align again

    AR on site: lining the model up with the building xr/xr-core.js
    • BimCraft
    • ModelCraft
    64-bit
  • Placing a reference point

    Takes the site point under the phone's center mark and runs the fit or the re-check with it.

    t_y = (w₁_y + w₂_y) ÷ 2 − (m₁_y + m₂_y) ÷ 2

    AR on site: lining the model up with the building xr/xr-session.js
    • BimCraft
    • ModelCraft
    64-bit
  • Target area and the count asked for

    The area of the faces a scatter set covers and the number of items its density asks for.

    area = Σ ½ |e₁ × e₂|; asked = min(2,000,000, round(area × density)); paint: Σ max(1, round(π r² × density))

    Scattered plants, rocks and people: how many and where rt/rt-scatter.js
    • BimCraft
    • ModelCraft
    64-bit
  • A random point on the target

    Picks a triangle in proportion to its area and a point inside it.

    P = A + a (B − A) + b (C − A), (a, b) reflected when a + b > 1

    Scattered plants, rocks and people: how many and where rt/rt-scatter.js
    • BimCraft
    • ModelCraft
    64-bit
  • Dropping a point onto the target

    Where a vertical ray from a brush dab meets a target triangle.

    t = (e₂·q) ÷ det, det = e₁·(d × e₂)

    Scattered plants, rocks and people: how many and where rt/rt-scatter.js
    • BimCraft
    • ModelCraft
    64-bit
  • Slope and height limits

    Drops a candidate that stands on too steep a face or outside the height range.

    keep when n·up ≥ cos(slope) − 1e-9 and min ≤ p·up ≤ max

    Scattered plants, rocks and people: how many and where rt/rt-scatter.js
    • BimCraft
    • ModelCraft
    64-bit
  • Rounding of reported numbers

    Rounds a number before it is handed to an assistant or a script.

    num(v) = round(v × 10⁹) ÷ 10⁹; rnd6(v) = num(round(v × 10⁶) ÷ 10⁶)

    Values given to assistants and scripts agents.js
    • CadCraft
    64-bit
  • Extents, paper and viewport sizes

    The drawing's extents and each sheet's paper and viewport sizes in the drawing's description.

    Values given to assistants and scripts agents.js
    • CadCraft
    64-bit
  • An object's fields, length and area

    One object as plain values, with its length and area where it has them.

    length = Σ primLength(primitive); area = entityArea(object).area

    Values given to assistants and scripts agents.js
    • CadCraft
    64-bit
  • An object's state for change checks

    A flat set of an object's values that is compared later to see whether the object changed.

    Values given to assistants and scripts agents.js
    • CadCraft
    64-bit
  • Text height against the allowed list

    Whether a text's height is one of the heights a standards check allows.

    |h − e.h| ≤ 10⁻⁶ × max(1, h)

    Values given to assistants and scripts agents.js
    • CadCraft
    64-bit
  • Plot scale from text

    The scale number for text such as 1:100, an architectural scale label, or fit.

    a:b → n = b ÷ a

    Values given to assistants and scripts agents.js
    • CadCraft
    64-bit
  • Sheet a plot prints

    The sheet and its size for a plot asked for by an assistant: a layout, the extents, or a window of the model.

    Values given to assistants and scripts agents.js
    • CadCraft
    64-bit
  • Size and units of the SVG plot

    The SVG file's size in millimeters and the number of file units per millimeter.

    file units = mm × 10; width = sheet width in mm, rounded to 9 decimals

    Values given to assistants and scripts agents.js
    • CadCraft
    64-bit
  • Coordinates in the SVG plot

    How points, widths and matrix entries are transformed and written into the SVG file.

    (x′, y′) = M · (x, y, 1); text = round(v × 1000) ÷ 1000; width scale = √|det M|

    Values given to assistants and scripts agents.js
    • CadCraft
    64-bit
  • Arcs in the SVG plot

    An arc written as a run of straight chords.

    n = max(2, ⌈|sweep| ÷ 2°⌉); pᵢ = center + r·(cos, sin)(a₀ + sweep·i ÷ n)

    Values given to assistants and scripts agents.js
    • CadCraft
    64-bit
  • Text in the SVG plot

    The matrix, position and size written for a piece of text.

    transform = matrix(a b c d e f), each entry rounded to 3 decimals

    Values given to assistants and scripts agents.js
    • CadCraft
    64-bit
  • Insertion point of a block placed by an assistant

    The command-line input that places a block at a given point, scale and rotation.

    Values given to assistants and scripts agents.js
    • CadCraft
    64-bit
  • Volume printed after a 3D command

    The total volume of the solids a command just made, in drawing units cubed.

    V = Σ volumeᵢ ÷ (k × k × k)

    3D solid commands: sizes, paths and reported volume commands3d.js
    • CadCraft
    64-bit
  • Number text in 3D command messages

    How heights, radii, angles and volumes are written on the command line.

    |n| < 1e-10 → 0; otherwise n rounded to 4 decimals

    3D solid commands: sizes, paths and reported volume commands3d.js
    • CadCraft
    64-bit
  • Sweep path from a 2D object

    The points a profile is swept along, taken from a line, polyline, arc, circle or ellipse.

    n = max(2, ⌈sweep ÷ (π ÷ 24)⌉); pᵢ = c + r × (cos aᵢ, sin aᵢ), aᵢ = a₀ ± sweep × i ÷ n

    3D solid commands: sizes, paths and reported volume commands3d.js
    • CadCraft
    64-bit
  • Extrude: outline, height and taper to model units

    Converts the picked outline and the typed height and taper angle into the numbers the solid is made from.

    ring = (x × k, y × k); height = h × k; taper = degrees × π ÷ 180

    3D solid commands: sizes, paths and reported volume commands3d.js
    • CadCraft
    64-bit
  • Revolve angle

    The angle a profile is turned through; no angle means a full turn.

    θ = 2π if |angle| < 1e-9, else angle

    3D solid commands: sizes, paths and reported volume commands3d.js
    • CadCraft
    64-bit
  • Meters per unit

    The length of a meter, an international foot and a US survey foot in meters.

    m = 1; ft = 0.3048; ftUS = 1200 ÷ 3937

    Coordinate reference systems crs.js
    • CadCraft
    • BimCraft
    • CivilCraft
    Exact
  • Local system to grid and back

    Moves a point between project (ground or assumed) coordinates and grid coordinates.

    grid = to + k × R(θ) × (p − from); p = from + R(θ)ᵀ × (grid − to) ÷ k

    Coordinate reference systems crs.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Project point to longitude and latitude and back

    The longitude and latitude (WGS 84) of a project point, and the project point of a longitude and latitude.

    Coordinate reference systems crs.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Grid scale factor, convergence and elevation factor

    At a project point: the grid scale factor, the meridian convergence in degrees, the elevation factor and the combined factor.

    k_N = |p(φ+d) − p(φ−d)| ÷ (2 M d); k_E = |p(λ+d) − p(λ−d)| ÷ (2 N cos φ d); k = (k_N + k_E) ÷ 2; γ = −atan2(Δx, Δy); elevation = R ÷ (R + h), R = √(M N)

    Coordinate reference systems crs.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Local system from two control points

    The scale and rotation that carry two points known in both local and grid coordinates onto each other.

    scale = |B − A| ÷ |b − a|; rotation = atan2(grid) − atan2(local), in degrees, brought into −180 to 180

    Coordinate reference systems crs.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Ground coordinates about a base point

    A local system that scales by a combined factor about one base point, with no rotation.

    scale = combined; rotation = 0; from = to = base

    Coordinate reference systems crs.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Any system to any system

    Converts a coordinate pair from one system's definition to another's.

    Coordinate reference systems crs.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Matching a .prj to a catalog system

    Decides whether the projection in a .prj file is one of the catalog's systems, and if so uses the catalog's definition.

    |a − a′| < 1e-3; |e² − e′²| < 1e-9; distance at each of 3 probe points < 1e-3 (1e-9 for geographic)

    Coordinate reference systems crs.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Probe points for matching

    Three longitude and latitude points inside a projection's zone, used to compare two definitions.

    (λ₀, φ), (λ₀ + 0.5°, φ + 0.5°), (λ₀ − 0.5°, φ + 0.25°)

    Coordinate reference systems crs.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Linear unit of a .prj

    Decides whether a projection is in meters, international feet or US survey feet.

    |k − 1| < 1e-12 → m; |k − 0.3048| < 1e-10 → ft; |k − 1200 ÷ 3937| < 1e-10 → ftUS

    Coordinate reference systems crs.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Extent of a grid shift file

    The west, south, east and north limits, in degrees, of the area a loaded grid shift file covers.

    east = −λ_ll × 180 ÷ π; west = −(λ_ll + (n_λ − 1) × Δλ) × 180 ÷ π; north = (φ_ll + (n_φ − 1) × Δφ) × 180 ÷ π

    Coordinate reference systems crs.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • UTM zone to EPSG code

    The EPSG number of a UTM zone typed as text such as UTM 33N.

    WGS 84: 32600 + zone (north), 32700 + zone (south); NAD83: 26900 + zone; ETRS89: 25800 + zone; GDA94: 28300 + zone; GDA2020: 7800 + zone

    Coordinate reference systems crs-pick-shared.js
    • CadCraft
    • BimCraft
    • CivilCraft
    Exact
  • Linear unit of a typed definition

    Decides whether a typed projection definition is in meters, international feet, US survey feet or degrees.

    |k − 1| < 1e-12 → m; |k − 0.3048| < 1e-10 → ft; |k − 1200 ÷ 3937| < 1e-10 → ftUS

    Coordinate reference systems crs-pick-shared.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Probe points for a typed definition

    Three longitude and latitude points inside the definition's zone, used to compare it with catalog systems.

    Coordinate reference systems crs-pick-shared.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Matching a typed definition to the catalog

    Finds the catalog systems that give the same easting and northing as a typed definition.

    same projection family; |a − a′| ≤ 1e-3; |e² − e′²| ≤ 1e-9; distance at each of 3 probe points < 1e-3

    Coordinate reference systems crs-pick-shared.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Round-trip check of a typed definition

    Refuses a typed projection that does not return its own probe point.

    |inverse(forward(λ, φ)) − (λ, φ)| < 1e-6 degrees in each of λ and φ

    Coordinate reference systems crs-pick-shared.js
    • CadCraft
    • BimCraft
    • CivilCraft
    64-bit
  • Do two systems give the same coordinates

    Says whether two systems give the same easting and northing.

    same unit and distance at each of 3 probe points < 1e-3

    Coordinate reference systems crs-pick-shared.js
    • CadCraft
    • BimCraft
    • CivilCraft
    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.