def curve(parent, points, degree=1, form=kOpen):
    'Create a NURBS curve from a series of points\n\n    Arguments:\n        parent (DagNode): Parent to resulting shape node\n        points (list): One tuples per point, with 3 floats each\n        degree (int, optional): Degree of curve, 1 is linear\n        form (int, optional): Whether to close the curve or not\n\n    Example:\n        >>> parent = createNode("transform")\n        >>> shape = curve(parent, [\n        ...     (0, 0, 0),\n        ...     (0, 1, 0),\n        ...     (0, 2, 0),\n        ... ])\n        ...\n\n    '
    assert isinstance(parent, DagNode), 'parent must be of type cmdx.DagNode'
    assert ((parent._modifier is None) or parent._modifier.isDone), "curve() currently doesn't work with a modifier"
    degree = min(3, max(1, degree))
    cvs = om1.MPointArray()
    knots = om1.MDoubleArray()
    curveFn = om1.MFnNurbsCurve()
    knotcount = (((len(points) - degree) + (2 * degree)) - 1)
    for point in points:
        cvs.append(om1.MPoint(*point))
    for index in range(knotcount):
        knots.append(index)
    mobj = curveFn.create(cvs, knots, degree, form, False, True, _encode1(parent.path()))
    mod = om1.MDagModifier()
    mod.renameNode(mobj, (parent.name(namespace=True) + 'Shape'))
    mod.doIt()

    def undo():
        mod.deleteNode(mobj)
        mod.doIt()

    def redo():
        mod.undoIt()
    commit(undo, redo)
    shapeFn = om1.MFnDagNode(mobj)
    return encode(shapeFn.fullPathName())
Create a NURBS curve from a series of points

Arguments:
    parent (DagNode): Parent to resulting shape node
    points (list): One tuples per point, with 3 floats each
    degree (int, optional): Degree of curve, 1 is linear
    form (int, optional): Whether to close the curve or not

Example:
    >>> parent = createNode("transform")
    >>> shape = curve(parent, [
    ...     (0, 0, 0),
    ...     (0, 1, 0),
    ...     (0, 2, 0),
    ... ])
    ...
def curve(parent, points, degree=1, form=kOpen):
    'Create a NURBS curve from a series of points\n\n    Arguments:\n        parent (DagNode): Parent to resulting shape node\n        points (list): One tuples per point, with 3 floats each\n        degree (int, optional): Degree of curve, 1 is linear\n        form (int, optional): Whether to close the curve or not\n\n    Example:\n        >>> parent = createNode("transform")\n        >>> shape = curve(parent, [\n        ...     (0, 0, 0),\n        ...     (0, 1, 0),\n        ...     (0, 2, 0),\n        ... ])\n        ...\n\n    '
    assert isinstance(parent, DagNode), 'parent must be of type cmdx.DagNode'
    assert ((parent._modifier is None) or parent._modifier.isDone), "curve() currently doesn't work with a modifier"
    degree = min(3, max(1, degree))
    cvs = om1.MPointArray()
    knots = om1.MDoubleArray()
    curveFn = om1.MFnNurbsCurve()
    knotcount = (((len(points) - degree) + (2 * degree)) - 1)
    for point in points:
        cvs.append(om1.MPoint(*point))
    for index in range(knotcount):
        knots.append(index)
    mobj = curveFn.create(cvs, knots, degree, form, False, True, _encode1(parent.path()))
    mod = om1.MDagModifier()
    mod.renameNode(mobj, (parent.name(namespace=True) + 'Shape'))
    mod.doIt()

    def undo():
        mod.deleteNode(mobj)
        mod.doIt()

    def redo():
        mod.undoIt()
    commit(undo, redo)
    shapeFn = om1.MFnDagNode(mobj)
    return encode(shapeFn.fullPathName())