<p>Given a 3D boolean array representing voxels, how can it be converted to a 3D-printer-ready file?</p>

<p>The end-goal I would like to achieve is to print the 3D shape that the numpy array represents (<code>True</code> coding for <em>fill this voxel</em>, <code>False</code> for <em>leave it empty</em>).</p>

<p>For example, the array</p>

<pre><code>[
    [
        [T, T, T],
        [T, F, T],
        [T, T, T]
    ],
    [
        [T, F, T],
        [F, F, F],
        [T, F, T]
    ],
    [
        [T, T, T],
        [T, F, T],
        [T, T, T]
    ]
]
</code></pre>

<p>would encode a <a href="https://en.wikipedia.org/wiki/Void_Cube" rel="nofollow noreferrer">level-1 Menger sponge</a>.</p>

I agree with the use of OpenSCAD, but since it is difficult to program in OpenSCAD, I would use
SolidPython
, which is a front end for OpenSCAD with the full programming capability of Python.
In the alternative, you could use any programming language to decode your arrays and generate the OpenSCAD code for the little network of cubes (or voxels).
The final possibility is to generate an STL file directly.  I've helped someone do this, but we found the rules to be a little non-intuitive.  We used mesh tools to check out results, both by looking for error messages, and by displaying the result to see if it looked as we intended it to look.