diff --git a/MatterControlLib/PartPreviewWindow/PlatingHelper.cs b/MatterControlLib/PartPreviewWindow/PlatingHelper.cs index c9953c23e..6893e7cd3 100644 --- a/MatterControlLib/PartPreviewWindow/PlatingHelper.cs +++ b/MatterControlLib/PartPreviewWindow/PlatingHelper.cs @@ -82,13 +82,13 @@ namespace MatterHackers.MatterControl /// Arrange the given parts on the bed and return a list of the parts that were arranged /// /// The parts to arrange - /// A position to arrange around + /// A position to arrange around /// The way to consider the possition /// Optional bounds to arrange into /// The current progress of arranging /// A list of the parts that were arranged public static List ArrangeOnBed(List object3DList, - Vector3 arangePosition, + Vector3 arrangePosition, PositionType positionType, RectangleDouble? bedBounds = null, Action progressReporter = null) @@ -117,14 +117,14 @@ namespace MatterHackers.MatterControl { objectsThatHaveBeenPlaced.Add(object3D); objectsThatWereArrange.Add(object3D); + + // and put it on the bed (set the bottom to z = 0) + PlaceOnBed(object3D); } progressReporter?.Invoke(Util.GetRatio(0, 1, meshGroupIndex, object3DList.Count), null); currentRatioDone += ratioPerMeshGroup; - - // and put it on the bed (set the bottom to z = 0) - PlaceOnBed(object3D); } // and finally center whatever we have as a group @@ -145,7 +145,7 @@ namespace MatterHackers.MatterControl for (int i = 0; i < object3DList.Count; i++) { - object3DList[i].Matrix *= Matrix4X4.CreateTranslation(arangePosition - offset); + object3DList[i].Matrix *= Matrix4X4.CreateTranslation(arrangePosition - offset); } } @@ -263,11 +263,11 @@ namespace MatterHackers.MatterControl AxisAlignedBoundingBox testBounds = meshToMoveBounds.NewTransformed(transform); - foreach (IObject3D meshToTest in itemsToAvoid) + foreach (IObject3D itemToTest in itemsToAvoid) { - if (meshToTest != itemToMove) + if (itemToTest != itemToMove) { - AxisAlignedBoundingBox existingMeshBounds = meshToTest.GetAxisAlignedBoundingBox(); + AxisAlignedBoundingBox existingMeshBounds = itemToTest.GetAxisAlignedBoundingBox(); var intersection = AxisAlignedBoundingBox.Intersection(testBounds, existingMeshBounds); if (intersection.XSize > 0 && intersection.YSize > 0) {