parameterize ZWriter with an instance of heightfield.