Marching Cube in Grasshopper (GH & C# Libraries)

 

Basically just me noodling around trying to learn how to make c# libs talk to GH (thanks to Dave R for the 5 mins tute some months back!!!). This is a simple implementation of a marching cube algorithm I had previously developed for Processing (Java coded in Eclipse). I have also recently ported this to python in Rhino5 to avoid GH, but I am still to implement OpenGL pipeline for comparable redraw performance (& sliders goodness!!!). GH struggles a little with voxels resolutions over 60*60*60 (compared with previous Processing -- and on a super old laptop!) but it is surprisingly OK thanks to the OpenGL drawing in rhino i guess - although i am yet to really throw a lot of input points at the system. I am sure it would benefit from some oct-tree spatial partitioning or other when these numbers get big. there is always another job...

 

If anyone is interested, marching cube look-up tables sourced from the treasure trove that is: see http://paulbourke.net/geometry/polygonise/).

  • David Reeves

    Nice one Max. What sort of field function did you go with?
  • max

    Hi Dave. The perennial 1/d2 ;) the real trick is applying these as weightings to the MC edge tables so the voxel edge / implicit surface intersections can slide around a bit ensuring smoother geometries. the problem with any of these isosurfaces is that the resultant meshes are not regularly ordered -- ie quad meshes. so in many ways a bit useless for post production / operations. i think the implicit surfaces via contouring you have previously demonstrated seem a little superior in this regard.