title: Splitting/Cutting an STL file with Python
body: <p>I have an .stl file with z-coordinates from 0 to ~200 (x and y don't matter) and I would like to cut it in z-direction in order to get a smaller one (e.g. with z-coordinates from 0 to 50). (Please see Image 1 - red line has nothing to do with it, it is used for another purpose)</p>
  
  <p>Now I'm using NetFabb software (<a href="https://www.netfabb.com/blog/netfabb-basic-now-just-netfabb" rel="nofollow noreferrer">https://www.netfabb.com/blog/netfabb-basic-now-just-netfabb</a>) and it works very well (Please see Image 2). 
  Since I'm coding with Python and I'm using that "original" .stl file in my Python code, would be useful to have a code to cut this .stl and to generate a new .stl file from the original one, without using any external software.</p>
  
  <p>Does anybody know how I could do it? Or does already exist python function to do it?</p>
  
  <p><strong>Image 1 - "Original" big .stl file, that need to be cut (MatLab picture):</strong></p>
  
  <p><img src="https://i.stack.imgur.com/xnIVC.png" alt="Image 1 - &quot;Original&quot; big .stl file, that need to be cut (MatLab picture)"></p>
  
  <p><strong>Image 2 - Splitted/Cut .stl with NetFabb (MatLab picture):</strong></p>
  
  <p><img src="https://i.stack.imgur.com/CZkGy.png" alt="Image 2 - Splitted/Cut .stl with NetFabb (MatLab picture)"></p>
  
  <p><a href="https://www.dropbox.com/s/ymkcd1tf5zn0stn/99perc.stl?dl=0" rel="nofollow noreferrer">DropBox link for downloading original .stl file</a></p>
  
  <p><a href="https://i.stack.imgur.com/iuwaE.png" rel="nofollow noreferrer">cut stl form another point of view... donut shape is still there</a></p>