(elem, mconf, colorval, idx, force_tsl, update_delta, delta, reset_names)
return rl
Processes visualization elements for surfaces.

    .. note:: Helper function required for ``multiprocessing``

    :param elem: surface
    :type elem: abstract.Surface
    :param mconf: visualization module configuration
    :type mconf: dict
    :param colorval: color values
    :type colorval: tuple
    :param idx: index of the surface
    :type idx: int
    :param force_tsl: flag to force re-tessellation
    :type force_tsl: bool
    :param update_delta: flag to update surface delta
    :type update_delta: bool
    :param delta: new surface evaluation delta
    :type delta: list, tuple
    :param reset_names: flag to reset names
    :type reset_names: bool
    :return: visualization element (as a dict)
    :rtype: list
Processes visualization elements for surfaces.
Processes visualization elements for surfaces .
def process_elements_surface(elem, mconf, colorval, idx, force_tsl, update_delta, delta, reset_names):
    """ Processes visualization elements for surfaces.

    .. note:: Helper function required for ``multiprocessing``

    :param elem: surface
    :type elem: abstract.Surface
    :param mconf: visualization module configuration
    :type mconf: dict
    :param colorval: color values
    :type colorval: tuple
    :param idx: index of the surface
    :type idx: int
    :param force_tsl: flag to force re-tessellation
    :type force_tsl: bool
    :param update_delta: flag to update surface delta
    :type update_delta: bool
    :param delta: new surface evaluation delta
    :type delta: list, tuple
    :param reset_names: flag to reset names
    :type reset_names: bool
    :return: visualization element (as a dict)
    :rtype: list
    """
    if idx < 0:
        lock.acquire()
        idx = counter.value
        counter.value += 1
        lock.release()

    if update_delta:
        elem.delta = delta
    elem.evaluate()

    # Reset element name
    if reset_names:
        elem.name = "surface"

    # Fix element name
    if elem.name == "surface" and idx >= 0:
        elem.name = elem.name + " " + str(idx)

    # Color selection
    color = select_color(colorval[0], colorval[1], idx=idx)

    # Initialize the return list
    rl = []

    # Add control points
    if mconf['ctrlpts'] == 'points':
        ret = dict(ptsarr=elem.ctrlpts, name=(elem.name, "(CP)"),
                   color=color[0], plot_type='ctrlpts', idx=idx)
        rl.append(ret)

    # Add control points as quads
    if mconf['ctrlpts'] == 'quads':
        qtsl = tessellate.QuadTessellate()
        qtsl.tessellate(elem.ctrlpts, size_u=elem.ctrlpts_size_u, size_v=elem.ctrlpts_size_v)
        ret = dict(ptsarr=[qtsl.vertices, qtsl.faces], name=(elem.name, "(CP)"),
                   color=color[0], plot_type='ctrlpts', idx=idx)
        rl.append(ret)

    # Add surface points
    if mconf['evalpts'] == 'points':
        ret = dict(ptsarr=elem.evalpts, name=(elem.name, idx), color=color[1], plot_type='evalpts', idx=idx)
        rl.append(ret)

    # Add surface points as quads
    if mconf['evalpts'] == 'quads':
        qtsl = tessellate.QuadTessellate()
        qtsl.tessellate(elem.evalpts, size_u=elem.sample_size_u, size_v=elem.sample_size_v)
        ret = dict(ptsarr=[qtsl.vertices, qtsl.faces],
                   name=elem.name, color=color[1], plot_type='evalpts', idx=idx)
        rl.append(ret)

    # Add surface points as vertices and triangles
    if mconf['evalpts'] == 'triangles':
        elem.tessellate(force=force_tsl)
        ret = dict(ptsarr=[elem.tessellator.vertices, elem.tessellator.faces],
                   name=elem.name, color=color[1], plot_type='evalpts', idx=idx)
        rl.append(ret)

    # Add the trim curves
    for itc, trim in enumerate(elem.trims):
        ret = dict(ptsarr=elem.evaluate_list(trim.evalpts), name=("trim", itc),
                   color=colorval[2], plot_type='trimcurve', idx=idx)
        rl.append(ret)

    # Return the list
    return rl
def process_elements_surface ( elem , mconf , colorval , idx , force_tsl , update_delta , delta , reset_names ) : if idx < 0 : lock . acquire ( ) idx = counter . value counter . value += 1 lock . release ( ) if update_delta : elem . delta = delta elem . evaluate ( ) # Reset element name if reset_names : elem . name = "surface" # Fix element name if elem . name == "surface" and idx >= 0 : elem . name = elem . name + " " + str ( idx ) # Color selection color = select_color ( colorval [ 0 ] , colorval [ 1 ] , idx = idx ) # Initialize the return list rl = [ ] # Add control points if mconf [ 'ctrlpts' ] == 'points' : ret = dict ( ptsarr = elem . ctrlpts , name = ( elem . name , "(CP)" ) , color = color [ 0 ] , plot_type = 'ctrlpts' , idx = idx ) rl . append ( ret ) # Add control points as quads if mconf [ 'ctrlpts' ] == 'quads' : qtsl = tessellate . QuadTessellate ( ) qtsl . tessellate ( elem . ctrlpts , size_u = elem . ctrlpts_size_u , size_v = elem . ctrlpts_size_v ) ret = dict ( ptsarr = [ qtsl . vertices , qtsl . faces ] , name = ( elem . name , "(CP)" ) , color = color [ 0 ] , plot_type = 'ctrlpts' , idx = idx ) rl . append ( ret ) # Add surface points if mconf [ 'evalpts' ] == 'points' : ret = dict ( ptsarr = elem . evalpts , name = ( elem . name , idx ) , color = color [ 1 ] , plot_type = 'evalpts' , idx = idx ) rl . append ( ret ) # Add surface points as quads if mconf [ 'evalpts' ] == 'quads' : qtsl = tessellate . QuadTessellate ( ) qtsl . tessellate ( elem . evalpts , size_u = elem . sample_size_u , size_v = elem . sample_size_v ) ret = dict ( ptsarr = [ qtsl . vertices , qtsl . faces ] , name = elem . name , color = color [ 1 ] , plot_type = 'evalpts' , idx = idx ) rl . append ( ret ) # Add surface points as vertices and triangles if mconf [ 'evalpts' ] == 'triangles' : elem . tessellate ( force = force_tsl ) ret = dict ( ptsarr = [ elem . tessellator . vertices , elem . tessellator . faces ] , name = elem . name , color = color [ 1 ] , plot_type = 'evalpts' , idx = idx ) rl . append ( ret ) # Add the trim curves for itc , trim in enumerate ( elem . trims ) : ret = dict ( ptsarr = elem . evaluate_list ( trim . evalpts ) , name = ( "trim" , itc ) , color = colorval [ 2 ] , plot_type = 'trimcurve' , idx = idx ) rl . append ( ret ) # Return the list return rl