def get_all_planes_deprecated(
        self, obj, face_mask, tolerance=1e-4
    ) -> tuple[str, int]:
        "get all unique planes formed by faces in face_mask"
        # ASSUMES: object is triangulated, no quads/polygons
        unique_planes = []
        for polygon in obj.data.polygons:
            if not face_mask[polygon.index]:
                continue
            vertex = butil.global_vertex_coordinates(
                obj, obj.data.vertices[polygon.vertices[0]]
            )
            normal = butil.global_polygon_normal(obj, polygon)
            belongs_to_existing_plane = False
            for name, polygon2_index in unique_planes:
                polygon2 = obj.data.polygons[polygon2_index]
                plane_vertex = butil.global_vertex_coordinates(
                    obj, obj.data.vertices[polygon2.vertices[0]]
                )
                plane_normal = butil.global_polygon_normal(obj, polygon2)
                if np.allclose(
                    np.cross(normal, plane_normal), 0, rtol=tolerance
                ) and np.allclose(
                    np.dot(vertex - plane_vertex, plane_normal), 0, rtol=tolerance
                ):
                    belongs_to_existing_plane = True
                    break
            if (
                not belongs_to_existing_plane
                and polygon.normal
                and polygon.normal.length > 0
            ):
                unique_planes.append((obj.name, polygon.index))
        return unique_planes
get all unique planes formed by faces in face_mask
infinigen/core/constraints/example_solver/geometry/planes.py