code: func (s *Surface) WriteOffFile(w io.Writer) {
  	var i, j int
  
  	facesCount := 0
  	var faces bytes.Buffer
  
  	for i = 0; i < s.Width-1; i++ {
  		for j := i % 2; j < s.Height-1; j += 2 {
  			face := fmt.Sprintf("4 %d %d %d %d\n", i*s.Height+j, i*s.Height+j+1, (i+1)*s.Height+j+1, (i+1)*s.Height+j)
  			faces.WriteString(face)
  			facesCount++
  		}
  	}
  
  	w.Write([]byte("OFF\n"))
  	w.Write([]byte(fmt.Sprintf("%d %d 0\n", s.Height*s.Width, facesCount)))
  
  	// vertexes
  	for i = 0; i < s.Width; i++ {
  		for j = 0; j < s.Height; j++ {
  			p := s.PointAt(i, j)
  			// weirdness is to things will be colored correctly in meshlab 1.3.2-OS X
  			w.Write([]byte(fmt.Sprintf("%.8f %.8f %.8f\n", p[0], p[1], s.Grid[(s.Width-1)-i][j])))
  		}
  	}
  
  	w.Write(faces.Bytes())
  }
docs: // WriteOffFile writes an Object File Format representation of
  // the surface to the writer provided. This is for viewing
  // in MeshLab or something like that. You should close the
  // writer yourself after this function returns.
  // http://segeval.cs.princeton.edu/public/off_format.html