示例#1
0
        public List <BoxPositionIndexed> ToBoxPositionIndexed(BoxPositionJS bposjs, Vector3D dimCase, int relIndex)
        {
            HalfAxis.HAxis axisLength = HalfAxis.HAxis.AXIS_X_P;
            HalfAxis.HAxis axisWidth  = HalfAxis.HAxis.AXIS_Y_P;
            Vector2D       offsetPos  = Vector2D.Zero;
            Vector3D       multDir    = Vector3D.Zero;

            if (Math.Abs(bposjs.Angle) < 1.0)
            {
                axisLength = HalfAxis.HAxis.AXIS_X_P; axisWidth = HalfAxis.HAxis.AXIS_Y_P; offsetPos = new Vector2D(0.0, -dimCase.Y); multDir = -Vector3D.YAxis;
            }
            else if (Math.Abs(bposjs.Angle - 90.0) < 1.0)
            {
                axisLength = HalfAxis.HAxis.AXIS_Y_P; axisWidth = HalfAxis.HAxis.AXIS_X_N; offsetPos = new Vector2D(0.0, -dimCase.X); multDir = -Vector3D.XAxis;
            }
            else if (Math.Abs(bposjs.Angle - 180.0) < 1.0)
            {
                axisLength = HalfAxis.HAxis.AXIS_X_N; axisWidth = HalfAxis.HAxis.AXIS_Y_N; offsetPos = new Vector2D(0.0, dimCase.Y); multDir = Vector3D.YAxis;
            }
            else if (Math.Abs(bposjs.Angle - 270.0) < 1.0)
            {
                axisLength = HalfAxis.HAxis.AXIS_Y_N; axisWidth = HalfAxis.HAxis.AXIS_X_P; offsetPos = new Vector2D(0.0, dimCase.X); multDir = Vector3D.XAxis;
            }

            var      boxPositions = new List <BoxPositionIndexed>();
            Vector2D pos2D        = PtCanvasToWorld(new Vector2D(bposjs.X, bposjs.Y)) + offsetPos;

            for (int i = 0; i < bposjs.NumberCase; ++i)
            {
                Vector3D position = new Vector3D(pos2D.X, pos2D.Y, 0.0) + i * dimCase.Y * multDir;
                boxPositions.Add(new BoxPositionIndexed(position, axisLength, axisWidth, relIndex));
            }
            return(boxPositions);
        }
示例#2
0
        private void Initialize(PackProperties packProperties)
        {
            switch (_axisOrtho)
            {
            case HalfAxis.HAxis.AXIS_Z_N:
                _boxLength  = packProperties.Width + _forcedSpace;
                _boxWidth   = packProperties.Length + _forcedSpace;
                _boxHeight  = packProperties.Height;
                _lengthAxis = HalfAxis.HAxis.AXIS_Y_P;
                _widthAxis  = HalfAxis.HAxis.AXIS_X_P;
                _vecTransf  = new Vector3D(0.0, 0.0, packProperties.Height);
                break;

            case HalfAxis.HAxis.AXIS_Z_P:
                _boxLength  = packProperties.Length + _forcedSpace;
                _boxWidth   = packProperties.Width + _forcedSpace;
                _boxHeight  = packProperties.Height;
                _lengthAxis = HalfAxis.HAxis.AXIS_X_P;
                _widthAxis  = HalfAxis.HAxis.AXIS_Y_P;
                _vecTransf  = Vector3D.Zero;
                break;

            default:
                break;
            }
        }
