private BBox3D ComputeLoadBBox3D()
        {
            BBox3D   bbox          = new BBox3D();
            bool     hasInterlayer = false;
            double   zInterlayer   = 0.0;
            BoxLayer layer0        = GetBoxLayer(0, ref hasInterlayer, ref zInterlayer);

            bbox.Extend(layer0.BoundingBox(Analysis.PackProperties));
            BoxLayer layerN = GetBoxLayer(LayerCount - 1, ref hasInterlayer, ref zInterlayer);

            bbox.Extend(layerN.BoundingBox(Analysis.PackProperties));
            return(bbox);
        }
Пример #2
0
        public BBox3D BoundingBox(PackProperties packProperties)
        {
            BBox3D bbox = new BBox3D();

            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 + packProperties.Length * vI;
                pts[2] = bpos.Position + packProperties.Width * vJ;
                pts[3] = bpos.Position + packProperties.Length * vI + packProperties.Width * vJ;
                pts[4] = bpos.Position + packProperties.Height * vK;
                pts[5] = bpos.Position + packProperties.Width * vJ + packProperties.Height * vK; ;
                pts[6] = bpos.Position + HalfAxis.ToVector3D(bpos.DirectionWidth) * packProperties.Width;
                pts[7] = bpos.Position + HalfAxis.ToVector3D(bpos.DirectionLength) * packProperties.Length + HalfAxis.ToVector3D(bpos.DirectionWidth) * packProperties.Width;

                foreach (Vector3D pt in pts)
                    bbox.Extend(pt);
            }

            return bbox;       
        }
Пример #3
0
        /// <summary>
        /// Compute layer bouding box
        /// </summary>
        /// <param name="bProperties">Case properties</param>
        /// <returns>bounding box</returns>
        public BBox3D BoundingBox(CylinderProperties cylProperties)
        {
            BBox3D bbox = new BBox3D();

            double radius = cylProperties.RadiusOuter;
            double height = cylProperties.Height;

            foreach (Vector3D pos in this)
            {
                Vector3D[] pts = new Vector3D[8];
                pts[0] = pos - radius * Vector3D.XAxis - radius * Vector3D.YAxis;
                pts[1] = pos + radius * Vector3D.XAxis - radius * Vector3D.YAxis;
                pts[2] = pos + radius * Vector3D.XAxis + radius * Vector3D.YAxis;
                pts[3] = pos - radius * Vector3D.XAxis + radius * Vector3D.YAxis;
                pts[4] = pos - radius * Vector3D.XAxis - radius * Vector3D.YAxis + height * Vector3D.ZAxis;
                pts[5] = pos + radius * Vector3D.XAxis - radius * Vector3D.YAxis + height * Vector3D.ZAxis;
                pts[6] = pos + radius * Vector3D.XAxis + radius * Vector3D.YAxis + height * Vector3D.ZAxis;
                pts[7] = pos - radius * Vector3D.XAxis + radius * Vector3D.YAxis + height * Vector3D.ZAxis;

                foreach (Vector3D pt in pts)
                {
                    bbox.Extend(pt);
                }
            }
            return(bbox);
        }
Пример #4
0
 private BBox3D ComputeLoadBBox3D()
 {
     BBox3D bbox = new BBox3D();
     int iLayer = 0;
     while (iLayer < Count)
     {
         ILayer layer = this[iLayer];
         BoxLayer blayer = layer as BoxLayer;
         if (null != blayer)
             bbox.Extend(blayer.BoundingBox(Analysis.BProperties));
         ++iLayer;
     }
     return bbox;
 }
Пример #5
0
        private BBox3D ComputeLoadBBox3D()
        {
            BBox3D bbox   = new BBox3D();
            int    iLayer = 0;

            while (iLayer < Count)
            {
                ILayer        layer  = this[iLayer];
                CylinderLayer blayer = layer as CylinderLayer;
                if (null != blayer)
                {
                    bbox.Extend(blayer.BoundingBox(Analysis.CylinderProperties));
                }
                ++iLayer;
            }
            return(bbox);
        }
