(points, size_u, size_v, centripetal=False)
return uk, vl
Computes :math:`\\overline{u}_{k}` and :math:`\\overline{u}_{l}` for surfaces.

    The data points array has a row size of ``size_v`` and column size of ``size_u`` and it is 1-dimensional. Please
    refer to The NURBS Book (2nd Edition), pp.366-367 for details on how to compute :math:`\\overline{u}_{k}` and
    :math:`\\overline{u}_{l}` arrays for global surface interpolation.

    Please note that this function is not a direct implementation of Algorithm A9.3 which can be found on The NURBS Book
    (2nd Edition), pp.377-378. However, the output is the same.

    :param points: data points
    :type points: list, tuple
    :param size_u: number of points on the u-direction
    :type size_u: int
    :param size_v: number of points on the v-direction
    :type size_v: int
    :param centripetal: activates centripetal parametrization method
    :type centripetal: bool
    :return: :math:`\\overline{u}_{k}` and :math:`\\overline{u}_{l}` parameter arrays as a tuple
    :rtype: tuple
Computes :math:`\\overline{u}_{k}` and :math:`\\overline{u}_{l}` for surfaces.
Computes : math : \\ overline { u } _ { k } and : math : \\ overline { u } _ { l } for surfaces .
def compute_params_surface(points, size_u, size_v, centripetal=False):
    """ Computes :math:`\\overline{u}_{k}` and :math:`\\overline{u}_{l}` for surfaces.

    The data points array has a row size of ``size_v`` and column size of ``size_u`` and it is 1-dimensional. Please
    refer to The NURBS Book (2nd Edition), pp.366-367 for details on how to compute :math:`\\overline{u}_{k}` and
    :math:`\\overline{u}_{l}` arrays for global surface interpolation.

    Please note that this function is not a direct implementation of Algorithm A9.3 which can be found on The NURBS Book
    (2nd Edition), pp.377-378. However, the output is the same.

    :param points: data points
    :type points: list, tuple
    :param size_u: number of points on the u-direction
    :type size_u: int
    :param size_v: number of points on the v-direction
    :type size_v: int
    :param centripetal: activates centripetal parametrization method
    :type centripetal: bool
    :return: :math:`\\overline{u}_{k}` and :math:`\\overline{u}_{l}` parameter arrays as a tuple
    :rtype: tuple
    """
    # Compute uk
    uk = [0.0 for _ in range(size_u)]

    # Compute for each curve on the v-direction
    uk_temp = []
    for v in range(size_v):
        pts_u = [points[v + (size_v * u)] for u in range(size_u)]
        uk_temp += compute_params_curve(pts_u, centripetal)

    # Do averaging on the u-direction
    for u in range(size_u):
        knots_v = [uk_temp[u + (size_u * v)] for v in range(size_v)]
        uk[u] = sum(knots_v) / size_v

    # Compute vl
    vl = [0.0 for _ in range(size_v)]

    # Compute for each curve on the u-direction
    vl_temp = []
    for u in range(size_u):
        pts_v = [points[v + (size_v * u)] for v in range(size_v)]
        vl_temp += compute_params_curve(pts_v, centripetal)

    # Do averaging on the v-direction
    for v in range(size_v):
        knots_u = [vl_temp[v + (size_v * u)] for u in range(size_u)]
        vl[v] = sum(knots_u) / size_u

    return uk, vl
def compute_params_surface ( points , size_u , size_v , centripetal = False ) : # Compute uk uk = [ 0.0 for _ in range ( size_u ) ] # Compute for each curve on the v-direction uk_temp = [ ] for v in range ( size_v ) : pts_u = [ points [ v + ( size_v * u ) ] for u in range ( size_u ) ] uk_temp += compute_params_curve ( pts_u , centripetal ) # Do averaging on the u-direction for u in range ( size_u ) : knots_v = [ uk_temp [ u + ( size_u * v ) ] for v in range ( size_v ) ] uk [ u ] = sum ( knots_v ) / size_v # Compute vl vl = [ 0.0 for _ in range ( size_v ) ] # Compute for each curve on the u-direction vl_temp = [ ] for u in range ( size_u ) : pts_v = [ points [ v + ( size_v * u ) ] for v in range ( size_v ) ] vl_temp += compute_params_curve ( pts_v , centripetal ) # Do averaging on the v-direction for v in range ( size_v ) : knots_u = [ vl_temp [ v + ( size_v * u ) ] for u in range ( size_u ) ] vl [ v ] = sum ( knots_u ) / size_u return uk , vl