fix translation calculation and add nonlinear refinement for triangulation