Looks like a very cool algorithm to create generative 3D meshes
I did some performance tests and for the first image (that’s the included simple example), in debug mode:
- 5x5x5 ~2 seconds
- 6x6x6 ~ 6 seconds
- 7x7x7 ~ 13 seconds
- 8x8x8 ~ 25 seconds
In release mode 8x8x8 is <2 seconds.
I wonder if the performance would benefit from not using nested vectors, but a linear vector accessed the same way we access the pixels array, which is linear even if it represents 2D data. Here an SO answer related to this:
Doing that should avoid 3-level nested loops calling .resize(). Or does the data structure need to be always resizable in any of the x, y, z dimensions? Maybe I’ll try to see what happens to performance when using plain arrays with hard coded dimensions. I guess it’s something you normally don’t need to change in real time, but compile time is fine.
With warnings enabled (C++ > Code Model > checks for almost everything) I see many warnings. Some related to
size_t casting, but also a return that can’t be called and if conditions that can’t be met because
size_t is never
< 0. Do you have those warnings enabled? Or maybe you are not using QtCreator? I find them very useful to avoid errors and always try to have 0 warnings
Do you have any links explaining how to write the xml? I don’t find it obvious by looking at the examples.
Congratulations and thanks for publishing it! I’m looking forward to create stuff with it.