public ((int x, int y) min, (int x, int y) max) GetMinAndMax(IVoxelOrientation orientation)
    {
        var(minA, maxA) = a.GetMinAndMax(orientation);
        var(minB, maxB) = a.GetMinAndMax(orientation);

        return(minA.Zip(minB, Math.Min), maxA.Zip(maxB, Math.Max));
    }
Example #2
0
    public static IEnumerable <(int x, int y)> GetVoxelsInBounds(this IVoxelBounds2 bounds, IVoxelOrientation orientation)
    {
        var(min, max) = bounds.GetMinAndMax(orientation);

        for (int x = min.x; x <= max.x; x++)
        {
            for (int y = min.y; y <= max.y; y++)
            {
                yield return(x, y);
            }
        }
    }