Simplified algorithmextend2d.