Alignment

What the alignment matrix on a version is, what it is not (a geo reference, an edit), how the viewers apply it, and when to use it.

Two models of one building should sit on top of each other when loaded together. Often they do not: one team exported from a project origin at 0,0, another in survey coordinates, a third with the building rotated to the sheet. The Alignment is BIM.works's answer for that case. This page explains what it is, and — more importantly — what it is not, because two other mechanisms look similar and are not interchangeable.

The problem#

IFC models carry their own placement: every object is positioned relative to its storey, the storey relative to the building, the building relative to the site, the site relative to the project origin. Two files agree on where things are only if their authors agreed on the project origin and orientation, which happens within one office and rarely between offices. When the 3D viewer loads two such files in LOCAL mode, each is placed by its own coordinates and they land wherever their origins put them.

Correcting the files is the proper fix and often impossible: the files come from someone else, on a schedule, and a re-export would carry the same offset. What is needed is a correction that lives on the BIM.works side, per model, and survives re-uploads of the same discipline.

What the matrix is#

The alignment is a 4×4 transformation matrix stored on a Version: sixteen numbers in column-major order, a translation, rotation and — if you insist — scale that the viewers apply to every vertex of that version after the model's own placement and before the viewer's LOCAL or GEO placement. It is set through one API call and read through another, with null meaning no alignment; the UI's manual alignment tools (MODEL_ALIGNMENT) let a user drag a model into place and store the result. Set the alignment shows the calls.

Because it is applied in the viewer's placement pipeline, everything that depends on where a model appears follows it: picking, measurements, section planes, bounding boxes, view fitting, the 2D plans. And because it is stored per version, a new version of the same model does not inherit it automatically — the new export may or may not have the same offset, and that decision is yours.

What it is not#

The alignment is not a geo reference. A Geo reference says where the model is on Earth; the alignment says how to move the model relative to its own coordinates. Both are stored on the version and both are applied by the viewers, in sequence: alignment first, then geo placement. Using an alignment to shove a model onto its plot works until GEO mode, terrain or GIS layers come into play, at which point the geo reference has to be right in its own terms. Conversely, a geo reference cannot fix two discipline models that disagree about the project origin: both may be correctly geo-referenced and still need an alignment when viewed in LOCAL mode.

Because the geo reference places the aligned coordinates, the two combine for drawings. A PDF or DWG sheet gets its real size and place from its alignment: its size from one length read on it or from its printed scale (Set the scale of a drawing), which needs no other model, and its place from an alignment onto an IFC model, which can keep that size. Given the model's geo reference as well, the sheet lies on the earth exactly where the model is, in GEO mode, next to the GIS layers and on the map (Place a drawing on the map). The copied geo reference only fits together with the alignment it was copied under, which is why the version records where it came from.

The alignment is not an edit. The IFC file is untouched, BQL returns the coordinates the file contains, exports write the file's geometry, and every Qid stays what it was. Changing the alignment does not create a version and leaves no trace in the model's history. When objects must actually move — a wall relocated, a whole storey shifted in the data — that is a BUL TRANSFORM … WHERE …, committed as a Transaction, which creates a new version and changes what queries and exports see. The two exist side by side because they answer different questions: "how should I look at this model" versus "where are these objects".

How the viewers apply it#

The 3D viewer computes one placement matrix per loaded model and derives everything from it — rendering, culling, picking, measurements, bounds, the section box, near and far planes, GIS layers. The alignment is a factor in that matrix, composed identically in LOCAL and GEO mode, so a model aligned in LOCAL mode keeps its correction when the user switches to GEO. The viewer reads the alignment together with the geometry metadata when a model is added through the ModelManager. Align models, Drawing scale and the Alignment section show a changed alignment at once, without reloading the model, and the measurements taken on that model move with it. The 2D viewer applies the same matrix to the floor plans, minus the vertical component.

Alignment is applied per version, not per object. Objects placed relative to an aligned model move with it, GIS layers do not (they are placed by the geo reference), and two versions of one node can have different alignments.

Choosing#

Use an alignment when models of one project disagree about the origin or orientation and you want them to coincide in the viewers without changing anyone's file. Use a geo reference to put a model on the map, on terrain and next to GIS data; fix it by extraction or by hand, not by aligning. Use a BUL transform when the model itself is wrong and the correction must be in the data — in queries, exports and future versions. Two of the three often apply together: a correct geo reference on every model, plus an alignment on the one whose export was rotated.