(obj, **kwargs)
return ret
Converts rational splines to non-rational ones (if possible).

    The possibility of converting a rational spline geometry to
    a non-rational one depends on the weights vector.

    :param obj: rational spline geometry
    :type obj: NURBS.Curve, NURBS.Surface or NURBS.Volume
    :return: non-rational spline geometry
    :rtype: BSpline.Curve, BSpline.Surface or BSpline.Volume
    :raises: TypeError
Converts rational splines to non-rational ones (if possible).
Converts rational splines to non - rational ones ( if possible ) .
def nurbs_to_bspline(obj, **kwargs):
    """ Converts rational splines to non-rational ones (if possible).

    The possibility of converting a rational spline geometry to
    a non-rational one depends on the weights vector.

    :param obj: rational spline geometry
    :type obj: NURBS.Curve, NURBS.Surface or NURBS.Volume
    :return: non-rational spline geometry
    :rtype: BSpline.Curve, BSpline.Surface or BSpline.Volume
    :raises: TypeError
    """
    if not obj.rational:
        raise TypeError("The input must be a rational geometry")

    # Get keyword arguments
    tol = kwargs.get('tol', 10e-8)

    # Test for non-rational component extraction
    for w in obj.weights:
        if abs(w - 1.0) > tol:
            print("Cannot extract non-rational components")
            return obj

    # NURBS -> B-Spline
    if isinstance(obj, NURBS.Curve):
        ret = cvt.convert_curve(obj, BSpline)
    elif isinstance(obj, NURBS.Surface):
        ret = cvt.convert_surface(obj, BSpline)
    elif isinstance(obj, NURBS.Volume):
        ret = cvt.convert_volume(obj, BSpline)
    else:
        raise TypeError("Input must be an instance of NURBS curve, surface or volume")

    return ret
def nurbs_to_bspline ( obj , * * kwargs ) : if not obj . rational : raise TypeError ( "The input must be a rational geometry" ) # Get keyword arguments tol = kwargs . get ( 'tol' , 10e-8 ) # Test for non-rational component extraction for w in obj . weights : if abs ( w - 1.0 ) > tol : print ( "Cannot extract non-rational components" ) return obj # NURBS -> B-Spline if isinstance ( obj , NURBS . Curve ) : ret = cvt . convert_curve ( obj , BSpline ) elif isinstance ( obj , NURBS . Surface ) : ret = cvt . convert_surface ( obj , BSpline ) elif isinstance ( obj , NURBS . Volume ) : ret = cvt . convert_volume ( obj , BSpline ) else : raise TypeError ( "Input must be an instance of NURBS curve, surface or volume" ) return ret