Over the past week, I worked on an initial STL implementation and on more foundational code, which will hopefully be robust enough to be the final version. The biggest change was changing from my previous use of for_each functor-calling functions to proper iterators, backed by boost iterator_facade and iterator_adaptor. This not only makes the code faster, but also easier to read. In retrospect, it’s clearly the right way to do it, as it is also more composable. In addition, I added an option to disable deduplication of normals and UVs, which would make the export faster and less memory intensive, at the cost of a higher output file.
Tasks this week:
Option to disable deduplication
Implementation of C++ iterators for data structures like objects and vertices
Unfortunately, I also had some health problems so I wasn’t able to get as much work done as I would like, but I expect it to be over for now.
This past week I mainly fixed the iterator implementation and completed the STL export. It not supports selection awareness and both the binary and ASCII variants.
There were some refactorings, UI fixes and a general overview of the code. The UI code for OBJ and STL was separated. The iterator code was documented, explaining roughly how it works and it’s purpose. There were 6 commits this week.
This past week I mainly refactored the code and fixed various bugs. In addition, I had exams, so I wasn’t able to dedicate as much time as I hoped. I started properly using clang-format and fixed the emacs integration suggested on the Blender wiki, as it caused the file to not be saved.
I did some more preliminary benchmarks and got the following results for a suzanne with a level 6 subdiv applied:
Time (size of resultant file)
77.5 s (340mb)
C++ (without duplicates)
45.9 s (290mb)
C++ (with duplicates)
22.4 s (580mb)
These results aren’t quite as expected. This seems to be due to high amounts of indirection resulting from the use of boost, so the next planned step is to change the implementation to not depend on boost for this.