(obj, trim_idx=-1, **kwargs)
return ret
Generates 3-dimensional mapping of 2-dimensional trimming curves.

    **Description:**

    Trimming curves are defined on the parametric space of the surfaces. Therefore,
    all trimming curves are 2-dimensional. The coordinates of the trimming curves
    correspond to (u, v) parameters of the underlying surface geometry. When these
    (u, v) values are evaluated with respect to the underlying surface geometry,
    a 3-dimensional representation of the trimming curves is generated.

    The resultant 3-dimensional curve is described using :class:`.freeform.Freeform`
    class. Using the ``fitting`` module, it is possible to generate the B-spline
    form of the freeform curve.

    **Remarks:**

    If `trim_idx=-1`, the function maps all 2-dimensional trims to their 3-dimensional
    correspondants.

    :param obj: spline geometry
    :type obj: abstract.SplineGeometry
    :param trim_idx: index of the trimming curve in the geometry object
    :type trim_idx: int
    :return: 3-dimensional mapping of trimming curve(s)
    :rtype: freeform.Freeform
Generates 3-dimensional mapping of 2-dimensional trimming curves.
Generates 3 - dimensional mapping of 2 - dimensional trimming curves .
def map_trim_to_geometry(obj, trim_idx=-1, **kwargs):
    """ Generates 3-dimensional mapping of 2-dimensional trimming curves.

    **Description:**

    Trimming curves are defined on the parametric space of the surfaces. Therefore,
    all trimming curves are 2-dimensional. The coordinates of the trimming curves
    correspond to (u, v) parameters of the underlying surface geometry. When these
    (u, v) values are evaluated with respect to the underlying surface geometry,
    a 3-dimensional representation of the trimming curves is generated.

    The resultant 3-dimensional curve is described using :class:`.freeform.Freeform`
    class. Using the ``fitting`` module, it is possible to generate the B-spline
    form of the freeform curve.

    **Remarks:**

    If `trim_idx=-1`, the function maps all 2-dimensional trims to their 3-dimensional
    correspondants.

    :param obj: spline geometry
    :type obj: abstract.SplineGeometry
    :param trim_idx: index of the trimming curve in the geometry object
    :type trim_idx: int
    :return: 3-dimensional mapping of trimming curve(s)
    :rtype: freeform.Freeform
    """
    if obj.pdimension < 2:
        raise GeomdlException("Input geometry should be defined on, at least, 2-dimensional parametric space")

    # Get keyword arguments
    delta = kwargs.get('delta', -1.0)

    # Initialize return list
    ret = []

    # Process trims
    if trim_idx < 0:
        # Process all trims
        for trim in obj.trims:
            # Set delta
            if delta > 0:
                trim.delta = delta

            # Evaluate trim
            epts = obj.evaluate_list(trim.evalpts)
            fcurve = shortcuts.generate_freeform()
            fcurve.evaluate(points=epts)
            ret.append(fcurve)
    else:
        # Process a single trim
        try:
            trim = obj.trims[trim_idx]
        except KeyError:
            raise GeomdlException("Trim curve at index " + str(trim_idx) + " does not exist")

        # Set delta
        if delta > 0:
            trim.delta = delta

        # Evaluate trim
        epts = obj.evaluate_list(trim.evalpts)
        fcurve = shortcuts.generate_freeform()
        fcurve.evaluate(points=epts)
        ret.append(fcurve)

    # Return curves
    return ret
def map_trim_to_geometry ( obj , trim_idx = - 1 , * * kwargs ) : if obj . pdimension < 2 : raise GeomdlException ( "Input geometry should be defined on, at least, 2-dimensional parametric space" ) # Get keyword arguments delta = kwargs . get ( 'delta' , - 1.0 ) # Initialize return list ret = [ ] # Process trims if trim_idx < 0 : # Process all trims for trim in obj . trims : # Set delta if delta > 0 : trim . delta = delta # Evaluate trim epts = obj . evaluate_list ( trim . evalpts ) fcurve = shortcuts . generate_freeform ( ) fcurve . evaluate ( points = epts ) ret . append ( fcurve ) else : # Process a single trim try : trim = obj . trims [ trim_idx ] except KeyError : raise GeomdlException ( "Trim curve at index " + str ( trim_idx ) + " does not exist" ) # Set delta if delta > 0 : trim . delta = delta # Evaluate trim epts = obj . evaluate_list ( trim . evalpts ) fcurve = shortcuts . generate_freeform ( ) fcurve . evaluate ( points = epts ) ret . append ( fcurve ) # Return curves return ret