<commit_before>from __future__ import print_function
from __future__ import absolute_import
from __future__ import division

from compas.geometry import project_points_plane
from compas.geometry import centroid_points

from compas.geometry import distance_point_point
from compas.geometry import distance_line_line

from compas.geometry.algorithms.bestfit import bestfit_plane

from compas.utilities import window


__author__    = '<NAME>'
__copyright__ = 'Copyright 2016, Block Research Group - ETH Zurich'
__license__   = 'MIT license'
__email__     = '<EMAIL>'


__all__ = [
    'flatness',
    'planarize_faces',
    'mesh_flatness',
    'mesh_planarize_faces',
    'mesh_planarize_faces_shapeop',
]


def flatness(vertices, faces, maxdev=0.02):
    """Compute mesh flatness per face.

    Parameters
    ----------
    vertices : list
        The vertex coordinates.
    faces : list
        The face vertices.
    maxdev : float, optional
        A maximum value for the allowed deviation from flatness.
        Default is ``0.02``.

    Returns
    -------
    dict<commit_msg>removed references to shapeop<commit_after>from __future__ import print_function
from __future__ import absolute_import
from __future__ import division

from compas.geometry import project_points_plane
from compas.geometry import centroid_points

from compas.geometry import distance_point_point
from compas.geometry import distance_line_line

from compas.geometry.algorithms.bestfit import bestfit_plane

from compas.utilities import window


__author__    = '<NAME>'
__copyright__ = 'Copyright 2016, Block Research Group - ETH Zurich'
__license__   = 'MIT license'
__email__     = '<EMAIL>'


__all__ = [
    'flatness',
    'planarize_faces',
    'mesh_flatness',
    'mesh_planarize_faces',
]


def flatness(vertices, faces, maxdev=0.02):
    """Compute mesh flatness per face.

    Parameters
    ----------
    vertices : list
        The vertex coordinates.
    faces : list
        The face vertices.
    maxdev : float, optional
        A maximum value for the allowed deviation from flatness.
        Default is ``0.02``.

    Returns
    -------
    dict
{'fraction_non_alphanumeric': 0.08046511627906977, 'fraction_numerical': 0.009302325581395349, 'mean_word_length': 3.3454545454545452, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2487023', 'n_tokens_mistral': 635, 'n_tokens_neox': 613, 'n_words': 189}