(obj, param, **kwargs)
return ret_val
Splits the surface at the input parametric coordinate on the v-direction.

    This method splits the surface into two pieces at the given parametric coordinate on the v-direction,
    generates two different surface objects and returns them. It does not modify the input surface.

    Keyword Arguments:
        * ``find_span_func``: FindSpan implementation. *Default:* :func:`.helpers.find_span_linear`
        * ``insert_knot_func``: knot insertion algorithm implementation. *Default:* :func:`.operations.insert_knot`

    :param obj: surface
    :type obj: abstract.Surface
    :param param: parameter for the v-direction
    :type param: float
    :return: a list of surface patches
    :rtype: list
Splits the surface at the input parametric coordinate on the v-direction.
Splits the surface at the input parametric coordinate on the v - direction .
def split_surface_v(obj, param, **kwargs):
    """ Splits the surface at the input parametric coordinate on the v-direction.

    This method splits the surface into two pieces at the given parametric coordinate on the v-direction,
    generates two different surface objects and returns them. It does not modify the input surface.

    Keyword Arguments:
        * ``find_span_func``: FindSpan implementation. *Default:* :func:`.helpers.find_span_linear`
        * ``insert_knot_func``: knot insertion algorithm implementation. *Default:* :func:`.operations.insert_knot`

    :param obj: surface
    :type obj: abstract.Surface
    :param param: parameter for the v-direction
    :type param: float
    :return: a list of surface patches
    :rtype: list
    """
    # Validate input
    if not isinstance(obj, abstract.Surface):
        raise GeomdlException("Input shape must be an instance of abstract.Surface class")

    if param == obj.domain[1][0] or param == obj.domain[1][1]:
        raise GeomdlException("Cannot split from the v-domain edge")

    # Keyword arguments
    span_func = kwargs.get('find_span_func', helpers.find_span_linear)  # FindSpan implementation
    insert_knot_func = kwargs.get('insert_knot_func', insert_knot)  # Knot insertion algorithm

    # Find multiplicity of the knot
    ks = span_func(obj.degree_v, obj.knotvector_v, obj.ctrlpts_size_v, param) - obj.degree_v + 1
    s = helpers.find_multiplicity(param, obj.knotvector_v)
    r = obj.degree_v - s

    # Create backups of the original surface
    temp_obj = copy.deepcopy(obj)

    # Split the original surface
    insert_knot_func(temp_obj, [None, param], num=[0, r], check_num=False)

    # Knot vectors
    knot_span = span_func(temp_obj.degree_v, temp_obj.knotvector_v, temp_obj.ctrlpts_size_v, param) + 1
    surf1_kv = list(temp_obj.knotvector_v[0:knot_span])
    surf1_kv.append(param)
    surf2_kv = list(temp_obj.knotvector_v[knot_span:])
    for _ in range(0, temp_obj.degree_v + 1):
        surf2_kv.insert(0, param)

    # Control points
    surf1_ctrlpts = []
    for v_row in temp_obj.ctrlpts2d:
        temp = v_row[0:ks + r]
        surf1_ctrlpts.append(temp)
    surf2_ctrlpts = []
    for v_row in temp_obj.ctrlpts2d:
        temp = v_row[ks + r - 1:]
        surf2_ctrlpts.append(temp)

    # Create a new surface for the first half
    surf1 = temp_obj.__class__()
    surf1.degree_u = temp_obj.degree_u
    surf1.degree_v = temp_obj.degree_v
    surf1.ctrlpts2d = surf1_ctrlpts
    surf1.knotvector_v = surf1_kv
    surf1.knotvector_u = temp_obj.knotvector_u

    # Create another surface fot the second half
    surf2 = temp_obj.__class__()
    surf2.degree_u = temp_obj.degree_u
    surf2.degree_v = temp_obj.degree_v
    surf2.ctrlpts2d = surf2_ctrlpts
    surf2.knotvector_v = surf2_kv
    surf2.knotvector_u = temp_obj.knotvector_u

    # Return the new surfaces
    ret_val = [surf1, surf2]
    return ret_val
def split_surface_v ( obj , param , * * kwargs ) : # Validate input if not isinstance ( obj , abstract . Surface ) : raise GeomdlException ( "Input shape must be an instance of abstract.Surface class" ) if param == obj . domain [ 1 ] [ 0 ] or param == obj . domain [ 1 ] [ 1 ] : raise GeomdlException ( "Cannot split from the v-domain edge" ) # Keyword arguments span_func = kwargs . get ( 'find_span_func' , helpers . find_span_linear ) # FindSpan implementation insert_knot_func = kwargs . get ( 'insert_knot_func' , insert_knot ) # Knot insertion algorithm # Find multiplicity of the knot ks = span_func ( obj . degree_v , obj . knotvector_v , obj . ctrlpts_size_v , param ) - obj . degree_v + 1 s = helpers . find_multiplicity ( param , obj . knotvector_v ) r = obj . degree_v - s # Create backups of the original surface temp_obj = copy . deepcopy ( obj ) # Split the original surface insert_knot_func ( temp_obj , [ None , param ] , num = [ 0 , r ] , check_num = False ) # Knot vectors knot_span = span_func ( temp_obj . degree_v , temp_obj . knotvector_v , temp_obj . ctrlpts_size_v , param ) + 1 surf1_kv = list ( temp_obj . knotvector_v [ 0 : knot_span ] ) surf1_kv . append ( param ) surf2_kv = list ( temp_obj . knotvector_v [ knot_span : ] ) for _ in range ( 0 , temp_obj . degree_v + 1 ) : surf2_kv . insert ( 0 , param ) # Control points surf1_ctrlpts = [ ] for v_row in temp_obj . ctrlpts2d : temp = v_row [ 0 : ks + r ] surf1_ctrlpts . append ( temp ) surf2_ctrlpts = [ ] for v_row in temp_obj . ctrlpts2d : temp = v_row [ ks + r - 1 : ] surf2_ctrlpts . append ( temp ) # Create a new surface for the first half surf1 = temp_obj . __class__ ( ) surf1 . degree_u = temp_obj . degree_u surf1 . degree_v = temp_obj . degree_v surf1 . ctrlpts2d = surf1_ctrlpts surf1 . knotvector_v = surf1_kv surf1 . knotvector_u = temp_obj . knotvector_u # Create another surface fot the second half surf2 = temp_obj . __class__ ( ) surf2 . degree_u = temp_obj . degree_u surf2 . degree_v = temp_obj . degree_v surf2 . ctrlpts2d = surf2_ctrlpts surf2 . knotvector_v = surf2_kv surf2 . knotvector_u = temp_obj . knotvector_u # Return the new surfaces ret_val = [ surf1 , surf2 ] return ret_val