Comparing versions

How a compare pairs the objects of two versions, judges each pair on the features a BCOL definition watches, measures moves, recognises a shared move, compares federations, and why results are stored and edits compare quickly.

A model is uploaded again and again: a new export from the authoring tool every week, an edit in BIM.works in between. The question every revision raises is what changed, object by object, and a diff of the two files does not answer it — an exporter renumbers every line, and a moved wall is a changed placement a few entities away from the wall itself. A compare answers it on the model instead of the file. The steps are on Compare versions and Compare two versions; the language is BCOL.

Pairing objects#

Before anything can be compared, every object of the left version has to find its counterpart in the right one. How depends on where the right version came from:

  • By object id, when one version was made from the other by edits. A Transaction keeps the object ids (Oids) of its source version, so the pairing is exact and costs nothing.
  • By GlobalId, or by the keys a definition names (match attribute.GlobalId then attribute.Tag;), for two uploads. The keys are tried in order, so a Tag catches what a regenerated GlobalId misses.
  • By geometry, when the keys fail altogether — a model exported again with new GlobalIds: match attribute.GlobalId then geometry WITHIN 50 mm; pairs what is left by place, type and size, each pair with a confidence. A person can settle the rest: the pairs linked or confirmed by hand are kept for every later compare of the same two versions, and linked data follows them too (how a link follows its object).

What is not paired is added (right only) or removed (left only).

Judging a pair#

A pair is judged on the features its BCOL definition watches and nothing else: a name, a fire rating, a property set, the geometry. Nothing is compared unless it is named, and a tolerance says how much a value may differ before it counts (compare (attribute.Name, geometry.translation WITHIN 10 mm);). Geometry is measured, not just detected: a move, a rotation and a change of shape each come with their size. Rules give parts of the model their own watch list, the first match winning, and every object lands in exactly one category with one style, so the counts add up and the viewer can colour every object. The categories are added, removed, changed and unchanged by default; a definition can split them further, "Moved far" next to "Data changed".

Patterns over objects#

A list of a thousand changed objects is not yet an answer. Two things make it one:

  • Similar changes are grouped: when 36 objects all moved 500 mm along X, that is one line, not 36.
  • A shared move is recognised: when (nearly) everything moved alike, the model was most likely exported with another base point. The compare says by how much and can compare again with that move undone, so the few objects that really moved stand out.

Federations#

Discipline models are compared as federations: the architectural, structural and services models as they were against as they are. Objects are matched across the models, so a wall that moved from one model to another is one pair, not a removed wall and an added one. A federation is matched by its keys, never by object ids.

Stored, and computed on arrival#

A compare of two versions is stored. Versions never change after they exist, so the same compare again is answered at once, and the result can be read page by page; it is recomputed only when either side is reindexed. Because a stored compare is cheap to read, every new upload is compared with its predecessor when it arrives, and the tree can show what each version changed before anyone asks (the server setting compare.auto_on_upload turns this off).

Between versions made by edits, only the objects the edits touched are measured: the transaction says which they are, so a compare of two versions of one chain of edits takes as long as the edits are large, not as the model is.

From a compare back to an edit#

What changed between two uploads can often be written as BUL: new property values, moves and rotations, deleted objects. When all of an upload's changes can, the upload can be recorded as a transaction on the version before it. The new version then keeps the object ids of its predecessor, and with them the history of every object, its comments and the links to it, as if the changes had been made in BIM.works. Comments follow their objects in any case: an open comment on an object of an earlier version shows on its counterpart in the newer version, matched the way a compare matches it.

Limits#

Only products are compared, openings left out by default. Buildings and storeys are compared without geometry: their box follows what they contain, and a move is reported on the moved object. MapQids maps between two versions, not through a federation's result. Results of compares are kept for 30 days.

Since 3.0