After an epic fail in nearest-neighbor-search in a kd-Tree I wanted to implement a simple data-structure in C++.

So I tried a Max-Heap. Shouldn't be to difficult i thought. Well, and it wasn't. In 75% of my test cases. I actually wrote a test-assertion, which checks if the max-heap is still not broken and of course it fails in some cases. So because I am to lazy to actually sit down and dig through the code I started creating a proper interface library to OpenSCAD. Library might be the wrong word. It's basically just a bunch of simple macros, which assist me in outputting an OpenSCAD document, which then plots in this case my heap. Simple screenshot of my auto-generated OpenSCAD code and it's corresponding render of a max-heap on the right

I even started to fiddle around with animations. A screenshot of OpenSCAD plotting a max-heap with an animation of two nodes switching Maybe after some work I can animate full operations using this.