title: Filling enclosed space / air inside voxel models - any fast algorithms?
body: <p>I've created a Voxelizer for .obj models which is working pretty well so far. However, it only turns the surface of the model into voxels and doesn't fill it up. And filling it up afterwards is very important for further exporting and optimization.</p>
  
  <p>I was thinking about options to fill up the space but just couldn't put my finger on an efficient algorithm that does it.</p>
  
  <p>This is what the inside of a "cat" looks like, exported as .obj again.
  <a href="https://i.stack.imgur.com/2J1UB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2J1UB.png" alt="enter image description here"></a></p>
  
  <p>Is there any fast algorithms for detecting enclosed space within a voxel shape?</p>
  
  <p>My voxels are being stored using either a</p>
  
  <pre><code>List&lt;Voxel&gt; //Voxel contains 4 integers for x,y,z,rgb OR
  Map&lt;int[], java.awt.Color&gt;.
  </code></pre>
  
  <p>I would need an algorithm that works really efficiently with one of these.</p>