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

  • Drawing units per job unit

    The factor that scales the cabinet job (millimeters or inches) to the drawing's unit.

    k = (25.4 or 1) ÷ mm per drawing unit

    CabinetCraft in a drawing: units, room outline and solids addons/cabinetcraft/host.js
    • CadCraft
    64-bit
  • Room area in the list

    The floor area shown beside each closed polyline offered as a room.

    area = |Σ (xᵢ·yᵢ₊₁ − xᵢ₊₁·yᵢ)| ÷ 2 ÷ 1e6 m²; shown as round(area × 100) ÷ 100

    CabinetCraft in a drawing: units, room outline and solids addons/cabinetcraft/host.js
    • CadCraft
    64-bit
  • Door and window openings read from blocks

    The position and width of each door or window block near the room.

    w = max(box width, box height) × f, limited to 300…3000 mm; position = insertion point × f

    CabinetCraft in a drawing: units, room outline and solids addons/cabinetcraft/host.js
    • CadCraft
    64-bit
  • Where the sheets are drawn

    The point in the drawing where the shop drawing sheets start.

    intended: x = right edge of what is drawn + 0.3 × tallest sheet; y = its top edge

    CabinetCraft in a drawing: units, room outline and solids addons/cabinetcraft/host.js
    • CadCraft
    64-bit
  • Cabinet solids for the 3D tab

    The faces of each cabinet as polygons in drawing units.

    point = (x ÷ f, y ÷ f, z ÷ f)

    CabinetCraft in a drawing: units, room outline and solids addons/cabinetcraft/host.js
    • CadCraft
    64-bit
  • Turning a direction

    A direction turned by an angle in degrees.

    (x·cos a − y·sin a, x·sin a + y·cos a), each rounded to 6 decimals

    Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Turn between two walls

    The signed angle from one wall direction to the next, in degrees.

    atan2(u₀ × u₁, u₀ · u₁) × 180 ÷ π

    Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • End of a wall typed as length and angle

    The end point of a wall from its start, length and angle.

    (x + L·cos a, y + L·sin a), rounded to 6 decimals

    Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • End of an arc typed as radius and sweep

    The end point of an arc wall from its radius, sweep and the heading of its chord.

    chord = 2·R·sin(|sweep| ÷ 2); end = start + chord at the heading

    Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Sagitta

    How far the middle of a straight back of width w stands off a circle of radius r.

    s = r − √(r² − w² ÷ 4)

    Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Arc through three points

    The radius, center and signed sweep of the arc picked as start, middle and end.

    d = 2·(aₓ(bᵧ − cᵧ) + bₓ(cᵧ − aᵧ) + cₓ(aᵧ − bᵧ)); uₓ = Σ |p|²·(Δy) ÷ d; uᵧ = Σ |p|²·(Δx) ÷ d; r = |a − u|

    Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Arc from two ends and a sweep

    The radius, center, chord, arc length and sagitta of an arc wall.

    r = chord ÷ (2·sin(θ ÷ 2)); center = middle ± normal × r·cos(θ ÷ 2); arc length = r·θ; sagitta = r·(1 − cos(θ ÷ 2))

    Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Points along an arc wall

    An arc wall as n straight pieces.

    φᵢ = a₀ ± |θ|·i ÷ n; point = center + r·(cos φ, sin φ), rounded to 6 decimals

    Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Back line and half angle of each cabinet on an arc

    The radius of each cabinet's back line and the half angle it takes up.

    bay: H = √(R² − w² ÷ 4); bow or curved front: H = R; half angle = atan2(w ÷ 2, H), or w ÷ (2R) for a curved front; front radius = H − d

    Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Gaps and wedges between stepped cabinets

    The largest gap between each cabinet's back and the curve, and the wedge left between neighbors.

    bay gap = R − H; bow gap = √(R² + w² ÷ 4) − R; wedge back and front = distance between neighboring corners

    Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Length used along the arc

    How much of the arc the cabinets take, and by how much the last one passes the end.

    used = (end angle − start angle) × R; overflow = max(0, end angle − limit) × R

    Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Stop short of an angled corner

    How far a run of cabinets must stop before a convex corner.

    τ ≤ 90°: depth × sin τ; sharper: depth

    Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Void at an angled corner

    The right-triangle void left where a run stops short of an angled corner.

    leg₁ = d·sin τ; leg₂ = d·cos τ; area = leg₁·leg₂ ÷ 2

    Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Diagonal corner cabinet at any angle

    The outline, miter, front length and area of a diagonal-front corner cabinet at a corner of turn τ.

    ℓ = w − d·tan(τ ÷ 2); front = 2·ℓ·cos(τ ÷ 2); apex = 180° − τ; miter angle = 90° − τ ÷ 2; Q = (w − d·tan(τ ÷ 2), d)

    Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Area of a footprint

    The area of a polygon.

    A = |Σ (xᵢ·yᵢ₊₁ − xᵢ₊₁·yᵢ)| ÷ 2

    Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • A board along a slanted line

    The four corners of a door or plinth board that runs along a diagonal.

    n = (−Δy, Δx) ÷ L; corner = point + n × offset, rounded to 6 decimals

    Corner cabinets: parts and solids addons/cabinetcraft/lib/corner.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Round shelf solid

    The outline of a lazy-susan shelf as drawn in 3D.

    20 points at (cx + r·cos(2πi ÷ 20), cy + r·sin(2πi ÷ 20))

    Corner cabinets: parts and solids addons/cabinetcraft/lib/corner.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Open leg of a corner cabinet

    The basic sizes of a corner cabinet: width, depth, open leg and top height.

    a = w − d; top = kick + box height

    Corner cabinets: parts and solids addons/cabinetcraft/lib/corner.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Lazy-susan shelf size and place

    The diameter and center of the round shelves and the pole they turn on.

    diameter = max(1, w − 2·(t + 70 mm)); clearance = back setback + back thickness + 12 mm; center = (w − r − clearance, r + clearance); pole = center ± 15

    Corner cabinets: parts and solids addons/cabinetcraft/lib/corner.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Shelf heights

    The height of each shelf inside the cabinet.

    z = kick + t + (inside height) × (i + 1) ÷ (n + 1) − t ÷ 2

    Corner cabinets: parts and solids addons/cabinetcraft/lib/corner.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Sizes entered in the cut list

    The length and width of each board as they go into the cut list.

    length, width → round(v × 1e6) ÷ 1e6

    Corner cabinets: parts and solids addons/cabinetcraft/lib/corner.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Back panels

    The size of the two back panels for a grooved, between or applied back.

    grooved: height = box height − 2t + 2·groove, length + groove; between: height = box height − 2t; applied: full height and width

    Corner cabinets: parts and solids addons/cabinetcraft/lib/corner.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Door and plinth sizes at a right-angled corner

    The door height and width and the plinth length of a corner cabinet.

    door height = box height − reveal; door width = a − reveal (L) or a·√2 − reveal (diagonal); plinth = a or a·√2

    Corner cabinets: parts and solids addons/cabinetcraft/lib/corner.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Blank for the triangle of an angled corner

    The smallest rectangle the triangular filler of an angled corner cabinet can be cut from, and the true front length.

    axes along the triangle's first leg and across it; L = largest coordinate along, W = largest across; front = |F_B − F_A|

    Corner cabinets: parts and solids addons/cabinetcraft/lib/corner.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Door and plinth sizes at an angled corner

    The door and plinth of a diagonal corner cabinet at a corner that is not a right angle.

    door width = front length − reveal; plinth = front length

    Corner cabinets: parts and solids addons/cabinetcraft/lib/corner.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Mirrored corner cabinet

    The same cabinet for a corner at the start of a run.

    x → w − x, rounded to 6 decimals

    Corner cabinets: parts and solids addons/cabinetcraft/lib/corner.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Rounding to 4 decimals

    Rounds a coordinate to 4 decimals.

    r4(v) = round(v × 1e4) ÷ 1e4

    Cabinet shop drawings as drawing objects addons/cabinetcraft/lib/cadents.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Drawing item to drawing object

    A line, outline or text of a shop drawing as a CadCraft object.

    x, y, text height → r4; text rotation = degrees × π ÷ 180

    Cabinet shop drawings as drawing objects addons/cabinetcraft/lib/cadents.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Dimensions

    The linear dimensions of a shop drawing as dimension objects.

    p₁, p₂ → r4; line position = p + offset → r4; dimension scale = max(0.01, text height ÷ 2.5) → r4

    Cabinet shop drawings as drawing objects addons/cabinetcraft/lib/cadents.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Scaling to the drawing's unit

    Every coordinate, text height and dimension scale multiplied by the drawing units per job unit.

    v → r4(v × k)

    Cabinet shop drawings as drawing objects addons/cabinetcraft/lib/cadents.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Scaling all sheets

    All blocks and sheets scaled to the drawing's unit.

    k = 1 → unchanged; else every block and sheet through scaleEnts, sheet w and h × k

    Cabinet shop drawings as drawing objects addons/cabinetcraft/lib/cadents.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Moving a sheet into place

    The objects of a sheet moved by an offset.

    x → r4(x + dx); y → r4(y + dy)

    Cabinet shop drawings as drawing objects addons/cabinetcraft/lib/cadents.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Triangles of a panel outline

    Cuts a panel's outline into triangles for drawing.

    ear when (b − a) × (c − a) > 1e-9 and no other point is inside the triangle

    Cabinets as 3D viewport bodies addons/cabinetcraft/lib/bodies3d.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    32-bit, display only
  • Room coordinates to viewport coordinates

    A point of the room in the viewport's axes and millimeters.

    k = 25.4 (inch job) or 1; (x, y, z) → (x·k, z·k, −y·k)

    Cabinets as 3D viewport bodies addons/cabinetcraft/lib/bodies3d.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    32-bit, display only
  • Board corners in the blank's own frame

    Turns a board's corners from the cabinet frame into the frame of its blank, and takes the blank's length and width.

    x′ = (p − o)·uₓ; y′ = (p − o)·u_y; L = max x′; W = max y′

    Corner cabinet drilling positions addons/cabinetcraft/lib/cornerdrill.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Arm boards and triangle of a corner cabinet

    The outlines of the bottom and top boards for each corner form, from the cabinet's width, depth and panel thickness.

    Corner cabinet drilling positions addons/cabinetcraft/lib/cornerdrill.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Joint lines two boards share

    Finds where an edge of one board lies along an edge of another, and the length of the overlap.

    offset = (q − p₀) × u; s = (q − p₀)·u; overlap = [max(0, min s), min(L, max s)]

    Corner cabinet drilling positions addons/cabinetcraft/lib/cornerdrill.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • System hole grid along a side

    The positions of the system holes along a side panel.

    x = sysStart, sysStart + pitch, … while x ≤ len − sysStart

    Corner cabinet drilling positions addons/cabinetcraft/lib/cornerdrill.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Hinge plate holes

    Places the two plate holes of each hinge on the system grid of the side panel.

    center = reveal ÷ 2 + hinge spot; first hole = grid hole nearest (center − pitch ÷ 2); second = first + pitch

    Corner cabinet drilling positions addons/cabinetcraft/lib/cornerdrill.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Fixing holes along a joint

    Places the dowel or cam holes on the edge two boards share, in each board's own frame.

    P = p + (q − p) ÷ len × u, u = sysStart and len − sysStart, or len ÷ 2

    Corner cabinet drilling positions addons/cabinetcraft/lib/cornerdrill.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Edge holes kept on the blank

    Moves an edge hole back onto the blank when the cut part is a little smaller than the drawn board.

    x = min(max(x, 0), part length); y = min(max(y, 0), part width)

    Corner cabinet drilling positions addons/cabinetcraft/lib/cornerdrill.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Corners of a rectangle, L or U room

    The corner list of a room from its width, depth and notch.

    U notch start a = (W − notch w) ÷ 2

    Room outline, walls and openings addons/cabinetcraft/lib/room.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Right-angled outline made safe

    Checks a typed outline with right angles, drops repeated and collinear corners, makes it counter-clockwise and moves it to (0, 0).

    2A = Σ (xᵢ yᵢ₊₁ − xᵢ₊₁ yᵢ); reject when |2A| < 1

    Room outline, walls and openings addons/cabinetcraft/lib/room.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Do two edges cross

    Decides whether two outline edges properly cross.

    o(p, q, r) = (q − p) × (r − p); cross when the signs differ on both segments

    Room outline, walls and openings addons/cabinetcraft/lib/room.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    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.