# Path: geomeppy/utilities.py
# def almostequal(first, second, places=7):
#     # type: (Any, Any, int) -> bool
#     """Tests a range of types for near equality."""
#     try:
#         # try converting to float first
#         first = float(first)
#         second = float(second)
#         # test floats for near-equality
#         if round(abs(second - first), places) != 0:
#             return False
#         else:
#             return True
#     except ValueError:
#         # handle non-float types
#         return str(first) == str(second)
#     except TypeError:
#         # handle iterables
#         return all([almostequal(a, b, places) for a, b in zip(first, second)])


from typing import List  # noqa
    from .polygons import Polygon  # noqa
from ..utilities import almostequal
import pyclipper as pc

        return self._process(unions)

    def _prepare_clipper(self, poly):
        """Prepare 2D polygons for clipping operations.

        :param poly: The clip polygon.
        :returns: A Pyclipper object.

        """
        s1 = pc.scale_to_clipper(self.vertices_list)
        s2 = pc.scale_to_clipper(poly.vertices_list)
        clipper = pc.Pyclipper()
        clipper.AddPath(s1, poly_type=pc.PT_SUBJECT, closed=True)
        clipper.AddPath(s2, poly_type=pc.PT_CLIP, closed=True)
        return clipper

    def _process(self, results):
        """Process and return the results of a clipping operation.

        :param results: A list of lists of coordinates .
        :returns: A list of Polygon2D results of the clipping operation.

        """
        if not results:
            return []
        scaled = [pc.scale_from_clipper(r) for r in results]
        polys = [self.as_2d(r) for r in scaled]
        processed = []
        for poly in polys:

# Path: geomeppy/utilities.py
# def almostequal(first, second, places=7):
#     # type: (Any, Any, int) -> bool
#     """Tests a range of types for near equality."""
#     try:
#         # try converting to float first
#         first = float(first)
#         second = float(second)
#         # test floats for near-equality
#         if round(abs(second - first), places) != 0:
#             return False
#         else:
#             return True
#     except ValueError:
#         # handle non-float types
#         return str(first) == str(second)
#     except TypeError:
#         # handle iterables
#         return all([almostequal(a, b, places) for a, b in zip(first, second)])


# Path: geomeppy/geom/clippers.py
from typing import List  # noqa
    from .polygons import Polygon  # noqa
from ..utilities import almostequal
import pyclipper as pc


        return self._process(unions)

    def _prepare_clipper(self, poly):
        """Prepare 2D polygons for clipping operations.

        :param poly: The clip polygon.
        :returns: A Pyclipper object.

        """
        s1 = pc.scale_to_clipper(self.vertices_list)
        s2 = pc.scale_to_clipper(poly.vertices_list)
        clipper = pc.Pyclipper()
        clipper.AddPath(s1, poly_type=pc.PT_SUBJECT, closed=True)
        clipper.AddPath(s2, poly_type=pc.PT_CLIP, closed=True)
        return clipper

    def _process(self, results):
        """Process and return the results of a clipping operation.

        :param results: A list of lists of coordinates .
        :returns: A list of Polygon2D results of the clipping operation.

        """
        if not results:
            return []
        scaled = [pc.scale_from_clipper(r) for r in results]
        polys = [self.as_2d(r) for r in scaled]
        processed = []
        for poly in polys:

            if almostequal(poly.normal_vector, self.normal_vector):