title: Translating Javascript to C# Issues
body: <p>I've been attempting to convert this <a href="https://github.com/mikolalysenko/mikolalysenko.github.com/blob/master/Isosurface/js/surfacenets.js" rel="nofollow noreferrer">Javascript code</a> into a <a href="http://pastebin.com/v2MUYZig" rel="nofollow noreferrer">C# (Unity3d) script</a>. It is an implementation of Naive Surface Nets <a href="https://0fps.net/2012/07/12/smooth-voxel-terrain-part-2/" rel="nofollow noreferrer">explained here</a> if that helps.</p>
  
  <p>My translated C# script does compile without errors/warnings but the result is a broken (but recognizable) mesh:
  <a href="https://i.stack.imgur.com/048XZ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/048XZ.jpg" alt="C# Script in Unity3D"></a></p>
  
  <p>I've also noticed that the vertices look reasonably correct:
  <a href="https://i.stack.imgur.com/t33dn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/t33dn.png" alt="enter image description here"></a></p>
  
  <p>(If you can't already tell, the input voxels are just simplex noise.)</p>
  
  <p>I'd really like to get this working, but I am not well versed with Javascript.
  <strong>Can someone who knows both languages well tell me what I've missed? Thank you.</strong></p>
  
  <p>EDIT: <a href="https://www.dropbox.com/s/ysnemjhs6iemqs0/Unity%20Project.zip?dl=0" rel="nofollow noreferrer">Here's the project.</a></p>