-
-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate geometry from topology #2116
Comments
#2117, which I wanted to do as a test run for this issue, is completed now. I will now start working on this one. |
As I'm starting to get into this, I've decided that I'm going to migrate surface geometry to the new geometry layer first. This has already turned up two issues that need handling:
Not sure which issue I'll handle first. Both require some thinking. |
I have figured out some minimally invasive solutions for addressing my problems with In each case, this leaves the code in a state that isn't ideal for the new world of separate topology and geometry. This needs to be cleaned up later, but for now, it's not important. Doing it like this allows me to make progress with the geometry layer without requiring me to do everything at once. As of the latest pull requests, the geometry layer is in place, and surface geometry is stored there. The surface geometry still redundantly exists in the |
This work has been on pause for a bit, while I was distracted with other projects. But I've resumed it today, and manged to finish the migration of surface geometry to the geometry layer. Next up, I'll set my sights on |
I just discovered a bug caused by the work here: #2266 I'm hoping I can ignore it for now and move forward. |
I'm currently working on migrating the definition of the surface path out of In my opinion, every piece of code that defines the surface path writes to the geometry layer, and every piece of code that needs the surface path reads it from the geometry layer. Except, when I actually remove the respective field from So far, I don't understand at all why that is, despite a few hours of debugging. I'll stay on it. This makes so little sense, it must be some stupid oversight. |
So, I thought I had run out of steam today, but apparently not. I found the bug. I said it must be stupid, and it certainly was. Good thing is, it made me realize some things that will make handling objects simpler and more robust. Other good thing is, I can move on now to migrating half-edge boundaries to the geometry layer. This is the last piece that's missing before this issue is completed! |
And it's done! All geometry lives in the respective layer, and the object graph is now a purely topographical data structure! Next, I intend to build on that, by cleaning up the geometry a bit. I have some specific ideas here, that I haven't yet opened an issue for. After that, I'll hopefully be ready to start working on #2118. |
As far as I know, b-rep CAD kernels traditionally separate topology (how objects relate to each other) from geometry (where objects are). At least that's what I got from Boundary Representation Modelling Techniques by Ian Stroud. Earlier on, Fornjot followed that separation, but that didn't survive the many improvements and refactorings since then.
I think it's time to bring that idea back, but with a different twist: Originally the topological data referred to the geometry (and that's how it sill works, kinda, but without a clear separation). I'd like to do it the other way around: Geometrical data exists as a separate layer that refers to the topological object graph, which itself is isolated and doesn't concern itself with anything else. This is possible, because the (topological) objects in the graph have unique IDs, and thus can be referenced easily by an outside entity.
I see the following advantages in this arrangement:
This is not always appropriate. For example, if you have a user drag a vertex in a GUI, you'd have to create new versions of those objects every pixel.
Having geometry be separate, would make it easier to experiment with geometry, as changes there would no longer affect the object graph. It would even be possible to have multiple competing geometry layers, and experiment with them in parallel.
Initially, the geometry layer could be a struct (
Geometry
), that is passed into all operations (and other code) that need it. Eventually, we should find a better way to organize this, as to not have a million different arguments in every function. I already have some ideas here, but that's a topic for another day (I have a long list of issues I need to open, so it might take me a bit to get to that one).Unless I'm missing something (which is quite possible), this should be a relatively straight-forward refactoring. We should definitely attempt to do this before making any other significant changes to the geometry representation or object graph.
The text was updated successfully, but these errors were encountered: