title: Convert stl 2 numpy, volume data
body: <p>Is there a way to convert a <strong>stl file to a numpy</strong> array?
  The numpy array, resolved with <code>x*y*z</code> datapoints should contain volumetric information in the sense of "inside" or "outside" the geometry, say as 0 or 1.</p>
  
  <p>To my surprise I didn't find anything on this yet, although numpy2stl seems to be quite popular.</p>
  
  <p>The problem is a complex geometry of porous media, so convex hull conversion does not work either. </p>
  
  <pre><code>import numpy
  import stl
  from stl import mesh
  stl.stl.MAX_COUNT = 1e10
  your_mesh = stl.mesh.Mesh.from_file('Data.stl')
  print your_mesh.data
  </code></pre>
  
  <p>seems to be able to export triangles only.</p>
  
  <p>In addition, even this usually leads to <code>MemoryError</code> messages; but numpy-stl (usually) works for loading the datapoints into numpy.</p>
  
  <p>Is there a way to convert the stl data into volume data that contains information if every point is inside or outside the geometry?
  The resulting 3D array could technically be of binary data type, but this isn't required.
  overcomplicated
  With commercial software this conversion seems to be trivial, but it's not python or free. Implementing a ray casting algorithm from scratch seems over complicated for file type conversion.</p>