示例#3
0
        public void AddPosition(Vector2D vPosition, HalfAxis.HAxis lengthAxis, HalfAxis.HAxis widthAxis)
        {
            // build 4D matrix
            Vector3D vAxisLength = HalfAxis.ToVector3D(lengthAxis);
            Vector3D vAxisWidth  = HalfAxis.ToVector3D(widthAxis);
            Vector3D vAxisHeight = Vector3D.CrossProduct(vAxisLength, vAxisWidth);
            Matrix4D mat         = Matrix4D.Identity;

            mat.M11 = vAxisLength.X;
            mat.M12 = vAxisLength.Y;
            mat.M13 = vAxisLength.Z;
            mat.M21 = vAxisWidth.X;
            mat.M22 = vAxisWidth.Y;
            mat.M23 = vAxisWidth.Z;
            mat.M31 = vAxisHeight.X;
            mat.M32 = vAxisHeight.Y;
            mat.M33 = vAxisHeight.Z;
            Transform3D localTransf       = new Transform3D(mat);
            Transform3D localTransfInv    = localTransf.Inverse();
            Transform3D originTranslation = Transform3D.Translation(localTransfInv.transform(_vecTransf));

            Vector3D      vPos     = originTranslation.transform(new Vector3D(vPosition.X, vPosition.Y, 0.0));
            LayerPosition layerPos = new LayerPosition(
                originTranslation.transform(new Vector3D(vPosition.X, vPosition.Y, 0.0))
                , HalfAxis.ToHalfAxis(localTransfInv.transform(HalfAxis.ToVector3D(_lengthAxis)))
                , HalfAxis.ToHalfAxis(localTransfInv.transform(HalfAxis.ToVector3D(_widthAxis)))
                );

            // add position
            this.Add(layerPos);
        }
 private void LogPosition(Vector2D vPos, HalfAxis.HAxis axisLength, HalfAxis.HAxis axisWidth)
 {
     if (_logPosition)
     {
         _log.Info($"({vPos.X}, {vPos.Y}), {axisLength.ToString()}, {axisWidth.ToString()}");
     }
 }
示例#5
0
        protected void OnArrowMaxClicked(object sender, ImageClickEventArgs e)
        {
            HalfAxis.HAxis axis = HalfAxis.HAxis.AXIS_X_N;
            if (sender == ButtonUpMost)
            {
                axis = HalfAxis.HAxis.AXIS_Y_P;
            }
            else if (sender == ButtonDownMost)
            {
                axis = HalfAxis.HAxis.AXIS_Y_N;
            }
            else if (sender == ButtonLeftMost)
            {
                axis = HalfAxis.HAxis.AXIS_X_N;
            }
            else if (sender == ButtonRightMost)
            {
                axis = HalfAxis.HAxis.AXIS_X_P;
            }

            var layerEditHelper = new LayerEditorHelpers(ImageSize, DimCase, DimContainer)
            {
                Positions     = BoxPositions,
                SelectedIndex = SelectedIndex
            };

            layerEditHelper.MoveMax(axis);
            BoxPositions = layerEditHelper.Positions;

            UpdateImage();
        }
 private void StartMove(HalfAxis.HAxis moveDir)
 {
     CountMove = 0;
     MoveDir   = moveDir;
     timerMove.Start();
     Moving = true;
 }
示例#7
0
        public void AddPosition(Vector2D vPosition, HalfAxis.HAxis lengthAxis, HalfAxis.HAxis widthAxis)
        {
            // build 4D matrix
            Vector3D vAxisLength = HalfAxis.ToVector3D(lengthAxis);
            Vector3D vAxisWidth  = HalfAxis.ToVector3D(widthAxis);
            Vector3D vAxisHeight = Vector3D.CrossProduct(vAxisLength, vAxisWidth);
            Matrix4D mat         = Matrix4D.Identity;

            mat.M11 = vAxisLength.X;
            mat.M12 = vAxisLength.Y;
            mat.M13 = vAxisLength.Z;
            mat.M21 = vAxisWidth.X;
            mat.M22 = vAxisWidth.Y;
            mat.M23 = vAxisWidth.Z;
            mat.M31 = vAxisHeight.X;
            mat.M32 = vAxisHeight.Y;
            mat.M33 = vAxisHeight.Z;
            mat.M41 = 0.0;
            mat.M42 = 0.0;
            mat.M43 = 0.0;
            mat.M44 = 1.0;
            Transform3D localTransf       = new Transform3D(mat);
            Transform3D localTransfInv    = localTransf.Inverse();
            Transform3D originTranslation = Transform3D.Translation(localTransfInv.transform(VecTransf) - new Vector3D(0.5 * ForcedSpace, 0.5 * ForcedSpace, 0.0));

            var layerPos = new BoxPosition(
                originTranslation.transform(new Vector3D(vPosition.X, vPosition.Y, 0.0) + 0.5 * ForcedSpace * vAxisLength + 0.5 * ForcedSpace * vAxisWidth)
                , HalfAxis.ToHalfAxis(localTransfInv.transform(HalfAxis.ToVector3D(LengthAxis)))
                , HalfAxis.ToHalfAxis(localTransfInv.transform(HalfAxis.ToVector3D(WidthAxis)))
                );

            layerPos.Position += new Vector3D(0.5 * ForcedSpace, 0.5 * ForcedSpace, 0.0);
            // add position
            Add(layerPos.Adjusted(DimBox));
        }
