trim_coords for 3D displacements