Linear complexity hexahedral mesh generation