示例#8
0
        public BoxPosition ToBoxPosition(BBox3D bbox)
        {
            Vector3D vOrig = Vector3D.Zero;

            HalfAxis.HAxis axis = HalfAxis.HAxis.AXIS_Y_P;

            switch (Side)
            {
            case HalfAxis.HAxis.AXIS_X_N:
                vOrig = new Vector3D(bbox.PtMin.X, bbox.PtMax.Y, bbox.PtMin.Z);
                axis  = HalfAxis.HAxis.AXIS_Y_N;
                break;

            case HalfAxis.HAxis.AXIS_Y_N:
                vOrig = new Vector3D(bbox.PtMin.X, bbox.PtMin.Y, bbox.PtMin.Z);
                axis  = HalfAxis.HAxis.AXIS_X_P;
                break;

            case HalfAxis.HAxis.AXIS_X_P:
                vOrig = new Vector3D(bbox.PtMax.X, bbox.PtMin.Y, bbox.PtMin.Z);
                axis  = HalfAxis.HAxis.AXIS_Y_P;
                break;

            case HalfAxis.HAxis.AXIS_Y_P:
                vOrig = new Vector3D(bbox.PtMax.X, bbox.PtMax.Y, bbox.PtMin.Z);
                axis  = HalfAxis.HAxis.AXIS_X_N;
                break;

            default: break;
            }
            return(new BoxPosition(vOrig + Position.X * HalfAxis.ToVector3D(axis) + Position.Y * Vector3D.ZAxis, axis, HalfAxis.HAxis.AXIS_Z_P));
        }
示例#9
0
 /// <summary>
 /// Layer case analysis constructor
 /// </summary>
 public Layer(BProperties bProperties, BoxProperties caseProperties, HalfAxis.HAxis axisOrtho)
 {
     _axisOrtho    = axisOrtho;
     _palletLength = caseProperties.InsideLength;
     _palletWidth  = caseProperties.InsideWidth;
     Initialize(bProperties);
 }
示例#10
0
 public Layer2D(Vector3D dimBox, Vector2D dimContainer, HalfAxis.HAxis axisOrtho, bool swapped)
 {
     _axisOrtho    = axisOrtho;
     _dimBox       = dimBox;
     _dimContainer = dimContainer;
     _swapped      = swapped;
 }
示例#11
0
        public void AddPosition(Layer2D layer, Vector2D vPosition, HalfAxis.HAxis lengthAxis, HalfAxis.HAxis widthAxis)
        {
            Matrix4D matRot       = Matrix4D.Identity;
            Vector3D vTranslation = Vector3D.Zero;

            if (layer.Swapped)
            {
                matRot = new Matrix4D(
                    0.0, -1.0, 0.0, 0.0
                    , 1.0, 0.0, 0.0, 0.0
                    , 0.0, 0.0, 1.0, 0.0
                    , 0.0, 0.0, 0.0, 1.0
                    );
                vTranslation = new Vector3D(layer.PalletLength, 0.0, 0.0);
            }
            Transform3D transfRot = new Transform3D(matRot);

            HalfAxis.HAxis lengthAxisSwapped = StackBuilder.Basics.HalfAxis.ToHalfAxis(transfRot.transform(StackBuilder.Basics.HalfAxis.ToVector3D(lengthAxis)));
            HalfAxis.HAxis widthAxisSwapped  = StackBuilder.Basics.HalfAxis.ToHalfAxis(transfRot.transform(StackBuilder.Basics.HalfAxis.ToVector3D(widthAxis)));

            matRot.M14 = vTranslation[0];
            matRot.M24 = vTranslation[1];
            matRot.M34 = vTranslation[2];

            Transform3D transfRotTranslation = new Transform3D(matRot);
            Vector3D    vPositionSwapped     = transfRotTranslation.transform(new Vector3D(vPosition.X, vPosition.Y, 0.0));

            if (!layer.IsValidPosition(new Vector2D(vPositionSwapped.X, vPositionSwapped.Y), lengthAxisSwapped, widthAxisSwapped))
            {
                _log.Warn(string.Format("Attempt to add an invalid position in pattern = {0}, Swapped = {1}", this.Name, layer.Swapped));
                return;
            }
            layer.AddPosition(new Vector2D(vPositionSwapped.X, vPositionSwapped.Y), lengthAxisSwapped, widthAxisSwapped);
        }
