Rivara bisection algorithm for adaptive subdivision of triangulations.