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 int / 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.
Thanks for the feedback,
Definitely the efficient single array (instead the nested 3D and 4D vectors) will be the next change in the library.
I’m not using QtCreator, I use vim and g++. But I saw the warnings due I use the -w flag. I just ignored the warnings because I was focus on finishing the implementation and get shomething running. I will also check them out and improve the code. Thanks for pointing it out.