示例#12
0
        public void Move(HalfAxis.HAxis moveDir, double stepMove)
        {
            // sanity check
            if (!IsSelectionValid)
            {
                return;
            }
            // update position
            BoxPosition bpos    = Positions[SelectedIndex];
            BoxPosition bposNew = bpos.Translate(moveDir, stepMove);

            if (!BoxInteraction.HaveIntersection(Positions, DimCase, SelectedIndex, bposNew) &&
                BoxInteraction.BoxCanMoveInside(Positions[SelectedIndex], DimCase, PtMin, PtMax, moveDir))
            {
                Positions[SelectedIndex] = bposNew;
            }
            else
            {
                double distance = 0;
                if (BoxInteraction.MinDistance(Positions, DimCase, SelectedIndex, moveDir, ref distance))
                {
                    bposNew = bpos.Translate(moveDir, distance);
                    Positions[SelectedIndex] = bposNew;
                }
            }
        }
示例#13
0
        private void Initialize(CasePalletSolution sol)
        {
            switch (_axisOrtho)
            {
            case HalfAxis.HAxis.AXIS_Z_N:
                _boxLength  = sol.PalletWidth;
                _boxWidth   = sol.PalletLength;
                _boxHeight  = sol.PalletHeight;
                _lengthAxis = HalfAxis.HAxis.AXIS_Y_P;
                _widthAxis  = HalfAxis.HAxis.AXIS_X_N;
                _vecTransf  = new Vector3D(_boxLength, 0.0, 0.0);
                break;

            case HalfAxis.HAxis.AXIS_Z_P:
                _boxLength  = sol.PalletLength;
                _boxWidth   = sol.PalletWidth;
                _boxHeight  = sol.PalletHeight;
                _lengthAxis = HalfAxis.HAxis.AXIS_X_P;
                _widthAxis  = HalfAxis.HAxis.AXIS_Y_P;
                _vecTransf  = new Vector3D(0.0, 0.0, 0.0);
                break;

            default:
                break;
            }
        }
示例#14
0
        public BoxPosition Translate(HalfAxis.HAxis axis, double value)
        {
            Vector3D v = Position;

            v += value * HalfAxis.ToVector3D(axis);
            return(new BoxPosition(v, DirectionLength, DirectionWidth));
        }
示例#15
0
 Layer2D BuildLayer(CasePalletSolution palletSolution, TruckProperties truckProperties, TruckConstraintSet constraintSet
                    , HalfAxis.HAxis axisOrtho, bool swapped)
 {
     return(new Layer2D(new Vector3D(palletSolution.PalletLength, palletSolution.PalletWidth, palletSolution.PalletHeight)
                        , new Vector2D(truckProperties.Length, truckProperties.Width)
                        , axisOrtho, swapped));
 }
示例#16
0
 private void OnBnRemove(object sender, EventArgs e)
 {
     try
     {
         HalfAxis.HAxis currentAxis    = SelectedFace;
         Texture        currentTexture = SelectedTexture;
         _textures.RemoveAll(delegate(Pair <HalfAxis.HAxis, Texture> p) { return(p.first == currentAxis && p.second == currentTexture); });
         // update bitmap control
         FillBitmapControl(SelectedFace);
         // select first texture available in list
         if (listBoxTextures.Items.Count > 0)
         {
             ListBoxImagesItem item = listBoxTextures.Items[0] as ListBoxImagesItem;
             SelectedTexture = item.Texture;
         }
         else
         {
             OnSelectedTextureChanged(this, null);
         }
         // draw box
         graphCtrl.Invalidate();
     }
     catch (Exception ex)
     {
         _log.Error(ex.ToString());
     }
 }
