Post by PlanFinder

4,275 followers

Diffing CAD geometry is harder than it looks. In many CAD and BIM workflows, GUIDs are extremely effective for tracking changes between model versions. When they are stable and preserved, they provide a clear notion of identity. With Chonk, we also look at the problem from a geometric perspective, in a way that is closer to how textual diffs work in code. A code diff does not rely on line numbers alone. It aligns two versions of a file, matches identical lines first, and only then deals with the ambiguous cases. Geometry diffing follows a similar pattern, except the “lines” live in continuous space. We start by comparing geometries using an isometry-invariant shape descriptor. When a shape appears exactly once in both versions, matching is trivial. These clear 1:1 matches can be resolved immediately and removed from the problem. What remains is a smaller, more ambiguous bipartite graph, where multiple geometries may plausibly correspond to each other. For this subset, we formulate a matching problem and use a Hungarian solver to find the best overall assignment based on geometric difference and spatial consistency. From each match, we then compute the minimal transform, such as translation or rotation. As with textual diffs, interpreting what actually happened is subtle. Geometry alone does not encode intent. The result is therefore an inferred explanation that minimizes change, not a definitive edit history. This approach lets us reason about geometric change in a way that feels familiar to developers, while respecting the continuous and spatial nature of CAD models. P.S. The animation is shown at double speed.

Post content

Video Content