Comparing two CAD model revisions — what STEP can and can't tell you¶
I wanted to answer a simple-sounding question: given two revisions of the same part, what changed? — and ideally track that outside the CAD system, across a whole library.
It turns out the obvious approaches all fail for non-obvious reasons.
diff on two STEP files is useless¶
A .stp file is a numbered entity graph:
Every re-export renumbers and can reorder entities. Diff two exports of the identical part and you get thousands of changed lines. There is no stable identity to anchor on.
STEP has no persistent IDs
#4471 in file A has no relationship to #4471 in file B, even for the same face. This is the root cause of everything below.
So comparison has to be geometric¶
Any real comparator does three things:
- Align the two models. Free if both were exported in the same coordinate system; otherwise it needs best-fit registration — which is ambiguous for symmetric parts and can silently align the wrong way.
- Match faces by surface type, size, position, normals — never by ID.
- Classify each face as matched / added / removed / modified.
Native CAD compare (CATIA, NX) is more reliable precisely because it can match on persistent feature IDs. Going through STEP throws that away.
What geometric compare catches¶
Added or removed holes, bosses, ribs, pockets; wall-thickness changes; moved features; changed fillet radii; overall size changes.
Where it produces false positives¶
Two exports of the same geometry can differ topologically — a face split into two coplanar faces, different surface parameterisation, different trimming tolerance. Geometrically identical, structurally different. Good tools suppress this; naive ones report hundreds of phantom changes.
Test any comparator on a known-identical pair first
Export the same part twice and compare it against itself. The phantom-change count tells you more about the tool than any feature list.
What it can never see¶
Feature-tree or parameter changes that produce the same shape, renames, and material. STEP carries the resulting B-rep, not design intent. Tolerances and annotations only compare if both files are AP242 and the PMI was written semantically, not as graphical text (AP203/AP214 carry geometry alone).
CATIA has a Compare feature — but you can't script it¶
CATIA V5's Compare Products / Compare Documents is an interactive workbench command. It is not in the published V5 Automation object model, so VBScript can't extract its results.
Two dead ends worth naming:
CATIA.StartCommand("Compare Products")launches the dialog but returns no handle and no result. Fire-and-forget, useless for batch.- CAA V5 (C++) may reach further, but needs an RADE licence and a toolchain matched to your exact release.
(On 3DEXPERIENCE this is moot in a different way — VBScript automation is largely gone there; it's EKL and web services.)
The scriptable workaround: signature diffing¶
The measure/inertia API is exposed and stable. So instead of extracting CATIA's diff, compute a signature per part, dump it, and diff the signatures outside CATIA:
Set CATIA = GetObject(, "CATIA.Application")
CATIA.Visible = False
Set doc = CATIA.Documents.Open(partPath)
Set part = doc.Part
part.Update
Set spa = doc.GetWorkbench("SPAWorkbench")
Set ref = part.CreateReferenceFromObject(part.MainBody)
Set ine = spa.Inertias.Add(ref)
vol = ine.Volume
area = ine.Area
ine.GetCenterOfGravity cog ' array of 3
ine.GetPrincipalMoments pm ' array of 3
Write one row per part: path, part number, revision, volume, area, COG, principal moments, face count, face-area histogram, file mtime and hash. Add the face layer via Selection.Search over topological faces plus Measurable — the histogram is what catches "a boss moved" rather than merely "volume changed".
Diff two snapshots and you get unchanged / changed / added / removed per part, plus how much. It batches headlessly (CNEXT.exe -batch -macro …), which the interactive Compare never will.
What you lose: the specific face that moved, and the visual. Keep the interactive Compare as manual drill-down on the handful of parts the signature diff flags.
Verify member names against your release
V5 automation naming drifts between R-levels, and the macro help is notoriously incomplete.
Open-source route¶
No CAD licence needed — Open CASCADE / pythonOCC gives you the difference literally, as solids:
removed = BRepAlgoAPI_Cut(A, B).Shape() # in old, not in new
added = BRepAlgoAPI_Cut(B, A).Shape() # in new, not in old
Render removed red and added green over a translucent A — that is the highlight, in ~30 lines, and it batches across a library. FreeCAD does the same interactively (Part → Boolean → Cut). Tessellate and use trimesh / CloudCompare for Hausdorff distance if approximate screening is enough.
Caveat: boolean diff is O(n²) and won't scale to library search — that's a different problem. There you want cheap shape signatures first (volume, area, bbox aspect ratios, inertia moments, face-type histogram) for coarse bucketing, then B-rep graph embeddings for ranking, with boolean diff only as the confirm step on the top few candidates.
Commercial comparators — separate licences, very different tiers¶
Both are standalone purchases, unrelated to your CAD seats:
| Kubotek K-Compare Revision | CADIQ (ITI / Wipro) | |
|---|---|---|
| Standalone? | Yes — own Kosmos kernel, reads native + STEP with no CAD installed | No — plugs into your CAD system to read native models (standalone viewer only) |
| Cost | Quote-only; desktop per-seat tier | ~\(10K** entry, up to ~**\)250K, modular |
| Aimed at | Revision diff, design→manufacturing hand-off | Auditable validation records for a supply chain |
Kubotek also sells Kosmos Validate separately — that's translation validation ("is the STEP faithful to the native file"), a different problem from revision diff.
Two questions to ask either vendor before trialling:
- Is there a batch/CLI mode, and is it in the base licence or an add-on? Interactive-only kills any library-scale use.
- What's the machine-readable output? A PDF report is useless for tracking; you want XML/JSON/CSV you can store and diff.