logoalt Hacker News

MoonWalktoday at 8:24 PM2 repliesview on HN

Unless I missed it, the article doesn't answer the first question you'd ask: Why don't they just generate unique IDs for everything and use those internally, instead of names that get changed all the time?


Replies

throwup238today at 8:34 PM

Whether it's unique IDs or names, the problem is the same: topology changes destroy the things you’re identifying. When you have a box and you assign ID face_007 (or a generated unique ID) to its top face, that works fine until you fillet an edge adjacent to that face. Now the kernel has to recompute the geometry and depending on the operation, face_007 might still exist in a different shape, might split into multiple faces, or be destroyed completely.

The geometric kernel is doing boundary representation operations so when you do a boolean or a fillet, it doesn’t “edit” existing faces, it computes an entirely new b-rep from scratch. The old faces, edges, and vertices are gone and new ones are created to replace then. There’s nothing to hang a persistent ID on because the entities themselves are ephemeral.

There are solutions to the problem but they all break down eventually. I think freeCAD uses topological tracing and naming schemes so it encodes a face’s identity by how it was created. e.g., “the face generated by the intersection of extrude_1 and the XY plane.” The problem then is that parameter changes or operation insertions in the history can destroy those too, creating a new feature that can’t be easily mapped to the old ones. That’s where all the heuristics come in.

Unique IDs are used internally, but they only last for the lifetime of one evaluation. The hard part is establishing the equivalence between entities across re-evaluations when the topology itself may have changed.

show 1 reply
vjvjvjvjghvtoday at 8:37 PM

They have that but when you change something, often some elements get deleted and others are added. Now you need to figure out how they relate to the previous elements and that’s very hard it seems.