Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/28/17 16:10:31 (6 years ago)
Author:
rhanghof
Message:

#2817:

  • Added line projection based bin packing
  • Added residual spaces to the view
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Geometry/Vector3D.cs

    r15454 r15488  
    66
    77namespace HeuristicLab.Problems.BinPacking3D.Geometry {
    8   internal class Vector3D {
     8  public class Vector3D {
    99
    1010    public int X { get; set; }
     
    2323      Z = pos.Z;
    2424    }
     25
     26    public PackingPosition ToPackingPosition(int assignedBin) {
     27      return new PackingPosition(assignedBin, X, Y, Z);
     28    }
     29
    2530    public static Vector3D AlongX(Vector3D pos, PackingItem item) {
    2631      return new Vector3D(
     
    8691      return new Vector3D(a * b.X, a * b.Y, a * b.Z);
    8792    }
     93
     94    public static Vector3D operator *(double a, Vector3D b) {
     95      return new Vector3D((int)(a * b.X), (int)(a * b.Y), (int)(a * b.Z));
     96    }
     97
    8898    public static Vector3D operator *(Vector3D a, int b) {
    8999      return new Vector3D(a.X * b, a.Y * b, a.Z * b);
    90100    }
     101
     102    public static Vector3D operator *(Vector3D a, double b) {
     103      return new Vector3D((int)(b * a.X), (int)(b * a.Y), (int)(b * a.Z));
     104    }
     105
    91106    public static Vector3D operator +(Vector3D a, Vector3D b) {
    92107      return new Vector3D(a.X + b.X, a.Y + b.Y, a.Z + b.Z);
Note: See TracChangeset for help on using the changeset viewer.