Today I refactored some code. The main geometry container of the polyhedrons was an inner class of the polyhedron class. I moved it out, to its own file and also renamed it. "Search and Replace" found nearly 600 occurrences and I had to fix countless more. But after some hours everything built again.
I didn't actually plan to do this, it just occurred to me today, that it would make sense. I was thinking about some abstraction to help implementing modifiers. When I thought about where to place it physically I thought, that it would belong next to the class containing the geometry. But that was in the main polyhedron header which already was much bigger than I wanted it to be. So I just decided to move it to its own file.
I don't know, why it hadn't occurred to me previously that this made sense. The two files I now have are still big enough, but I have some hopes that compile times will be a bit lower as I hopefully won't change both files at the same time too often.
The new thing I started then was a class to handle the act of creating a new geometry. This is a bit complicated in my system as the geometry object is basically fixed. It is possible to add new things (vertices, edges or faces), but it is not possible to change things. That design was created like this on purpose, as I fear it is the only way to handle something so central and complex.
Now the complexity is moved to the modifiers. But that is actually easier as for the modifiers I only needed to come up with a way to create the resulting geometry for their special cases and not for the general case. The new class seems to contradict this, as I want it to specifically handle that step, but it doesn't. As it won't be the only way to do that step, I can limit it to frequent changes. If a modifier does something unique (e.g. the modifier implementing subdivision) it will still have to have its own function to do the work to come up with a new geometry.
But for the smaller modifiers I should be able to save considerable amounts of code and time by using the new abstraction. It will be able to handle moving vertices (with the special case that two vertices are fused to one), handle partitioning of edges and partitioning of faces. In addition it will also handle the simple cases of adding vertices, edges and faces.