'Optimize points for projection'

def get_vector(self, segments3d):

    si = 0
    ei = 0
    segis = []
    points = []
    for p in segments3d:
        points.extend(p)
        ei = (si + len(p))
        segis.append((si, ei))
        si = ei
    if (len(segments3d) > 0):
        (xs, ys, zs) = list(zip(*points))
    else:
        (xs, ys, zs) = ([], [], [])
    ones = np.ones(len(xs))
    self._vec = np.array([xs, ys, zs, ones])
    self._segis = segis
