def new_sgmt_from_points(p1=None, p2=None, p3=None):
    """Create sgmt from points.

    :param p1: survey origin, (ilno, xlno, crsx, crsy)
    :type p1: tuple
    :param p2: survey corner, (ilno, xlno, crsx, crsy)
    :type p2: tuple
    :param p3: survey corner, (ilno, xlno, crsx, crsy)
    :type p3: tuple
    :return: a survey object
    :rtype: :class:`~ezcad.gosurvey.survey.Survey`
    """
    if p1 is None:
        p1 = 1, 1, 0.0, 0.0
    if p2 is None:
        p2 = 1, 11, 0.0, 10.0
    if p3 is None:
        p3 = 11, 1, 10.0, 0.0
    dict_sgmt = {'P1_ILNO': p1[0], 'P1_XLNO': p1[1], 'P1_CRSX': p1[2],
        'P1_CRSY': p1[3], 'P2_ILNO': p2[0], 'P2_XLNO': p2[1], 'P2_CRSX': p2
        [2], 'P2_CRSY': p2[3], 'P3_ILNO': p3[0], 'P3_XLNO': p3[1],
        'P3_CRSX': p3[2], 'P3_CRSY': p3[3]}
    return dict_sgmt
