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); }
/// <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] )); }
/// <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) )); }
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); }
/// <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; }
public double TotalWeight(PackableBrick packable, ParamSetPackOptim constraintSet) { return(InnerWeight(packable) + EmptyWeight(packable, constraintSet)); }
public double InnerWeight(PackableBrick packable) { return(_arrangement.Number * packable.Weight); }
public double EmptyWeight(PackableBrick packable, ParamSetPackOptim constraintSet) { return(Area(packable, constraintSet) * constraintSet.WallSurfaceMass); }
public double OuterVolume(PackableBrick packable, ParamSetPackOptim constraintSet) { Vector3D outerDim = OuterDimensions(packable, constraintSet); return(outerDim.X * outerDim.Y * outerDim.Z); }
public double InnerVolume(PackableBrick packable) { Vector3D innerDim = InnerDimensions(packable); return(innerDim.X * innerDim.Y * innerDim.Z); }
public double BoxHeight(PackableBrick packable) => packable.Dim(Dim2);
public double BoxWidth(PackableBrick packable) => packable.Dim(_dim1);
public double BoxLength(PackableBrick packable) => packable.Dim(_dim0);
public double CaseEmptyWeight(PackableBrick boxProperties, ParamSetPackOptim paramSet) { return(paramSet.WallSurfaceMass * Area(boxProperties, paramSet)); }
public StrapperSet(PackableBrick packable) { Packable = packable; }