def face_attr(script, name='<STR_LIT>', function='<STR_LIT>'):
filter_xml = '<STR_LIT>'.join([<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>'.format(name),<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>'.format(str(function).replace('<STR_LIT:&>', '<STR_LIT>').replace('<STR_LIT:<>', '<STR_LIT>')),<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>'])<EOL>util.write_filter(script, filter_xml)<EOL>return None<EOL>
Add a new Per-Face attribute to current mesh and fill it with
        the defined function..

    The specified name can be used in other filter functions.

    It's possible to use parenthesis, per-face variables and boolean operator:
        (, ), and, or, <, >, =

    It's possible to use per-face variables like attributes associated to the
    three vertices of every face.

    It's possible to use the following per-face variables in the expression:

    Variables:
        x0,y0,z0 (first vertex); x1,y1,z1 (second vertex); x2,y2,z2 (third vertex)
        nx0,ny0,nz0; nx1,ny1,nz1; nx2,ny2,nz2 (normals)
        r0,g0,b0 (color)
        q0,q1,q2 (quality)
        wtu0, wtv0; wtu1, wtv1; wtu2, wtv2 (per wedge tex coord)
        fi (face index)
        ?fsel (is the vertex selected? 1 yes, 0 no)
        fi (face index)
        and all custom face attributes already defined by user.

    Args:
        script: the FilterScript object or script filename to write
            the filter] to.
        name (str): the name of new attribute. You can access attribute in
            other filters through this name.
        function (str): function to calculate custom attribute value for each
            face

    Layer stack:
        No impacts

    MeshLab versions:
        2016.12
        1.3.4BETA