(ctrlpts)
return new_ctrlpts
Generates unweighted control points from weighted ones in 1-D.

    This function

    #. Takes in 1-D control points list whose coordinates are organized in (x*w, y*w, z*w, w) format
    #. Converts the input control points list into (x, y, z, w) format
    #. Returns the result

    :param ctrlpts: 1-D control points (P)
    :type ctrlpts: list
    :return: 1-D weighted control points (Pw)
    :rtype: list
Generates unweighted control points from weighted ones in 1-D.
Generates unweighted control points from weighted ones in 1 - D .
def generate_ctrlpts_weights(ctrlpts):
    """ Generates unweighted control points from weighted ones in 1-D.

    This function

    #. Takes in 1-D control points list whose coordinates are organized in (x*w, y*w, z*w, w) format
    #. Converts the input control points list into (x, y, z, w) format
    #. Returns the result

    :param ctrlpts: 1-D control points (P)
    :type ctrlpts: list
    :return: 1-D weighted control points (Pw)
    :rtype: list
    """
    # Divide control points by weight
    new_ctrlpts = []
    for cpt in ctrlpts:
        temp = [float(pt / cpt[-1]) for pt in cpt]
        temp[-1] = float(cpt[-1])
        new_ctrlpts.append(temp)

    return new_ctrlpts
def generate_ctrlpts_weights ( ctrlpts ) : # Divide control points by weight new_ctrlpts = [ ] for cpt in ctrlpts : temp = [ float ( pt / cpt [ - 1 ] ) for pt in cpt ] temp [ - 1 ] = float ( cpt [ - 1 ] ) new_ctrlpts . append ( temp ) return new_ctrlpts