(file_in='', file_out='ctrlptsw.txt')
Generates weighted control points from unweighted ones in 2-D.

    This function

    #. Takes in a 2-D control points file whose coordinates are organized in (x, y, z, w) format
    #. Converts into (x*w, y*w, z*w, w) format
    #. Saves the result to a file

    Therefore, the resultant file could be a direct input of the NURBS.Surface class.

    :param file_in: name of the input file (to be read)
    :type file_in: str
    :param file_out: name of the output file (to be saved)
    :type file_out: str
    :raises IOError: an error occurred reading or writing the file
Generates weighted control points from unweighted ones in 2-D.
Generates weighted control points from unweighted ones in 2 - D .
def generate_ctrlptsw2d_file(file_in='', file_out='ctrlptsw.txt'):
    """ Generates weighted control points from unweighted ones in 2-D.

    This function

    #. Takes in a 2-D control points file whose coordinates are organized in (x, y, z, w) format
    #. Converts into (x*w, y*w, z*w, w) format
    #. Saves the result to a file

    Therefore, the resultant file could be a direct input of the NURBS.Surface class.

    :param file_in: name of the input file (to be read)
    :type file_in: str
    :param file_out: name of the output file (to be saved)
    :type file_out: str
    :raises IOError: an error occurred reading or writing the file
    """
    # Read control points
    ctrlpts2d, size_u, size_v = _read_ctrltps2d_file(file_in)

    # Multiply control points by weight
    new_ctrlpts2d = generate_ctrlptsw2d(ctrlpts2d)

    # Save new control points
    _save_ctrlpts2d_file(new_ctrlpts2d, size_u, size_v, file_out)
def generate_ctrlptsw2d_file ( file_in = '' , file_out = 'ctrlptsw.txt' ) : # Read control points ctrlpts2d , size_u , size_v = _read_ctrltps2d_file ( file_in ) # Multiply control points by weight new_ctrlpts2d = generate_ctrlptsw2d ( ctrlpts2d ) # Save new control points _save_ctrlpts2d_file ( new_ctrlpts2d , size_u , size_v , file_out )