diff --git a/MatterControlLib/DesignTools/Operations/ArrayLinearObject3D.cs b/MatterControlLib/DesignTools/Operations/ArrayLinearObject3D.cs index 457427267..3ce128f07 100644 --- a/MatterControlLib/DesignTools/Operations/ArrayLinearObject3D.cs +++ b/MatterControlLib/DesignTools/Operations/ArrayLinearObject3D.cs @@ -96,7 +96,21 @@ namespace MatterHackers.MatterControl.DesignTools.Operations var updateItems = SheetObject3D.SortAndLockUpdateItems(this, (item) => { - return !(item.Parent is ArrayObject3D && item is OperationSourceObject3D); + // WIP + if (item.Parent == this) + { + // only process our children that are not the source object + return !(item is OperationSourceObject3D); + } + else if (item.Parent is OperationSourceContainerObject3D) + { + // If we find another source container + // Only process its children that are the source container (they will be replicated and modified correctly by the source container) + return item is OperationSourceObject3D; + } + + // process everything else + return true; }); var runningInterval = SheetObject3D.SendInvalidateInRebuildOrder(updateItems, InvalidateType.Properties); diff --git a/MatterControlLib/DesignTools/Primitives/BaseObject3D.cs b/MatterControlLib/DesignTools/Primitives/BaseObject3D.cs index e2c38198c..b09ddaa8e 100644 --- a/MatterControlLib/DesignTools/Primitives/BaseObject3D.cs +++ b/MatterControlLib/DesignTools/Primitives/BaseObject3D.cs @@ -83,10 +83,10 @@ namespace MatterHackers.MatterControl.DesignTools public DoubleOrExpression CalculationHeight { get; set; } = .1; [DisplayName("Expand")] - [Slider(1, 30, Easing.EaseType.Quadratic, snapDistance: .5)] + [Slider(0, 30, Easing.EaseType.Quadratic, snapDistance: .5)] public DoubleOrExpression BaseSize { get; set; } = 3; - [Slider(1, 20, Easing.EaseType.Quadratic, snapDistance: .1)] + [Slider(0, 10, Easing.EaseType.Quadratic, snapDistance: .1)] public DoubleOrExpression InfillAmount { get; set; } = 3; [DisplayName("Height")] @@ -360,21 +360,6 @@ namespace MatterHackers.MatterControl.DesignTools return boundingCircle; } - private static PolyTree GetPolyTree(Polygons basePolygons) - { - // create a bounding polygon to clip against - Polygon boundingPoly = GetBoundingPolygon(basePolygons); - - var polyTreeForTrace = new PolyTree(); - - var clipper = new Clipper(); - clipper.AddPaths(basePolygons, PolyType.ptSubject, true); - clipper.AddPath(boundingPoly, PolyType.ptClip, true); - clipper.Execute(ClipType.ctIntersection, polyTreeForTrace); - - return polyTreeForTrace; - } - public void GenerateBase(Polygons polygonShape, double bottomWithoutBase) { if (polygonShape != null @@ -393,11 +378,7 @@ namespace MatterHackers.MatterControl.DesignTools break; case BaseTypes.Outline: - PolyTree polyTreeForBase = GetPolyTree(polygonShape); - foreach (PolyNode polyToOffset in polyTreeForBase.Childs) - { - polysToOffset.Add(polyToOffset.Contour); - } + polysToOffset.AddRange(polygonShape); break; } diff --git a/MatterControlLib/DesignTools/Sheets/SheetObject3D.cs b/MatterControlLib/DesignTools/Sheets/SheetObject3D.cs index 50e08767d..d62e4016b 100644 --- a/MatterControlLib/DesignTools/Sheets/SheetObject3D.cs +++ b/MatterControlLib/DesignTools/Sheets/SheetObject3D.cs @@ -148,7 +148,7 @@ namespace MatterHackers.MatterControl.DesignTools public static List SortAndLockUpdateItems(IObject3D root, Func includeObject) { var requiredUpdateItems = new Dictionary(); - foreach (var child in root.Children) + foreach (var child in root.Descendants()) { if (includeObject(child)) { @@ -249,7 +249,7 @@ namespace MatterHackers.MatterControl.DesignTools } var depth2 = inDepth; - if (HasParametersWithActiveFunctions(inItem)) + if (HasExpressionWithString(inItem, "=", true)) { var itemToAdd = inItem; while (itemToAdd != null @@ -471,14 +471,14 @@ namespace MatterHackers.MatterControl.DesignTools // Check if the sheet is the first sheet parent of this item (if not it will not change it's data). if (FindFirstSheet(itemToCheck) == sheet) { - return HasParametersWithActiveFunctions(itemToCheck); + return HasExpressionWithString(itemToCheck, "=", true); } } return false; } - public static bool HasParametersWithActiveFunctions(IObject3D itemToCheck) + public static bool HasExpressionWithString(IObject3D itemToCheck, string checkForString, bool startsWith) { foreach (var item in itemToCheck.DescendantsAndSelf()) { @@ -489,10 +489,17 @@ namespace MatterHackers.MatterControl.DesignTools if (propertyValue is IDirectOrExpression directOrExpression) { - if (directOrExpression.Expression.StartsWith("=")) + if (startsWith) { - // WIP: check if the value has actually changed, this will update every object on any cell change - return true; + if (directOrExpression.Expression.StartsWith(checkForString)) + { + // WIP: check if the value has actually changed, this will update every object on any cell change + return true; + } + } + else + { + return directOrExpression.Expression.Contains(checkForString); } } } diff --git a/MatterControlLib/PrinterCommunication/PrinterConnection.cs b/MatterControlLib/PrinterCommunication/PrinterConnection.cs index 0ce8cadb2..756f32d29 100644 --- a/MatterControlLib/PrinterCommunication/PrinterConnection.cs +++ b/MatterControlLib/PrinterCommunication/PrinterConnection.cs @@ -872,7 +872,7 @@ namespace MatterHackers.MatterControl.PrinterCommunication public string PrintJobName { get; private set; } = null; - public bool PrintWasCanceled { get; set; } = false; + public bool PrintWasCanceled { get; private set; } = false; public double RatioIntoCurrentLayerSeconds { diff --git a/Submodules/MatterSlice b/Submodules/MatterSlice index 84a364a7f..49be2b6a9 160000 --- a/Submodules/MatterSlice +++ b/Submodules/MatterSlice @@ -1 +1 @@ -Subproject commit 84a364a7f26fc1a24ef2d616294465c4e52781cc +Subproject commit 49be2b6a99486f12ef036bd35596036ab5e3fe1b diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index e1312ca89..e728d4667 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit e1312ca8960b1cbec7bfe0b0f85770d824866983 +Subproject commit e728d466796ab765de25e51f09e3107d42014168