<style> .reveal-up, .reveal-left, .reveal-right, .reveal-stagger > * { opacity: 1 !important; transform: none !important; } </style>
  1. Learn
  2. BIM Math
  3. Foundations
All lessons in this course

Lesson 1 of 44 10 minBeginner

Why BIM software runs on maths

A BIM model looks like walls, doors and slabs, but it is stored as a handful of numbers. See what the software computes from them, and how this course is organised.

Open a model in any BIM tool and you see walls, doors, slabs and pipes. The file does not store pictures of them. A straight wall is stored as little more than two points (its location line), a thickness, a height and a few settings. Everything else you see is calculated from those numbers, again and again, every time something changes.

Drag the two ends of the wall below. Every value in the panel, including the four corners of the outline, is computed from just the two points and the thickness.

Interactive

A wall is two points and a thickness

Drag the round handles (or focus one and use the arrow keys). Only the two points, the thickness and the height are stored; every number on the right is computed from them.

0, 0un1234AB
Stored
Start A(1.50, 1.50)
End B(7.50, 4.50)
Thickness, height0.30, 3.0
Computed
Length√(6.0² + 3.0²) =6.71 m
Direction26.6°
u (unit direction)(0.89, 0.45)
n (perpendicular)(−0.45, 0.89)
Corner 1(1.43, 1.63)
Corner 2(7.43, 4.63)
Corner 3(7.57, 4.37)
Corner 4(1.57, 1.37)
Face area20.12 m²
Volume6.04 m³
Corner = end point ± n × thickness ÷ 2. n is u turned 90°: (−u.y, u.x). Move either end and all four corners, the area and the volume follow.

The corners come from a small piece of vector maths: take the wall’s direction, turn it 90° to get the perpendicular, and step half the thickness to each side. You will write exactly that code in the Vectors module. For now, notice how much the software derives from so little data.

What a BIM tool computes all day

What you doThe maths underneathModule
Draw a wall and see its outlineDirection vectors, perpendicular offsetsVectors
Join two walls at a cornerLine–line intersectionLines and curves
Place a room and read its areaPolygon area (the shoelace formula)Planes and polygons
Host a door in a wallLocal and world coordinates, transformsMatrices and transforms
Rotate a family or a whole buildingRotation matrices and quaternionsRotations in depth
Run a clash checkBounding boxes, the separating-axis theorem3D geometry and solids
Cut a plan or a sectionPlane–mesh intersection, projection3D geometry and solids
Share coordinates with the site surveySurvey points, true north, map projectionsMaster level

A wall as data

Here is the same idea in C#. A wall is two points, a thickness and a height. Its length, face area and volume are not stored; they are computed.

WallAsData.cs
using Pt = (double X, double Y); Pt start = (0, 0);Pt end = (6, 8);double thickness = 0.2, height = 3.0; double dx = end.X - start.X, dy = end.Y - start.Y;double length = Math.Sqrt(dx * dx + dy * dy); Console.WriteLine($"Length: {length} m");Console.WriteLine($"Face area: {length * height} square metres");Console.WriteLine($"Volume: {length * thickness * height} cubic metres");
Output
Length: 10 m
Face area: 30 square metres
Volume: 6 cubic metres

Math.Sqrt(dx * dx + dy * dy) is Pythagoras: the wall runs 6 m in X and 8 m in Y, so its length is √(36 + 64) = 10 m. If the model changes either end, the length, area and volume all follow automatically. That is the core idea of parametric modelling: store the few numbers that define an element and compute the rest.

Why learn it if the software already does it?

  • Automation: as soon as you write a plug-in, a Dynamo or Grasshopper script, or an IFC tool, the software stops doing the geometry for you. You get points and vectors and have to work out the rest.
  • Debugging: “the wall join is off by half a millimetre” or “the family rotates the wrong way when mirrored” are maths bugs. Knowing the maths turns them from mysteries into five-minute fixes.
  • Performance: a clash check over a large model is millions of geometric tests. Knowing which test is cheap (a box overlap) and which is expensive (a full solid intersection) is the difference between seconds and hours.
  • Interviews: BIM and AEC software roles routinely ask about vectors, transforms and intersections.

How this course is organised

ModuleWhat you will learn
FoundationsCoordinate systems, units and tolerance, angles, trigonometry on site
VectorsPoints vs vectors, dot and cross products, your own Vec3 type
Lines and curvesParametric lines, closest points, intersections, arcs, polylines, Bézier curves
Planes and polygonsPlanes, projections, polygon area and winding, triangulation
Matrices and transformsRotation, 4×4 transforms, composing them, local vs world, mirroring
Rotations in depthEuler angles and gimbal lock, quaternions, smooth interpolation
3D geometry and solidsBounding boxes, meshes, ray casting, clash detection, volumes, sections
Master levelRobust geometry, georeferencing, cameras, B-rep and NURBS, a mini geometry engine
Quick check

A straight wall in a BIM model is mainly stored as…

Quick check

Which maths does a BIM tool need to report a room’s floor area?

Practice

Write WallVolume(Pt a, Pt b, double thickness, double height) that returns the volume of a straight wall. Print the length and volume of a wall from (2, 1) to (2, 7), 0.3 m thick and 2.7 m high, both with two decimals.

Show a hint

Compute the length with Pythagoras, then multiply by thickness and height. Format with :F2.

Show the solution
Solution.cs
using Pt = (double X, double Y); static double Length(Pt a, Pt b){    double dx = b.X - a.X, dy = b.Y - a.Y;    return Math.Sqrt(dx * dx + dy * dy);} static double WallVolume(Pt a, Pt b, double thickness, double height)    => Length(a, b) * thickness * height; Pt a = (2, 1), b = (2, 7);Console.WriteLine($"Length: {Length(a, b):F2} m");Console.WriteLine($"Volume: {WallVolume(a, b, 0.3, 2.7):F2} cubic metres");
Output
Length: 6.00 m
Volume: 4.86 cubic metres

Remember

  • BIM elements are stored as a few defining numbers; outlines, areas, volumes and views are computed from them.
  • Every everyday action in a BIM tool, from joining walls to clash checks, rests on a small set of geometric ideas.
  • Plug-ins, scripts and IFC tools have to do that geometry themselves, which is why this maths matters in practice.
  • The course goes from coordinates and vectors up to transforms, solids and georeferencing, all in plain C#.
0 of 44 lessons completed