示例#17
0
 Layer2D BuildLayer(BoxProperties boxP, BoxProperties caseP, HalfAxis.HAxis orthoAxis, bool swapped)
 {
     return(new Layer2D(new Vector3D(boxP.Length, boxP.Width, boxP.Height)
                        , new Vector2D(caseP.InsideLength, caseP.InsideWidth)
                        , orthoAxis
                        , swapped));
 }
        private BoxPosition GetPosition(int i, int j, int k, int dim0, int dim1)
        {
            double boxLength = _caseDefinition.BoxLength(_boxProperties);
            double boxWidth  = _caseDefinition.BoxWidth(_boxProperties);
            double boxHeight = _caseDefinition.BoxHeight(_boxProperties);

            HalfAxis.HAxis dirLength = HalfAxis.HAxis.AXIS_X_P;
            HalfAxis.HAxis dirWidth  = HalfAxis.HAxis.AXIS_Y_P;

            Vector3D vPosition = Vector3D.Zero;

            if (0 == dim0 && 1 == dim1)
            {
                dirLength = HalfAxis.HAxis.AXIS_X_P;
                dirWidth  = HalfAxis.HAxis.AXIS_Y_P;
                vPosition = Vector3D.Zero;
            }
            else if (0 == dim0 && 2 == dim1)
            {
                dirLength = HalfAxis.HAxis.AXIS_X_P;
                dirWidth  = HalfAxis.HAxis.AXIS_Z_N;
                vPosition = new Vector3D(0.0, 0.0, _boxProperties.Width);
            }
            else if (1 == dim0 && 0 == dim1)
            {
                dirLength = HalfAxis.HAxis.AXIS_Y_P;
                dirWidth  = HalfAxis.HAxis.AXIS_X_N;
                vPosition = new Vector3D(_boxProperties.Width, 0.0, 0.0);
            }
            else if (1 == dim0 && 2 == dim1)
            {
                dirLength = HalfAxis.HAxis.AXIS_Z_N;
                dirWidth  = HalfAxis.HAxis.AXIS_X_P;
                vPosition = new Vector3D(0.0, _boxProperties.Height, _boxProperties.Length);
            }
            else if (2 == dim0 && 0 == dim1)
            {
                dirLength = HalfAxis.HAxis.AXIS_Y_P;
                dirWidth  = HalfAxis.HAxis.AXIS_Z_N;
                vPosition = new Vector3D(_boxProperties.Height, 0.0, _boxProperties.Width);
            }
            else if (2 == dim0 && 1 == dim1)
            {
                dirLength = HalfAxis.HAxis.AXIS_Z_P;
                dirWidth  = HalfAxis.HAxis.AXIS_Y_P;
                vPosition = new Vector3D(_boxProperties.Height, 0.0, 0.0);
            }
            // add wall thickness
            vPosition += new Vector3D(
                _caseOptimConstraintSet.NoWalls[0] * _caseOptimConstraintSet.WallThickness * 0.5
                , _caseOptimConstraintSet.NoWalls[1] * _caseOptimConstraintSet.WallThickness * 0.5
                , _caseOptimConstraintSet.NoWalls[2] * _caseOptimConstraintSet.WallThickness * 0.5);

            // apply global transformation using _dir0 / _dir1
            return(BoxPosition.Transform(
                       new BoxPosition(vPosition + new Vector3D(i * boxLength, j * boxWidth, k * boxHeight), dirLength, dirWidth)
                       , GlobalTransformation
                       ));
        }
示例#19
0
 public Layer2D(Vector3D dimBox, Vector2D dimContainer, string patternName, HalfAxis.HAxis axisOrtho, bool swapped)
 {
     _patternName  = patternName;
     _axisOrtho    = axisOrtho;
     _dimBox       = dimBox;
     _dimContainer = dimContainer;
     _swapped      = swapped;
 }
示例#20
0
 protected Layer2DBrickIndexed(Vector3D dimBox, Vector2D dimContainer, string name, HalfAxis.HAxis axisOrtho)
 {
     Name         = name;
     PatternName  = name;
     DimBox       = dimBox;
     DimContainer = dimContainer;
     AxisOrtho    = axisOrtho;
 }
