Beispiel #1
0
        /// <summary>
        /// Calculates the sum for a given set of V3is.
        /// </summary>
        public static V3i Sum(this V3i[] vectors)
        {
            V3i sum = V3i.Zero;

            for (var i = 0; i < vectors.Length; i++)
            {
                sum += vectors[i];
            }

            return(sum);
        }
Beispiel #2
0
        /// <summary>
        /// Calculates the sum for a given set of V3is.
        /// </summary>
        public static V3i Sum(this IEnumerable <V3i> vectors)
        {
            V3i sum = V3i.Zero;

            foreach (var e in vectors)
            {
                sum += e;
            }

            return(sum);
        }
Beispiel #3
0
 /// <summary>
 /// Split the supplied PolyMeshes into a grid (stored as a
 /// volume of lists of PolyMeshes) of cells specified by
 /// the grid size and the size of the cells. Note, that the first
 /// split plane in each direction is offset by one cell size with
 /// respect to the origin.
 /// </summary>
 public static Volume <List <PolyMesh> > SplitOnGrid(
     this IEnumerable <PolyMesh> polyMeshes,
     V3d origin, V3d cellSize, V3i gridSize, double epsilon)
 {
     return(polyMeshes.SplitOnGrid(origin, cellSize, gridSize, epsilon, s_polyMeshSplitOnPlane));
 }
 public void Write(V3i x)
 {
     Write(x.X); Write(x.Y); Write(x.Z);
 }
Beispiel #5
0
 public PixVolumeInfo(PixFormat format, V3i size)
 {
     Format = format; Size = size;
 }
Beispiel #6
0
 public PixVolume(Col.Format format, V3i size, int channelCount)
     : this(format, CreateTensor4 <T>(size.X, size.Y, size.Z, channelCount))
 {
 }
Beispiel #7
0
 public PixVolume(Col.Format format, V3i size)
     : this(format, CreateTensor4 <T>(size.X, size.Y, size.Z, Col.ChannelCount(format)))
 {
 }
Beispiel #8
0
 public PixVolume(V3i size, int channelCount)
     : this(Col.FormatDefaultOf(typeof(T), channelCount),
            CreateTensor4 <T>(size.X, size.Y, size.Z, channelCount))
 {
 }
Beispiel #9
0
 /// <summary>Computes MD5 hash of given data.</summary>
 public static Guid ComputeMd5Hash(this V3i x)
 => ComputeMd5Hash(bw => { bw.Write(x.X); bw.Write(x.Y); bw.Write(x.Z); });