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
-
Ridge direction
The direction the ridge runs, which the trusses span across.
Truss layout over a roof addons/trusscraft/lib/roofset.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Valley pairs of a roof plan
Finds pairs of valley lines that meet at a wing's ridge, with the wing's axis and reach.
Truss layout over a roof addons/trusscraft/lib/roofset.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Valley truss set
The span, rise, base height and position of each valley truss of a wing roof over a main roof.
ridge height = (W ÷ 2) tan(wing pitch); rise = d × tan(main pitch); span = 2 d tan(main pitch) ÷ tan(wing pitch)
Truss layout over a roof addons/trusscraft/lib/roofset.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Stations along the ridge
The truss stations of a roof and the stretches of each station that lie inside the outline.
bays = ceil(length ÷ spacing); u = u₀ + inset + i × step
Truss layout over a roof addons/trusscraft/lib/roofset.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
A truss from a roof section
Decides the form of the truss at a station, its design key, and the values stored for it.
common truss pitch = atan(2 × apex ÷ span)
Truss layout over a roof addons/trusscraft/lib/roofset.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Jack trusses in a hip end
The jack and corner trusses between the end wall and a girder truss, and where each bears on the girder.
count = ceil((width − 2 × inset) ÷ spacing); v = v₀ + inset + k × step
Truss layout over a roof addons/trusscraft/lib/roofset.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Member lines for the picture
The 3D end points of every member, for drawing.
Truss layout 3D picture addons/trusscraft/lib/view3d.js32-bit, display only- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
View projection
Turns 3D points into picture coordinates for a view direction.
x′ = x cos A − y sin A; y′ = −(z cos E + (x sin A + y cos A) sin E)
Truss layout 3D picture addons/trusscraft/lib/view3d.js32-bit, display only- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Picture output
Scales the projected lines to the picture size and writes them as SVG.
Truss layout 3D picture addons/trusscraft/lib/view3d.js32-bit, display only- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Height of a roof face over a point
The height of a face's plane above a plan point.
z = start + (n·p − c) ÷ speed
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-skeleton.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Solver tolerance
Sets the tolerance every merge, split and overlap test in the roof solver uses.
scale = max(1, width, depth of the outline); eps = 1e-7 × scale
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-skeleton.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Edge lines
The direction, inward normal and line offset of each eave edge.
u = (b − a) ÷ |b − a|; n = (−u_y, u_x); c = n·a
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-skeleton.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Corner velocity
How a corner of the shrinking polygon moves per unit of height.
n_a·v = v_a; n_b·v = v_b; determinant = n_a × n_b
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-skeleton.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Next event height
Finds the height at which the polygon next changes: an edge starts to move, an edge shrinks to nothing, or a reflex corner reaches another edge.
collapse: t = T + length ÷ closing rate; split: t = T + distance ÷ approach rate
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-skeleton.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Advance to the event
Moves every corner to the event height and records its path as a roof line and a face boundary.
p′ = p + v × (t_next − T)
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-skeleton.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Clean-up after an event
Merges corners that met, removes edges folded onto each other as ridges, splits a loop a corner has cut, and closes loops with no area left.
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-skeleton.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Shared part of two folded edges
The stretch two opposite edges on one line have in common, which becomes a ridge.
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-skeleton.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Face boundaries chained into polygons
Joins the boundary pieces of a face into closed loops.
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-skeleton.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Collinear points removed from a face
Drops points of a face polygon that lie on the line between their neighbors.
removed when |u × v| ÷ max(|u|, |v|) ≤ tolerance
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-skeleton.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Roof lines joined end to end
Joins the pieces of one ridge, hip or valley into a single line.
joined when ends meet within tolerance and cos θ ≥ 1 − 1e-9
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-skeleton.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Faces kept
Builds each face's plan polygon and drops slivers.
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-skeleton.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Polygon area
The signed plan area of a polygon.
A = ½ Σ (xᵢ yᵢ₊₁ − xᵢ₊₁ yᵢ)
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-skeleton.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Distance from a point to a segment
The shortest distance from a plan point to a segment.
t = clamp((p − a)·d ÷ |d|², 0, 1); distance = |p − a − d t|
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-roofplan.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Eave line and edge speeds
Moves each wall line out to the eave and sets how fast and from what height each roof edge rises.
out = overhang − fascia thickness; speed = 1 ÷ tan(pitch); start = plate − out × tan(pitch)
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-roofplan.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Slope and pitch of each face
The slope and the pitch in degrees stored on each roof face.
slope = 1 ÷ speed; pitch = atan(1 ÷ speed) in degrees
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-roofplan.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Ridge, hip or valley
Decides what each roof line is and measures its length.
len = √(Δx² + Δy² + Δz²)
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-roofplan.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Eave and rake edges
Finds the face edges that lie on the eave line, tells level eaves from sloped rakes, and measures them.
top height = face height + thickness ÷ cos(pitch)
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-roofplan.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Soffit height
The level of the soffit under each pitched eave.
z_eave = plate − out × tan(pitch); z = min(z_eave, z_eave + thickness ÷ cos(pitch) − fascia)
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-roofplan.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Roof area and line totals
The roof's sloped area, its plan area, and the total length of ridges, hips, valleys, eaves and rakes.
area = Σ |plan area of face| ÷ cos(pitch)
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-roofplan.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Outline moved out by the overhangs
The polygon with each edge moved out by its own distance.
corner = p₀ + u_prev × ((p₁ − p₀) × u) ÷ (u_prev × u)
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-roofplan.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Eave line crosses itself
Checks that the eave polygon does not cross itself and runs anticlockwise.
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-roofplan.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Roof height over a point
The height of the roof's underside above a plan point.
Roof faces, ridges and areas from an outline addons/trusscraft/lib/bim/res-roofplan.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Edges split where they cross or overlap
Finds where two wall edges cross, touch or run along each other.
t = (c − a) × s ÷ (r × s); u = (c − a) × r ÷ (r × s)
Rooms and building outline from walls addons/trusscraft/lib/bim/model-rooms.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Points matched on a grid
Decides when two split points are the same point.
key = (round(x ÷ 0.001), round(y ÷ 0.001))
Rooms and building outline from walls addons/trusscraft/lib/bim/model-rooms.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Boundary pieces
Keeps the pieces that have a wall on one side and open space on the other.
test points = middle ± n × min(0.5, length ÷ 4)
Rooms and building outline from walls addons/trusscraft/lib/bim/model-rooms.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Next piece at a joint
Chooses which boundary piece a loop follows where several meet.
a = (angle back − angle of piece), brought into (0, 2π]
Rooms and building outline from walls addons/trusscraft/lib/bim/model-rooms.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Room area and perimeter
Tells rooms from islands and gives each room its net area and full perimeter.
area = loop area − Σ hole areas; perimeter = loop + Σ hole perimeters
Rooms and building outline from walls addons/trusscraft/lib/bim/model-rooms.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Polygon area
The signed area of a loop.
A = ½ Σ (xᵢ yᵢ₊₁ − xᵢ₊₁ yᵢ)
Rooms and building outline from walls addons/trusscraft/lib/bim/model-rooms.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Polygon perimeter
The length round a loop.
P = Σ √(Δx² + Δy²)
Rooms and building outline from walls addons/trusscraft/lib/bim/model-rooms.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Polygon centroid
The center of area of a loop.
C = Σ (a + b)(a × b) ÷ (3 Σ a × b)
Rooms and building outline from walls addons/trusscraft/lib/bim/model-rooms.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Label point inside a room
A point well inside a room for its label.
Rooms and building outline from walls addons/trusscraft/lib/bim/model-rooms.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Point inside a polygon
Tests whether a plan point lies inside a polygon.
Rooms and building outline from walls addons/trusscraft/lib/bim/model-rooms.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Repeated and collinear points removed
Tidies a loop before its area is taken.
collinear when |ab × bc| ≤ 1e-7 × (|ab| |bc| + 1e-12)
Rooms and building outline from walls addons/trusscraft/lib/bim/model-rooms.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Guard on every written measure
Decides what is written when a value is missing or not a number.
DWG object values written and read dwg/objects-write.js64-bit- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
-
Arc angles brought into one turn
Brings an angle into the range from 0 up to 2π before it is written.
r = a mod 2π; r + 2π when r < 0
DWG object values written and read dwg/objects-write.js64-bit- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
-
Arc
Writes an arc's center, radius and two angles.
DWG object values written and read dwg/objects-write.js64-bit- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
-
Line
Writes a line's two end points.
DWG object values written and read dwg/objects-write.js64-bit- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
-
Polyline vertices
Writes the vertices of a lightweight polyline.
DWG object values written and read dwg/objects-write.js64-bit- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
-
Vertex widths
Writes the start and end width at a polyline vertex.
equal widths: one value, −|width|
DWG object values written and read dwg/objects-write.js64-bit- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
-
Linetype pattern length
The total length of a linetype's dash pattern.
length = Σ |element length|
DWG object values written and read dwg/objects-write.js64-bit- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
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.