示例#21
0
        public static void Draw(PackableBrick packable, HalfAxis.HAxis axis, PictureBox pictureBox)
        {
            try
            {
                // get horizontal angle
                double angle          = 45;
                double cameraDistance = 100000;
                // instantiate graphics
                Graphics3DImage graphics = new Graphics3DImage(pictureBox.Size)
                {
                    CameraPosition = new Vector3D(
                        Math.Cos(angle * Math.PI / 180.0) * Math.Sqrt(2.0) * cameraDistance
                        , Math.Sin(angle * Math.PI / 180.0) * Math.Sqrt(2.0) * cameraDistance
                        , cameraDistance),
                    Target = Vector3D.Zero
                };
                graphics.SetViewport(-500.0f, -500.0f, 500.0f, 500.0f);
                // draw
                Box box = null;
                if (packable is PackProperties)
                {
                    box = new Pack(0, packable as PackProperties);
                }
                else
                {
                    box = new Box(0, packable);
                }
                // set axes
                HalfAxis.HAxis lengthAxis = HalfAxis.HAxis.AXIS_X_P;
                HalfAxis.HAxis widthAxis  = HalfAxis.HAxis.AXIS_Y_P;
                switch (axis)
                {
                case HalfAxis.HAxis.AXIS_X_P: lengthAxis = HalfAxis.HAxis.AXIS_Z_P; widthAxis = HalfAxis.HAxis.AXIS_X_P; break;

                case HalfAxis.HAxis.AXIS_Y_P: lengthAxis = HalfAxis.HAxis.AXIS_X_P; widthAxis = HalfAxis.HAxis.AXIS_Z_N; break;

                case HalfAxis.HAxis.AXIS_Z_P: lengthAxis = HalfAxis.HAxis.AXIS_X_P; widthAxis = HalfAxis.HAxis.AXIS_Y_P; break;

                default: break;
                }
                box.HLengthAxis = lengthAxis;
                box.HWidthAxis  = widthAxis;
                // draw box
                graphics.AddBox(box);
                graphics.Flush();
                // set to picture box
                pictureBox.Image = graphics.Bitmap;
            }
            catch (Exception ex)
            {
                Bitmap bmp = new Bitmap(pictureBox.Size.Width, pictureBox.Size.Height);
                System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bmp);
                g.DrawString("Invalid content", new Font("Arial", 8), new SolidBrush(Color.Red), new PointF(5, 10));
                pictureBox.Image = bmp;

                _log.Error(ex.ToString());
            }
        }
示例#22
0
 public BoxPosition(Vector3D vPosition, HalfAxis.HAxis dirLength = HalfAxis.HAxis.AXIS_X_P, HalfAxis.HAxis dirWidth = HalfAxis.HAxis.AXIS_Y_P)
 {
     if (dirLength == dirWidth)
     {
         throw new Exception("Can not create BoxPosition");
     }
     Position        = vPosition;
     DirectionLength = dirLength;
     DirectionWidth  = dirWidth;
 }
示例#23
0
 public Layer2D BuildLayer(BProperties bProperties, BoxProperties caseProperties
                           , HalfAxis.HAxis axisOrtho, bool swapped)
 {
     return(new Layer2D(
                new Vector3D(bProperties.Length, bProperties.Width, bProperties.Height)
                , new Vector2D(caseProperties.InsideLength, caseProperties.InsideWidth)
                , axisOrtho
                , swapped
                ));
 }
示例#24
0
        public Layer(PackProperties packProperties, PalletProperties palletProperties, PackPalletConstraintSet constraintSet
                     , HalfAxis.HAxis axisOrtho, bool inversed)
        {
            _axisOrtho    = axisOrtho;
            _inversed     = inversed;
            _forcedSpace  = constraintSet.MinimumSpace.Value;
            _palletLength = palletProperties.Length + constraintSet.OverhangX + _forcedSpace;
            _palletWidth  = palletProperties.Width + constraintSet.OverhangY + _forcedSpace;

            Initialize(packProperties);
        }
示例#25
0
        protected Layer2D BuildLayer(BProperties boxProperties, PalletProperties palletProperties, PalletCornerProperties cornerProperties
                                     , PalletConstraintSet constraintSet, HalfAxis.HAxis axisOrtho, bool swapped, bool inversed)
        {
            double cornerThickness = null != cornerProperties ? cornerProperties.Thickness : 0.0;

            return(new Layer2D(
                       boxProperties.OuterDimensions
                       , new Vector2D(palletProperties.Length + constraintSet.OverhangX - 2.0 * cornerThickness, palletProperties.Width + constraintSet.OverhangY - 2.0 * cornerThickness)
                       , axisOrtho
                       , swapped));
        }
