예제 #1
0
        public BBox3D BoundingBox(Packable packable)
        {
            BBox3D        bbox          = new BBox3D();
            PackableBrick packableBrick = packable as PackableBrick;

            if (null != packableBrick)
            {
                Vector3D dimensions = packableBrick.OuterDimensions;
                foreach (BoxPosition bpos in this)
                {
                    Vector3D[] pts = new Vector3D[8];
                    Vector3D   vI  = HalfAxis.ToVector3D(bpos.DirectionLength);
                    Vector3D   vJ  = HalfAxis.ToVector3D(bpos.DirectionWidth);
                    Vector3D   vK  = Vector3D.CrossProduct(vI, vJ);
                    pts[0] = bpos.Position;
                    pts[1] = bpos.Position + dimensions.X * vI;
                    pts[2] = bpos.Position + dimensions.Y * vJ;
                    pts[3] = bpos.Position + dimensions.X * vI + dimensions.Y * vJ;
                    pts[4] = bpos.Position + dimensions.Z * vK;
                    pts[5] = bpos.Position + dimensions.Y * vJ + dimensions.Z * vK;
                    pts[6] = bpos.Position + HalfAxis.ToVector3D(bpos.DirectionWidth) * dimensions.Y;
                    pts[7] = bpos.Position + HalfAxis.ToVector3D(bpos.DirectionLength) * dimensions.X + HalfAxis.ToVector3D(bpos.DirectionWidth) * dimensions.Y;

                    foreach (Vector3D pt in pts)
                    {
                        bbox.Extend(pt);
                    }
                }
            }
            return(bbox);
        }
예제 #2
0
 /// <summary>
 ///  Outer dimensions
 /// </summary>
 /// <param name="optimizer">Parent optimizer class</param>
 /// <returns>Outer dimensions stored in Vector3D</returns>
 public Vector3D OuterDimensions(PackableBrick packBrick, ParamSetPackOptim paramSet)
 {
     return(new Vector3D(
                _arrangement.Length * packBrick.Dim(Dim0) + paramSet.WallThickness * paramSet.NoWalls[0]
                , _arrangement.Width * packBrick.Dim(Dim1) + paramSet.WallThickness * paramSet.NoWalls[1]
                , _arrangement.Height * packBrick.Dim(Dim2) + paramSet.WallThickness * paramSet.NoWalls[2]
                ));
 }
예제 #3
0
 /// <summary>
 /// Inner dimensions
 /// </summary>
 /// <param name="optimizer">Parent optimizer class</param>
 /// <returns>Inner dimensions stored in Vector3D</returns>
 public Vector3D InnerDimensions(PackableBrick packBrick)
 {
     return(new Vector3D(
                _arrangement.Length * packBrick.Dim(Dim0)
                , _arrangement.Width * packBrick.Dim(Dim1)
                , _arrangement.Height * packBrick.Dim(Dim2)
                ));
 }
예제 #4
0
        public double Area(PackableBrick packable, ParamSetPackOptim constraintSet)
        {
            Vector3D outerDim = OuterDimensions(packable, constraintSet);

            return((constraintSet.NoWalls[0] * outerDim.Y * outerDim.Z
                    + constraintSet.NoWalls[1] * outerDim.X * outerDim.Z
                    + constraintSet.NoWalls[2] * outerDim.X * outerDim.Y) * UnitsManager.FactorSquareLengthToArea);
        }
예제 #5
0
        /// <summary>
        /// Returns true
        /// </summary>
        /// <param name="optimizer"></param>
        /// <returns></returns>
        public bool IsValid(PackableBrick packable, ParamSetPackOptim paramSet)
        {
            Vector3D outerDim = OuterDimensions(packable, paramSet);

            return(outerDim.X <= paramSet.CaseLimitMax.X && outerDim.Y <= paramSet.CaseLimitMax.Y && outerDim.Z <= paramSet.CaseLimitMax.Z &&
                   outerDim.X >= paramSet.CaseLimitMin.X && outerDim.Y >= paramSet.CaseLimitMin.Y && outerDim.Z >= paramSet.CaseLimitMin.Z &&
                   ((_dim0 == 0 && _dim1 == 1) || !paramSet.ForceVerticalcaseOrientation));
        }
        public PackProperties(Document doc
                              , PackableBrick box
                              , PackArrangement arrangement
                              , HalfAxis.HAxis orientation
                              , PackWrapper wrapper)
            : base(doc)
        {
            _innerPackable = box;
            if (null != doc)
            {
                _innerPackable.AddDependancy(this);
            }

            Arrangement    = arrangement;
            BoxOrientation = orientation;
            Wrap           = wrapper;
        }
예제 #7
0
 public double TotalWeight(PackableBrick packable, ParamSetPackOptim constraintSet)
 {
     return(InnerWeight(packable) + EmptyWeight(packable, constraintSet));
 }
예제 #8
0
 public double InnerWeight(PackableBrick packable)
 {
     return(_arrangement.Number * packable.Weight);
 }
예제 #9
0
 public double EmptyWeight(PackableBrick packable, ParamSetPackOptim constraintSet)
 {
     return(Area(packable, constraintSet) * constraintSet.WallSurfaceMass);
 }
예제 #10
0
        public double OuterVolume(PackableBrick packable, ParamSetPackOptim constraintSet)
        {
            Vector3D outerDim = OuterDimensions(packable, constraintSet);

            return(outerDim.X * outerDim.Y * outerDim.Z);
        }
예제 #11
0
        public double InnerVolume(PackableBrick packable)
        {
            Vector3D innerDim = InnerDimensions(packable);

            return(innerDim.X * innerDim.Y * innerDim.Z);
        }
예제 #12
0
 public double BoxHeight(PackableBrick packable) => packable.Dim(Dim2);
예제 #13
0
 public double BoxWidth(PackableBrick packable) => packable.Dim(_dim1);
예제 #14
0
 public double BoxLength(PackableBrick packable) => packable.Dim(_dim0);
예제 #15
0
 public double CaseEmptyWeight(PackableBrick boxProperties, ParamSetPackOptim paramSet)
 {
     return(paramSet.WallSurfaceMass * Area(boxProperties, paramSet));
 }
예제 #16
0
 public StrapperSet(PackableBrick packable)
 {
     Packable = packable;
 }