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
-
Where two contour segments cross
The crossing point of two segments, or none when they are parallel or only meet at an end.
d = (q − p) × (s − r); t = (r − p) × (s − r) ÷ d; point = p + t·(q − p)
Ground surface from contour lines and points ground-surface.js64-bit- CivilCraft
-
Contour checks
Lists lines with no elevation, elevations off the interval, duplicate lines and lines that cross.
k = (z − base) ÷ interval; off the interval when |k − round(k)| > 1e-6
Ground surface from contour lines and points ground-surface.js64-bit- CivilCraft
-
Line simplification
Removes contour vertices that lie within a tolerance of the line through their neighbors.
distance = |(p − a) × (b − a)| ÷ |b − a|
Ground surface from contour lines and points ground-surface.js64-bit- CivilCraft
-
Placing by two known points
The scale, rotation and shift that take two picked points to their real positions.
k = |b₂ − a₂| ÷ |b − a|; rot = atan2(d₂) − atan2(d₁); x′ = k·(x cos rot − y sin rot) + t_x
Ground surface from contour lines and points ground-surface.js64-bit- CivilCraft
-
Points inside flat triangles
An estimated elevation at the centroid of each triangle whose three corners are on one contour.
z = z₀ − (z_apex − z₀) ÷ h_n × (h ÷ 3), averaged over contour edges; limited to z₀ ± interval ÷ 2
Ground surface from contour lines and points ground-surface.js64-bit- CivilCraft
-
Building the ground surface
Thins the points when a spacing is given, triangulates with the breaklines, and repeats the flat-triangle fill-in up to three times.
Ground surface from contour lines and points ground-surface.js64-bit- CivilCraft
-
Catchment area
The area of a catchment polygon in acres or hectares.
A = |Σ (x_j + x_i)(y_j − y_i)| ÷ 2; ÷ 43560 for acres, ÷ 10000 for hectares
Storm drainage: rational method, pipe sizing and grade lines hydro.js64-bit- CivilCraft
-
Rainfall intensity
The design rainfall intensity for a time of concentration.
i = a ÷ (tc + b)^c
Storm drainage: rational method, pipe sizing and grade lines hydro.js64-bit- CivilCraft
-
Manning factor and gravity
The unit factor in Manning's equation and the acceleration of gravity used for velocity head.
k = 1 (m) or 1.486 (ft); g = 9.81 (m) or 32.174 (ft)
Storm drainage: rational method, pipe sizing and grade lines hydro.js64-bit- CivilCraft
-
Full-pipe capacity
The flow and velocity of a circular pipe running full.
Q = (k ÷ n) × A × R^(2/3) × √S; A = πD² ÷ 4; R = D ÷ 4
Storm drainage: rational method, pipe sizing and grade lines hydro.js64-bit- CivilCraft
-
Part-full pipe section
The flow area, wetted perimeter and top width of a circular pipe flowing to a given depth.
θ = 2·acos(1 − 2y ÷ D); A = D² ÷ 8 × (θ − sin θ); P = Dθ ÷ 2; T = D sin(θ ÷ 2)
Storm drainage: rational method, pipe sizing and grade lines hydro.js64-bit- CivilCraft
-
Normal depth
The depth at which a pipe carries a given flow at its own slope.
solve (k ÷ n) × A(y) × (A(y) ÷ P(y))^(2/3) × √S = Q for y
Storm drainage: rational method, pipe sizing and grade lines hydro.js64-bit- CivilCraft
-
Design flow in each pipe
Accumulates C × A downstream, takes the longest time of concentration, and gives each pipe its flow.
Q = ΣCA × i(tc) (cfs, acres); Q = ΣCA × i(tc) ÷ 360 (m³/s, hectares); travel = L ÷ V ÷ 60
Storm drainage: rational method, pipe sizing and grade lines hydro.js64-bit- CivilCraft
-
Pipe size
The smallest standard diameter whose full-flow capacity is at least the design flow.
Storm drainage: rational method, pipe sizing and grade lines hydro.js64-bit- CivilCraft
-
Hydraulic and energy grade lines
The water level and energy level at each end of each pipe and at each structure, from the outlet upstream.
S_f = (Q·n ÷ (k·A·R^(2/3)))²; HGL_up = max(HGL_dn + S_f·L, invert + D) when full, else invert + y_n; h_v = V² ÷ 2g; structure = HGL_up + k_j·h_v
Storm drainage: rational method, pipe sizing and grade lines hydro.js64-bit- CivilCraft
-
Mesh with shared vertices
Builds a triangle mesh in which points with the same coordinates become one vertex.
IFC export: geometry and quantities gathered from the project ifc-civil-model.js64-bit- CivilCraft
-
Surface area of a mesh
The area of a corridor part or slope, as the sum of its triangles.
area = Σ |(b − a) × (c − a)| ÷ 2
IFC export: geometry and quantities gathered from the project ifc-civil-model.js64-bit- CivilCraft
-
Vertical alignment segments
Splits a design profile into constant grades and parabolic curves, clipped to the alignment, with each segment's start elevation and grades.
IFC export: geometry and quantities gathered from the project ifc-civil-model.js64-bit- CivilCraft
-
Alignment as a 3D polyline
Samples the centerline into points with stations and design elevations.
step = max(length ÷ 400, 1 m or 3 ft); angle limit 1°
IFC export: geometry and quantities gathered from the project ifc-civil-model.js64-bit- CivilCraft
-
Corridor parts and their areas
Joins neighboring cross sections into surfaces per part and side, and measures each surface.
area = mesh area; length = to station − from station
IFC export: geometry and quantities gathered from the project ifc-civil-model.js64-bit- CivilCraft
-
Pavement course solids
A closed solid for each pavement course: the part's top edges lowered straight down by the depth of the course's top and bottom.
z = z_edge − depth; depth of a course's top = Σ thickness of the courses above
IFC export: geometry and quantities gathered from the project ifc-civil-model.js64-bit- CivilCraft
-
Rail cross section in project units
The outline of a rail (head, web, foot) from its section sizes in millimeters.
k = 0.001 (m) or 0.001 ÷ 0.3048006096 (ft); head height = 0.27 h; foot height = 0.12 h
IFC export: geometry and quantities gathered from the project ifc-civil-model.js64-bit- CivilCraft
-
Rails, sleepers and ballast
Places the rail outline on each section turned to the track's cross slope, and sets sleepers along each track at their spacing.
o′ = o·cos(atan s) − z·sin(atan s); z′ = o·sin(atan s) + z·cos(atan s); sleeper k at distance k × spacing
IFC export: geometry and quantities gathered from the project ifc-civil-model.js64-bit- CivilCraft
-
Solid orientation
Decides whether a closed mesh's triangles face outward, and flips them if not.
V = Σ a · (b × c); flip when V < 0
IFC export: geometry and quantities gathered from the project ifc-civil-model.js64-bit- CivilCraft
-
Retaining wall solids and volume
A closed solid for each wall run with its length, heights, face area and volume.
volume = face area × thickness
IFC export: geometry and quantities gathered from the project ifc-civil-model.js64-bit- CivilCraft
-
Pad top, slopes and area
The pad's top surface, its cut and fill slope surfaces and its plan area.
area = |Σ (x_i·y_j − x_j·y_i)| ÷ 2
IFC export: geometry and quantities gathered from the project ifc-civil-model.js64-bit- CivilCraft
-
Superelevation event stations
The stations at which lane slopes are written as superelevation events.
IFC export: geometry and quantities gathered from the project ifc-civil-model.js64-bit- CivilCraft
-
Structure floor and pipe sizes
The floor level of a manhole or inlet and the pipe diameter and plan length written for the network.
floor = sump level, else rim − 1.5 m or rim − 5 ft; D = size ÷ 1000 or ÷ 12; L = hypot(Δx, Δy)
IFC export: geometry and quantities gathered from the project ifc-civil-model.js64-bit- CivilCraft
-
Parcel outline with arcs as chords
The parcel boundary as points, with each curved course replaced by short chords.
n = max(2, ⌈Δ ÷ (π ÷ 36)⌉); point k = center + R·(cos, sin)(a₀ + turn·Δ·k ÷ n)
IFC export: geometry and quantities gathered from the project ifc-civil-model.js64-bit- CivilCraft
-
Assembly description text
The road assembly written as words and numbers in the IFC properties.
IFC export: geometry and quantities gathered from the project ifc-civil-model.js64-bit- CivilCraft
-
A real number as IFC text
Formats every number the export writes.
text = v.toFixed(d) with trailing zeros removed; d = 6 unless stated
IFC export: numbers written to the file ifc-civil.js64-bit- CivilCraft
-
Points and directions
Writes a Cartesian point and a direction.
IFC export: numbers written to the file ifc-civil.js64-bit- CivilCraft
-
File origin
The local origin that coordinates are written from: the middle of the content rounded to 100 units.
origin = round((min + max) ÷ 200) × 100
IFC export: numbers written to the file ifc-civil.jsExact- CivilCraft
-
Unit factor to SI
Meters per file unit, and the conversion of areas and volumes to square and cubic meters.
um = 1, 0.3048 or 1200 ÷ 3937; m² = a × um²; m³ = v × um³
IFC export: numbers written to the file ifc-civil.jsExact- CivilCraft
-
Conversion factor in the file
Writes the foot's length in meters into the file's unit definition.
IFC export: numbers written to the file ifc-civil.js64-bit- CivilCraft
-
Property values and quantities
Writes lengths, areas, volumes, ratios, speeds and counts in property sets and quantity sets.
IFC export: numbers written to the file ifc-civil.js64-bit- CivilCraft
-
Surface area written with a mesh
The area of a surface, corridor part or slope in square meters.
area = Σ |(b − a) × (c − a)| ÷ 2 × um²
IFC export: numbers written to the file ifc-civil.js64-bit- CivilCraft
-
Triangle meshes
Writes a surface or solid as a point list and triangles.
x′ = x − origin_x, written with 6 decimals
IFC export: numbers written to the file ifc-civil.js64-bit- CivilCraft
-
Site latitude and longitude
Writes a latitude or longitude as degrees, minutes, seconds and millionths of a second.
IFC export: numbers written to the file ifc-civil.js64-bit- CivilCraft
-
Map conversion
The grid easting and northing of the file origin, and the rotation and scale of a local ground system.
E₀ = to_x + s·(cos r·Δx − sin r·Δy); N₀ = to_y + s·(sin r·Δx + cos r·Δy)
IFC export: numbers written to the file ifc-civil.js64-bit- CivilCraft
-
PI and PVI tables as text
Writes each alignment's PIs and PVIs into a property set, which is what CivilCraft reads back from IFC4 and IFC2x3 files.
IFC export: numbers written to the file ifc-civil.js64-bit- CivilCraft
-
Continuity between horizontal segments
Decides whether two neighboring segments are written as continuous, same direction, or same direction and curvature.
IFC export: numbers written to the file ifc-civil.js64-bit- CivilCraft
-
Spiral terms
The constants of Bloss, cosine, sine and Helmert transition curves.
A_i = L × |a_i|^(−1/n) × sign a_i; f = L ÷ R₁ − L ÷ R₀; a₀ = L ÷ R₀
IFC export: numbers written to the file ifc-civil.js64-bit- CivilCraft
-
Clothoid constant
The constant A of a clothoid transition.
A = L ÷ √|f| × sign f
IFC export: numbers written to the file ifc-civil.js64-bit- CivilCraft
-
Cubic parabola coefficient
The coefficient of y = x³ ÷ (6·R·Lp) for a cubic transition.
A₃ = 1 ÷ (6 × R × Lp)
IFC export: numbers written to the file ifc-civil.js64-bit- CivilCraft
-
Horizontal segment parameters
Writes a segment's start point, start direction, radii and length.
IFC export: numbers written to the file ifc-civil.js64-bit- CivilCraft
-
Vertical segment parameters and curve
Writes each grade or vertical curve: start distance, height, gradients, and the curve as a line or a polynomial.
C = (g₁ − g₀) ÷ (2L); line length = L ÷ cos(atan g₀); curve length = parabola length
IFC export: numbers written to the file ifc-civil.js64-bit- CivilCraft
-
Length along a parabola
The true length of a vertical curve y = A + Bx + Cx² over its horizontal length.
F(x) = (d·√(1 + d²) + asinh d) ÷ 4C, d = B + 2Cx; length = F(L) − F(0)
IFC export: numbers written to the file ifc-civil.js64-bit- CivilCraft
-
Cant axis
The leaning axis of a cant segment from the height difference of the two rails.
dy = 2 × half difference; dz = √(max(0, base² − dy²)); axis = (0, dy ÷ base, dz ÷ base)
IFC export: numbers written to the file ifc-civil.js64-bit- CivilCraft
-
Helmert cant halves
The two second-order spirals of a Helmert cant transition and the slope where they meet.
slope = (L ÷ 2)² × (2·(L ÷ 2) ÷ A₂³)
IFC export: numbers written to the file ifc-civil.js64-bit- 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.