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.
Calculations
-
Height and areas of a mass
The height, footprint area and gross floor area written in the mass's properties.
H = floors × floor height; footprint (m²) = A × um²; gross = A × floors × um²
Building masses as IFC ifc-massing.js64-bit- CivilCraft
-
Simple curb return
The circular arc joining two pavement edges at a corner: tangent points, center, arc length.
ψ = acos(a · b); T = r ÷ tan(ψ ÷ 2); center = corner + bisector × r ÷ sin(ψ ÷ 2); length = r × |Δ|
Road intersections, striping and signs intersection.js64-bit- CivilCraft
-
Three-center curb return
A compound curve of three arcs (radii 2r, r, 2r by default) between two pavement edges.
angles = share·Δ, (1 − 2·share)·Δ, share·Δ; T = p_x − p_y·cos h ÷ sin h; length = Σ chord lengths
Road intersections, striping and signs intersection.js64-bit- CivilCraft
-
Intersection outline, area and curb length
The closed pavement edge of an intersection, its area and the total length of its curb returns.
corner: p_a + s·d_a = p_b + t·d_b, s = ((p_b − p_a) × d_b) ÷ (d_a × d_b); area = |shoelace(outline)|
Road intersections, striping and signs intersection.js64-bit- CivilCraft
-
Polygon area
The signed area of an outline.
A = Σ (x_i·y_j − x_j·y_i) ÷ 2
Road intersections, striping and signs intersection.js64-bit- CivilCraft
-
Intersection sight distance
The sight distance along the major road for a driver turning out of the minor road, in meters.
ISD = 0.278 × V × (t_g + 0.5 × extra lanes)
Road intersections, striping and signs intersection.js64-bit- CivilCraft
-
Sight triangle
The three corners of the sight triangle from the driver's position and the two leg lengths.
Road intersections, striping and signs intersection.js64-bit- CivilCraft
-
Obstacles in the sight triangle
Which obstacle outlines reach into the sight triangle.
Road intersections, striping and signs intersection.js64-bit- CivilCraft
-
Offset line
A polyline moved sideways by a distance, with mitred corners.
corner shift = d × min(4, 1 ÷ max(cos(half turn), 0.25)) along the mitre
Road intersections, striping and signs intersection.js64-bit- CivilCraft
-
Part of a line between two distances
Cuts a polyline to the stretch between two distances along it.
Road intersections, striping and signs intersection.js64-bit- CivilCraft
-
Dash positions
The painted lengths of a dashed line.
dash k starts at from − phase + k × (dash + gap)
Road intersections, striping and signs intersection.js64-bit- CivilCraft
-
Striping and its quantities
Lays out center, lane and edge lines and totals the painted length and painted area.
length per kind = Σ line lengths; painted area = Σ length × width
Road intersections, striping and signs intersection.js64-bit- CivilCraft
-
Crosswalk bars
The number and position of crosswalk bars across a road.
count = max(1, ⌊(width + gap) ÷ (bar + gap)⌋); bar i starts at −used ÷ 2 + i × (bar + gap)
Road intersections, striping and signs intersection.js64-bit- CivilCraft
-
Sign positions
The plan position and facing of each sign from its station, side and offset.
position = point at station + normal × side × offset; repeating signs every `every` from `from`
Road intersections, striping and signs intersection.js64-bit- CivilCraft
-
Road quantities
Totals intersection pavement area, curb return length, striping length, painted area and sign count.
Road intersections, striping and signs intersection.js64-bit- CivilCraft
-
A number as LandXML text
Formats every number the export writes.
text = v.toFixed(d) with trailing zeros removed; d = 6 unless stated
LandXML export and import landxml.js64-bit- CivilCraft
-
Northing, easting and elevation
Writes a point as northing, easting and elevation.
LandXML export and import landxml.js64-bit- CivilCraft
-
Spiral element
Writes a transition curve: length, radii, station, angle, total X and Y, long and short tangents, constant.
theta (degrees) = θ × 180 ÷ π; constant = √(r × L_s)
LandXML export and import landxml.js64-bit- CivilCraft
-
Curve element
Writes a circular curve: radius, length, station, chord, delta, tangent, external and middle ordinate.
delta (degrees) = Δ × 180 ÷ π
LandXML export and import landxml.js64-bit- CivilCraft
-
Existing-ground profile
Writes the ground line along an alignment as station and elevation pairs.
LandXML export and import landxml.js64-bit- CivilCraft
-
Surface definition
Writes a surface's plan area, surface area and highest and lowest elevations, then its points and faces.
LandXML export and import landxml.js64-bit- CivilCraft
-
Pipe length and slope
Writes each pipe's plan length and slope.
length = hypot(Δx, Δy); slope = (invert up − invert down) ÷ length
LandXML export and import landxml.js64-bit- CivilCraft
-
Feature-line arc from a bulge
The center, radius, sweep and length of an arc segment of a feature line.
k = (1 − b²) ÷ 4b; r = c(1 + b²) ÷ 4|b|; sweep = 4·atan b; L = r × |sweep|
LandXML export and import landxml.js64-bit- CivilCraft
-
Reading numbers
Splits a text list on spaces and commas and parses each number.
LandXML export and import landxml.js64-bit- CivilCraft
-
Units of a file
Decides whether the file is metric or in feet from its linear unit.
LandXML export and import landxml.jsExact- CivilCraft
-
Alignment elements to PIs
Turns lines, curves and spirals into PIs with radius and spiral lengths.
PI = p₁ + d₁·a, a = ((p₂ − p₁) × d₂) ÷ (d₁ × d₂)
LandXML export and import landxml.js64-bit- CivilCraft
-
PI of a plain curve without one
Where the tangents at a curve's start and end meet, from its center.
LandXML export and import landxml.js64-bit- CivilCraft
-
Curve to bulge
The bulge of a feature-line arc from its start, center and end.
sweep = (a₁ − a₀) mod 2π; bulge = ± tan(sweep ÷ 4)
LandXML export and import landxml.js64-bit- CivilCraft
-
Sump depth of a structure
The depth of a structure's sump below its lowest pipe invert.
sump depth = max(0, lowest invert − sump elevation)
LandXML export and import landxml.js64-bit- CivilCraft
-
Joining feature-line pieces
Joins consecutive lines and curves of a plan feature into one line.
LandXML export and import landxml.js64-bit- CivilCraft
-
Scaling an import to project units
Multiplies every coordinate, elevation, station, radius and length of an import by one factor.
LandXML export and import landxml.js64-bit- CivilCraft
-
Mass ordinate
The running total of earth along the alignment, and the cut and fill totals.
m_i = m_(i−1) + cut_i × factor − fill_i
Mass-haul diagram masshaul.js64-bit- CivilCraft
-
Balance points
The stations where the mass ordinate crosses zero.
sta = sta_a + (sta_b − sta_a) × m_a ÷ (m_a − m_b)
Mass-haul diagram masshaul.js64-bit- CivilCraft
-
Volume moved and average haul
For each balanced stretch, the volume moved and the average distance it travels.
volume = |peak| − |end level|; haul = ∫ (|m| − |end level|)⁺ d(sta) ÷ volume
Mass-haul diagram masshaul.js64-bit- CivilCraft
-
Totals and what is left over
Total cut, adjusted cut, fill, the end ordinate, and whether the job wastes, borrows or balances.
balanced when |end| < 1e-6 × max(1, cut + fill)
Mass-haul diagram masshaul.js64-bit- CivilCraft
-
CSV export
Writes the stations, ordinates and spans as a CSV file in cubic yards or cubic meters.
cubic yards = cubic feet ÷ 27
Mass-haul diagram masshaul.js64-bit- CivilCraft
-
Footprint and floor area of an option
The footprint area and gross floor area of each alternative, in square meters.
area (m²) = |A| ÷ 10⁶; gross = area × floors
Massing options placed on a lot massing-options.js64-bit- CivilCraft
-
Is the footprint a simple polygon
Refuses a footprint whose edges cross.
Massing options placed on a lot massing-options.js64-bit- CivilCraft
-
Turning and moving a footprint
Rotates a footprint about its centroid and moves it to a position.
x′ = t_x + (x − c_x)·cos a − (y − c_y)·sin a; y′ = t_y + (x − c_x)·sin a + (y − c_y)·cos a
Massing options placed on a lot massing-options.js64-bit- CivilCraft
-
Placing an option in the envelope
The position and rotation at which as much of the footprint as possible lies inside the buildable envelope.
k = 0.001 ÷ meters per project unit; inside = area(envelope ∩ footprint) ÷ area(footprint)
Massing options placed on a lot massing-options.js64-bit- CivilCraft
-
Option to a mass
Makes a project mass from a placed option, with its floor height in project units.
floor height = mm × 0.001 ÷ meters per project unit
Massing options placed on a lot massing-options.js64-bit- CivilCraft
-
Envelope file
Writes the buildable envelope in millimeters, turned so its longest edge lies along x.
mm = meters per project unit × 1000; value = round(v × 10) ÷ 10
Massing options placed on a lot massing-options.js64-bit- CivilCraft
-
Footprint area
The signed area of a mass outline.
A = Σ (x_i·y_j − x_j·y_i) ÷ 2
Building mass areas, levels and base earthwork massing.js64-bit- CivilCraft
-
Gross floor area and height
The floor area of all floors and the height of the mass.
GFA = |A| × floors; height = floors × floor height
Building mass areas, levels and base earthwork massing.js64-bit- CivilCraft
-
Centroid
The center of area of the outline.
c_x = Σ (x_i + x_j)·k_ij ÷ 6A, k_ij = x_i·y_j − x_j·y_i
Building mass areas, levels and base earthwork massing.js64-bit- CivilCraft
-
Ground under a mass
The lowest, highest and mean ground elevation under the footprint, and the samples used for earthwork.
sample (i, j) at x₀ + (i + 0.5)·dx, y₀ + (j + 0.5)·dy; dA = |A| ÷ samples; mean = Σ z ÷ n
Building mass areas, levels and base earthwork massing.js64-bit- CivilCraft
-
Ground floor level
The level the mass is set at: the mean ground, the highest ground (podium) or the lowest (cut in).
Building mass areas, levels and base earthwork massing.js64-bit- CivilCraft
-
Cut and fill under a mass
The earth to remove above the ground floor level and to place below it.
fill = Σ (z₀ − z)·dA where z < z₀; cut = Σ (z − z₀)·dA otherwise
Building mass areas, levels and base earthwork massing.js64-bit- CivilCraft
-
Floor levels
The elevation of each floor and its top.
z_i = z₀ + i × floor height
Building mass areas, levels and base earthwork massing.js64-bit- CivilCraft
-
Floors for a pulled height
The floor count nearest to a height set by push and pull.
floors = clamp(round(H ÷ floor height), 1, 200)
Building mass areas, levels and base earthwork massing.jsExact- CivilCraft
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.