Пример #6
0
        private BBox3D ComputeLoadBBox3D()
        {
            double palletLength = ParentTruckAnalysis.ParentSolution.PalletLength;
            double palletWidth  = ParentTruckAnalysis.ParentSolution.PalletWidth;
            double palletHeight = ParentTruckAnalysis.ParentSolution.PalletHeight;

            BBox3D bbox   = new BBox3D();
            int    iLayer = 0;

            while (iLayer < NoLayers)
            {
                foreach (BoxPosition bPositionLayer in Layer)
                {
                    // actual position in load
                    BoxPosition bpos = new BoxPosition(
                        new Vector3D(
                            bPositionLayer.Position.X
                            , bPositionLayer.Position.Y
                            , bPositionLayer.Position.Z + palletHeight * iLayer)
                        , bPositionLayer.DirectionLength
                        , bPositionLayer.DirectionWidth);

                    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 + palletLength * vI;
                    pts[2] = bpos.Position + palletWidth * vJ;
                    pts[3] = bpos.Position + palletLength * vI + palletWidth * vJ;
                    pts[4] = bpos.Position + palletHeight * vK;
                    pts[5] = bpos.Position + palletWidth * vJ + palletHeight * vK;;
                    pts[6] = bpos.Position + HalfAxis.ToVector3D(bpos.DirectionWidth) * palletWidth;
                    pts[7] = bpos.Position + HalfAxis.ToVector3D(bpos.DirectionLength) * palletLength + HalfAxis.ToVector3D(bpos.DirectionWidth) * palletWidth;

                    foreach (Vector3D pt in pts)
                    {
                        bbox.Extend(pt);
                    }
                }
                ++iLayer;
            }
            return(bbox);
        }
Пример #7
0
        public BBox3D BBox(double radius, double length)
        {
            Transform3D t = Transf;

            Vector3D[] pts = new Vector3D[]
            {
                new Vector3D(0.0, -radius, -radius),
                new Vector3D(0.0, -radius, radius),
                new Vector3D(0.0, radius, -radius),
                new Vector3D(0.0, radius, radius),
                new Vector3D(length, -radius, -radius),
                new Vector3D(length, -radius, radius),
                new Vector3D(length, radius, -radius),
                new Vector3D(length, radius, radius)
            };
            BBox3D bbox = new BBox3D();

            foreach (Vector3D pt in pts)
            {
                bbox.Extend(t.transform(pt));
            }
            return(bbox);
        }
 public BBox3D BBox(double radius, double length)
 {
     Transform3D t = Transf;
     Vector3D[] pts = new Vector3D[]
         {
             new Vector3D(0.0, -radius, -radius),
             new Vector3D(0.0, -radius, radius),
             new Vector3D(0.0, radius, -radius),
             new Vector3D(0.0, radius, radius),
             new Vector3D(length, -radius, -radius),
             new Vector3D(length, -radius, radius),
             new Vector3D(length, radius, -radius),
             new Vector3D(length, radius, radius)
         };
     BBox3D bbox = new BBox3D();
     foreach (Vector3D pt in pts)
         bbox.Extend(t.transform(pt));
     return bbox;
 }
Пример #9
0
        private BBox3D ComputeLoadBBox3D()
        {
            double palletLength = ParentTruckAnalysis.ParentSolution.PalletLength;
            double palletWidth = ParentTruckAnalysis.ParentSolution.PalletWidth;
            double palletHeight = ParentTruckAnalysis.ParentSolution.PalletHeight;

            BBox3D bbox = new BBox3D();
            int iLayer = 0;
            while (iLayer < NoLayers)
            {
                foreach (BoxPosition bPositionLayer in Layer)
                {
                    // actual position in load
                    BoxPosition bpos = new BoxPosition(
                        new Vector3D(
                            bPositionLayer.Position.X
                            , bPositionLayer.Position.Y
                            , bPositionLayer.Position.Z + palletHeight * iLayer)
                        , bPositionLayer.DirectionLength
                        , bPositionLayer.DirectionWidth);

                    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 + palletLength * vI;
                    pts[2] = bpos.Position + palletWidth * vJ;
                    pts[3] = bpos.Position + palletLength * vI + palletWidth * vJ;
                    pts[4] = bpos.Position + palletHeight * vK;
                    pts[5] = bpos.Position + palletWidth * vJ + palletHeight * vK; ;
                    pts[6] = bpos.Position + HalfAxis.ToVector3D(bpos.DirectionWidth) * palletWidth;
                    pts[7] = bpos.Position + HalfAxis.ToVector3D(bpos.DirectionLength) * palletLength + HalfAxis.ToVector3D(bpos.DirectionWidth) * palletWidth;

                    foreach (Vector3D pt in pts)
                        bbox.Extend(pt);

                }
                ++iLayer;
            }
            return bbox;
        }
 private BBox3D ComputeLoadBBox3D()
 {
     BBox3D bbox = new BBox3D();
     bool hasInterlayer = false;
     double zInterlayer = 0.0;
     BoxLayer layer0 = GetBoxLayer(0, ref hasInterlayer, ref zInterlayer);
     bbox.Extend(layer0.BoundingBox(Analysis.PackProperties));
     BoxLayer layerN = GetBoxLayer(LayerCount - 1, ref hasInterlayer, ref zInterlayer);
     bbox.Extend(layerN.BoundingBox(Analysis.PackProperties));
     return bbox;
 }