public override BBox3D BBoxLoadWDeco(BBox3D loadBBox) { BBox3D bbox = new BBox3D(loadBBox); // --- extend for pallet corners: begin if (HasPalletCorners) { double thickness = PalletCornerProperties.Thickness; Vector3D ptMin = bbox.PtMin; ptMin.X -= thickness; ptMin.Y -= thickness; Vector3D ptMax = bbox.PtMax; ptMax.X += thickness; ptMax.Y += thickness; bbox.Extend(ptMin); bbox.Extend(ptMax); } // --- extend for pallet corners: end // --- extend for pallet cap : begin if (HasPalletCap) { double zMax = bbox.PtMax.Z; Vector3D v0 = new Vector3D( 0.5 * (PalletProperties.Length - PalletCapProperties.Length), 0.5 * (PalletProperties.Width - PalletCapProperties.Width), zMax + PalletCapProperties.Height - PalletCapProperties.InsideHeight); bbox.Extend(v0); Vector3D v1 = new Vector3D( 0.5 * (PalletProperties.Length + PalletCapProperties.Length), 0.5 * (PalletProperties.Width + PalletCapProperties.Width), zMax + PalletCapProperties.Height - PalletCapProperties.InsideHeight); bbox.Extend(v1); } // --- extend for pallet cap : end return bbox; }
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); }
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)); }
public BBox3D BoundingBox(Packable packable) { BBox3D bbox = new BBox3D(); if (packable is PackableBrick 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); }
/// <summary> /// Compute layer bouding box /// </summary> /// <param name="bProperties">Case properties</param> /// <returns>bounding box</returns> public BBox3D BoundingBox(Packable packable) { BBox3D bbox = new BBox3D(); if (packable is CylinderProperties cylProperties) { 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); }
public void Extend(BBox3D box) { _ptMin.X = Math.Min(_ptMin.X, box._ptMin.X); _ptMin.Y = Math.Min(_ptMin.Y, box._ptMin.Y); _ptMin.Z = Math.Min(_ptMin.Z, box._ptMin.Z); _ptMax.X = Math.Max(_ptMax.X, box._ptMax.X); _ptMax.Y = Math.Max(_ptMax.Y, box._ptMax.Y); _ptMax.Z = Math.Max(_ptMax.Z, box._ptMax.Z); }
public override BBox3D BBoxGlobal(BBox3D loadBBox) { BBox3D bbox = BBoxLoadWDeco(loadBBox); // --- extend for pallet : begin bbox.Extend(PalletProperties.BoundingBox); // --- extend for pallet : end return(bbox); }
/// <summary> /// Returns a value indicating whether this instance is equal to /// the specified object. /// </summary> /// <param name="obj">An object to compare to this instance.</param> /// <returns><see langword="true"/> if <paramref name="obj"/> is a <see cref="Box2D"/> and has the same values as this instance; otherwise, <see langword="false"/>.</returns> public override bool Equals(object obj) { if (obj is BBox3D) { BBox3D v = (BBox3D)obj; return((PtMin.Equals(v.PtMin)) && (PtMax.Equals(v.PtMax))); } return(false); }
public BBox3D BBox(Vector3D dimensions) { BBox3D bbox = new BBox3D(); foreach (Vector3D pt in Points(dimensions)) { bbox.Extend(pt); } return(bbox); }
private BBox3D ComputeLoadBBox3D() { BBox3D bbox = new BBox3D(); bool hasInterlayer = false; double zInterlayer = 0.0; Layer3DBox layer0 = GetBoxLayer(0, ref hasInterlayer, ref zInterlayer); bbox.Extend(layer0.BoundingBox(Analysis.PackProperties)); Layer3DBox layerN = GetBoxLayer(LayerCount - 1, ref hasInterlayer, ref zInterlayer); bbox.Extend(layerN.BoundingBox(Analysis.PackProperties)); return(bbox); }
public BBox3D BoundingBox(Packable packable) { BBox3D bbox = new BBox3D(); if (packable is PackableBrick packableBrick) { Vector3D dimensions = packableBrick.OuterDimensions; foreach (var bpos in this) { bbox.Extend(bpos.BPos.BBox(dimensions)); } } return(bbox); }
/// <summary> /// /// </summary> 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(_boxCaseAnalysis.BProperties)); } ++iLayer; } return(bbox); }
private BBox3D ComputeLoadBBox3D() { BBox3D bbox = new BBox3D(); int iLayer = 0; while (iLayer < Count) { ILayer layer = this[iLayer]; Layer3DCyl blayer = layer as Layer3DCyl; if (null != blayer) { bbox.Extend(blayer.BoundingBox(Analysis.CylinderProperties)); } ++iLayer; } return(bbox); }
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); }
public Vector2D GetDimensions(ILayerSolver solver, Packable packable, Vector2D containerDim, double minimumSpace) { Vector2D dimensions = Vector2D.Zero; if (null != LayerDesc) { solver.GetDimensions(new List <LayerDesc>() { LayerDesc }, packable, containerDim, minimumSpace, ref dimensions); } if (null != Layer2D) { BBox3D bb = Layer2D.BBox; dimensions.X = bb.Length; dimensions.Y = bb.Width; } return(dimensions); }
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 BoundingBox(Packable packable) { BBox3D bbox = new BBox3D(); Vector3D dimensions = packable.OuterDimensions; Vector3D[] pts = new Vector3D[8]; pts[0] = new Vector3D(0.0, 0.0, _zLower); pts[1] = pts[0] + dimensions.X * Vector3D.XAxis; pts[2] = pts[0] + dimensions.Y * Vector3D.YAxis; pts[3] = pts[0] + dimensions.X * Vector3D.XAxis + dimensions.Y * Vector3D.YAxis; pts[4] = pts[0] + dimensions.Z * Vector3D.ZAxis; pts[5] = pts[1] + dimensions.Z * Vector3D.ZAxis; pts[6] = pts[2] + dimensions.Z * Vector3D.ZAxis; pts[7] = pts[3] + dimensions.Z * Vector3D.ZAxis; foreach (Vector3D pt in pts) { bbox.Extend(pt); } return(bbox); }
public BBox3D BBox(Vector3D dimensions) { BBox3D bbox = new BBox3D(); Vector3D vI = HalfAxis.ToVector3D(DirectionLength); Vector3D vJ = HalfAxis.ToVector3D(DirectionWidth); Vector3D vK = Vector3D.CrossProduct(vI, vJ); Vector3D[] pts = new Vector3D[8]; pts[0] = Position; pts[1] = Position + dimensions.X * vI; pts[2] = Position + dimensions.Y * vJ; pts[3] = Position + dimensions.X * vI + dimensions.Y * vJ; pts[4] = Position + dimensions.Z * vK; pts[5] = Position + dimensions.Y * vJ + dimensions.Z * vK; pts[6] = Position + HalfAxis.ToVector3D(DirectionWidth) * dimensions.Y; pts[7] = Position + HalfAxis.ToVector3D(DirectionLength) * dimensions.X + HalfAxis.ToVector3D(DirectionWidth) * dimensions.Y; foreach (Vector3D pt in pts) { bbox.Extend(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); }
public override BBox3D BBoxLoadWDeco(BBox3D loadBBox) { BBox3D bbox = new BBox3D(loadBBox); // --- extend for pallet corners: begin if (HasPalletCorners) { double thickness = PalletCornerProperties.Thickness; Vector3D ptMin = bbox.PtMin; ptMin.X -= thickness; ptMin.Y -= thickness; Vector3D ptMax = bbox.PtMax; ptMax.X += thickness; ptMax.Y += thickness; bbox.Extend(ptMin); bbox.Extend(ptMax); } // --- extend for pallet corners: end // --- extend for pallet cap : begin if (HasPalletCap) { double zMax = bbox.PtMax.Z; Vector3D v0 = new Vector3D( 0.5 * (PalletProperties.Length - PalletCapProperties.Length), 0.5 * (PalletProperties.Width - PalletCapProperties.Width), zMax + PalletCapProperties.Height - PalletCapProperties.InsideHeight); bbox.Extend(v0); Vector3D v1 = new Vector3D( 0.5 * (PalletProperties.Length + PalletCapProperties.Length), 0.5 * (PalletProperties.Width + PalletCapProperties.Width), zMax + PalletCapProperties.Height - PalletCapProperties.InsideHeight); bbox.Extend(v1); } // --- extend for pallet cap : end return(bbox); }
protected void AddPickingBox(BBox3D bbox, uint id) { _listPickingBox.Add( new Tuple<BBox3D, uint>(bbox, id) ); }
public override BBox3D BBoxGlobal(BBox3D loadBBox) { return(new BBox3D( 0.0, 0.0, 0.0, _caseProperties.InsideLength, _caseProperties.InsideWidth, _caseProperties.InsideHeight)); }
public BBox3D(BBox3D box) { _ptMin = new Vector3D(box._ptMin); _ptMax = new Vector3D(box._ptMax); }
public abstract BBox3D BBoxGlobal(BBox3D loadBBox);
public abstract BBox3D BBoxLoadWDeco(BBox3D loadBBox);
public override void Draw(Graphics3D graphics, bool showDimensions) { if (null == _solution) return; AnalysisCasePallet analysisCasePallet = _solution.Analysis as AnalysisCasePallet; // ### draw pallet Pallet pallet = new Pallet(analysisCasePallet.PalletProperties); pallet.Draw(graphics, Transform3D.Identity); // ### draw solution uint layerId = 0, pickId = 0; List<ILayer> layers = _solution.Layers; foreach (ILayer layer in layers) { // ### layer of boxes BoxLayer blayer = layer as BoxLayer; if (null != blayer) { BBox3D bbox = new BBox3D(); foreach (BoxPosition bPosition in blayer) { Box b = new Box(pickId++, analysisCasePallet.BProperties, bPosition); graphics.AddBox(b); bbox.Extend(b.BBox); } // add layer BBox AddPickingBox(bbox, layerId); // draw bounding box around selected layer if (layerId == _solution.SelectedLayerIndex) DrawLayerBoundingBox(graphics, bbox); ++layerId; } // ### intetrlayer InterlayerPos interlayerPos = layer as InterlayerPos; if (null != interlayerPos) { InterlayerProperties interlayerProp = _solution.Interlayers[interlayerPos.TypeId];//analysisCasePallet.Interlayer(interlayerPos.TypeId); if (null != interlayerProp) { Box box = new Box(pickId++, interlayerProp); box.Position = new Vector3D( 0.5 * (analysisCasePallet.PalletProperties.Length - interlayerProp.Length) , 0.5 * (analysisCasePallet.PalletProperties.Width - interlayerProp.Width) , interlayerPos.ZLow ); graphics.AddBox(box); } } } BBox3D loadBBox = _solution.BBoxLoad; BBox3D loadBBoxWDeco = _solution.BBoxLoadWDeco; #region Pallet corners // ### pallet corners : Begin Corner[] corners = new Corner[4]; if (analysisCasePallet.HasPalletCorners) { // positions Vector3D[] cornerPositions = { loadBBox.PtMin , new Vector3D(loadBBox.PtMax.X, loadBBox.PtMin.Y, loadBBox.PtMin.Z) , new Vector3D(loadBBox.PtMax.X, loadBBox.PtMax.Y, loadBBox.PtMin.Z) , new Vector3D(loadBBox.PtMin.X, loadBBox.PtMax.Y, loadBBox.PtMin.Z) }; // length axes HalfAxis.HAxis[] lAxes = { HalfAxis.HAxis.AXIS_X_P, HalfAxis.HAxis.AXIS_Y_P, HalfAxis.HAxis.AXIS_X_N, HalfAxis.HAxis.AXIS_Y_N }; // width axes HalfAxis.HAxis[] wAxes = { HalfAxis.HAxis.AXIS_Y_P, HalfAxis.HAxis.AXIS_X_N, HalfAxis.HAxis.AXIS_Y_N, HalfAxis.HAxis.AXIS_X_P }; // corners if (analysisCasePallet.HasPalletCorners) { for (int i = 0; i < 4; ++i) { corners[i] = new Corner(0, analysisCasePallet.PalletCornerProperties); corners[i].Height = Math.Min(analysisCasePallet.PalletCornerProperties.Length, loadBBox.Height); corners[i].SetPosition(cornerPositions[i], lAxes[i], wAxes[i]); corners[i].DrawBegin(graphics); } } } #endregion #region Pallet cap #endregion #region Pallet film // ### pallet film Film film = null; if (analysisCasePallet.HasPalletFilm) { PalletFilmProperties palletFilmProperties = analysisCasePallet.PalletFilmProperties; film = new Film( palletFilmProperties.Color, palletFilmProperties.UseTransparency, palletFilmProperties.UseHatching, palletFilmProperties.HatchSpacing, palletFilmProperties.HatchAngle); film.AddRectangle(new FilmRectangle(loadBBoxWDeco.PtMin, HalfAxis.HAxis.AXIS_X_P, HalfAxis.HAxis.AXIS_Z_P, new Vector2D(loadBBoxWDeco.Length, loadBBoxWDeco.Height), 0.0)); film.AddRectangle(new FilmRectangle(loadBBoxWDeco.PtMin + loadBBoxWDeco.Length * Vector3D.XAxis, HalfAxis.HAxis.AXIS_Y_P, HalfAxis.HAxis.AXIS_Z_P, new Vector2D(loadBBoxWDeco.Width, loadBBoxWDeco.Height), 0.0)); film.AddRectangle(new FilmRectangle(loadBBoxWDeco.PtMin + loadBBoxWDeco.Length * Vector3D.XAxis + loadBBoxWDeco.Width * Vector3D.YAxis, HalfAxis.HAxis.AXIS_X_N, HalfAxis.HAxis.AXIS_Z_P, new Vector2D(loadBBoxWDeco.Length, loadBBoxWDeco.Height), 0.0)); film.AddRectangle(new FilmRectangle(loadBBoxWDeco.PtMin + loadBBoxWDeco.Width * Vector3D.YAxis, HalfAxis.HAxis.AXIS_Y_N, HalfAxis.HAxis.AXIS_Z_P, new Vector2D(loadBBoxWDeco.Width, loadBBoxWDeco.Height), 0.0)); film.AddRectangle(new FilmRectangle(loadBBoxWDeco.PtMin + loadBBoxWDeco.Height * Vector3D.ZAxis, HalfAxis.HAxis.AXIS_X_P, HalfAxis.HAxis.AXIS_Y_P, new Vector2D(loadBBoxWDeco.Length, loadBBoxWDeco.Width), UnitsManager.ConvertLengthFrom(200.0, UnitsManager.UnitSystem.UNIT_METRIC1))); film.DrawBegin(graphics); } #endregion // ### dimensions if (showDimensions) { graphics.AddDimensions( new DimensionCube(BoundingBoxDim(Properties.Settings.Default.DimCasePalletSol1) , Color.Black, false)); graphics.AddDimensions( new DimensionCube(BoundingBoxDim(Properties.Settings.Default.DimCasePalletSol2) , Color.Red, true)); } #region Pallet corners // pallet corners : End if (analysisCasePallet.HasPalletCorners) { for (int i = 0; i < 4; ++i) corners[i].DrawEnd(graphics); } #endregion #region Pallet Cap // ### pallet cap if (analysisCasePallet.HasPalletCap) { PalletCapProperties capProperties = analysisCasePallet.PalletCapProperties; Vector3D pos = new Vector3D( 0.5 * (analysisCasePallet.PalletProperties.Length - capProperties.Length), 0.5 * (analysisCasePallet.PalletProperties.Width - capProperties.Width), loadBBox.PtMax.Z - capProperties.InsideHeight); PalletCap cap = new PalletCap(0, capProperties, pos); cap.DrawEnd(graphics); } #endregion #region Pallet film // pallet film : End if (analysisCasePallet.HasPalletFilm) film.DrawEnd(graphics); #endregion }
public BBox3D(BBox3D box) { Extend(box._ptMin); Extend(box._ptMax); }
private void DrawLayerBoundingBox(Graphics3D graphics, BBox3D bbox) { Vector3D ptMin = bbox.PtMin; Vector3D ptMax = bbox.PtMax; Vector3D[] vertices = { new Vector3D(ptMin.X, ptMin.Y, ptMin.Z) // 0 , new Vector3D(ptMax.X, ptMin.Y, ptMin.Z) // 1 , new Vector3D(ptMax.X, ptMax.Y, ptMin.Z) // 2 , new Vector3D(ptMin.X, ptMax.Y, ptMin.Z) // 3 , new Vector3D(ptMin.X, ptMin.Y, ptMax.Z) // 4 , new Vector3D(ptMax.X, ptMin.Y, ptMax.Z) // 5 , new Vector3D(ptMax.X, ptMax.Y, ptMax.Z) // 6 , new Vector3D(ptMin.X, ptMax.Y, ptMax.Z) // 7 }; Face[] faces = { new Face(0, vertices[0], vertices[1], vertices[5], vertices[4], false), new Face(0, vertices[1], vertices[2], vertices[6], vertices[5], false), new Face(0, vertices[2], vertices[3], vertices[7], vertices[6], false), new Face(0, vertices[3], vertices[0], vertices[4], vertices[7], false), }; foreach (Face f in faces) { if (f.IsVisible(ViewDir)) { Vector3D[] points = f.Points; graphics.AddSegment(new Segment(points[0], points[1], Color.Red)); graphics.AddSegment(new Segment(points[1], points[2], Color.Red)); graphics.AddSegment(new Segment(points[2], points[3], Color.Red)); graphics.AddSegment(new Segment(points[3], points[0], Color.Red)); } } }
public BBox3D(BBox3D box) { PtMin = new Vector3D(box.PtMin); PtMax = new Vector3D(box.PtMax); }
public override BBox3D BBoxLoadWDeco(BBox3D loadBBox) => loadBBox;
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; }
public void Extend(BBox3D box) { Extend(box.PtMin); Extend(box.PtMax); }
public override BBox3D BBoxGlobal(BBox3D loadBBox) { BBox3D bbox = BBoxLoadWDeco(loadBBox); // --- extend for pallet : begin bbox.Extend(PalletProperties.BoundingBox); // --- extend for pallet : end return bbox; }
public override BBox3D BBoxGlobal(BBox3D loadBBox) { return(new BBox3D( 0.0, 0.0, 0.0, _truckProperties.Length, _truckProperties.Width, _truckProperties.Height)); }
public override BBox3D BBoxLoadWDeco(BBox3D loadBBox) { return(loadBBox); }
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; }