We're almost done with adding a Distance Transform capability to ShapeJS. Distance function visualized through a gyroid volume. Solid red and blue are uncalculated inside/outside areas. Gradients are distance from the surface. View my blog post for more details: http://abfab3d.com/2014/01/17/distance-transform/