示例#26
0
        /// <summary>
        /// Layer pallet analysis constructor (inversed = false)
        /// </summary>
        public Layer(BProperties boxProperties, PalletProperties palletProperties, PalletCornerProperties cornerProperties,
                     PalletConstraintSet constraintSet, HalfAxis.HAxis axisOrtho, bool inversed)
        {
            double cornerThickness = null != cornerProperties ? cornerProperties.Thickness : 0.0;

            _axisOrtho    = axisOrtho;
            _inversed     = inversed;
            _palletLength = palletProperties.Length + constraintSet.OverhangX - 2.0 * cornerThickness;
            _palletWidth  = palletProperties.Width + constraintSet.OverhangY - 2.0 * cornerThickness;
            Initialize(boxProperties);
        }
示例#27
0
        private Layer2D BuildLayer(PackProperties packProperties, PalletProperties palletProperties, PackPalletConstraintSet constraintSet
                                   , string patternName, HalfAxis.HAxis axisOrtho, bool swapped, bool inversed)
        {
            double forcedSpace = constraintSet.MinimumSpace.Value;

            return(new Layer2D(
                       new Vector3D(packProperties.Length + forcedSpace, packProperties.Width + forcedSpace, packProperties.Height)
                       , new Vector2D(
                           palletProperties.Length + constraintSet.OverhangX + forcedSpace
                           , _palletProperties.Width + constraintSet.OverhangY + forcedSpace)
                       , patternName, axisOrtho, swapped));
        }
示例#28
0
 public FilmRectangle(
     Vector3D origin,
     HalfAxis.HAxis axis1, HalfAxis.HAxis axis2,
     Vector2D dimensions,
     double dBorder)
 {
     Origin     = origin;
     Axis1      = axis1;
     Axis2      = axis2;
     Dimensions = dimensions;
     TopBorder  = dBorder;
 }
        public override bool AllowOrientation(HalfAxis.HAxis axisOrtho)
        {
            switch (axisOrtho)
            {
            case HalfAxis.HAxis.AXIS_Z_N:
            case HalfAxis.HAxis.AXIS_Z_P:
                return(true);

            default:
                return(false);
            }
        }
示例#30
0
 public FilmRectangle(
     Vector3D origin,
     HalfAxis.HAxis axis1, HalfAxis.HAxis axis2,
     Vector2D dimensions,
     double dBorder)
 {
     _origin     = origin;
     _axis1      = axis1;
     _axis2      = axis2;
     _dimensions = dimensions;
     _dBorder    = dBorder;
 }
示例#31
0
 public FilmRectangle(
     Vector3D origin,
     HalfAxis.HAxis axis1, HalfAxis.HAxis axis2,
     Vector2D dimensions,
     double dBorder)
 {
     _origin = origin;
     _axis1 = axis1;
     _axis2 = axis2;
     _dimensions = dimensions;
     _dBorder = dBorder;
 }
        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="doc">Reference of parent <see cref="Document"/></param>
        /// <param name="box">Reference </param>
        public PackProperties(Document doc
            , BoxProperties box
            , PackArrangement arrangement
            , HalfAxis.HAxis orientation
            , PackWrapper wrapper)
            : base(doc)
        {
            _boxProperties = box;
            _boxProperties.AddDependancy(this);

            _arrangement = arrangement;
            _orientation = orientation;
            _wrapper = wrapper;
        }
示例#33
0
 public BoxPosition(Vector3D vPosition, HalfAxis.HAxis dirLength, HalfAxis.HAxis dirWidth)
 {
     _vPosition = vPosition;
     _axisLength = dirLength;
     _axisWidth = dirWidth;
 }
示例#34
0
 public void SetPosition(Vector3D position, HalfAxis.HAxis lengthAxis, HalfAxis.HAxis widthAxis)
 {
     _position = position;
     _lengthAxis = lengthAxis;
     _widthAxis = widthAxis;
 }
示例#35
0
 public Orientation(HalfAxis.HAxis dir0, HalfAxis.HAxis dir1)
 {
     _dir0 = dir0; _dir1 = dir1;
 }
示例#36
0
 public CylPosition(Vector3D vPosition, HalfAxis.HAxis axis)
 {
     _vPosition = vPosition;
     _axis = axis;        
 }
示例#37
0
 public Position(int index, Vector3D xyz, HalfAxis.HAxis axis1, HalfAxis.HAxis axis2)
 {
     _index = index; _xyz = xyz; _axis1 = axis1; _axis2 = axis2;
 }