diff --git a/AboutPage/HTMLParser/HtmlWidget.cs b/AboutPage/HTMLParser/HtmlWidget.cs index dca349060..a59eb9b13 100644 --- a/AboutPage/HTMLParser/HtmlWidget.cs +++ b/AboutPage/HTMLParser/HtmlWidget.cs @@ -136,7 +136,7 @@ namespace MatterHackers.MatterControl Button linkButton = linkButtonFactory.Generate(decodedHtml.Replace("\r\n", "\n")); StyledTypeFace styled = new StyledTypeFace(LiberationSansFont.Instance, elementState.PointSize); double descentInPixels = styled.DescentInPixels; - linkButton.OriginRelativeParent = new VectorMath.Vector2(linkButton.OriginRelativeParent.x, linkButton.OriginRelativeParent.y + descentInPixels); + linkButton.OriginRelativeParent = new VectorMath.Vector2(linkButton.OriginRelativeParent.X, linkButton.OriginRelativeParent.Y + descentInPixels); linkButton.Click += (sender, mouseEvent) => { MatterControlApplication.Instance.LaunchBrowser(elementState.Href); @@ -247,7 +247,7 @@ namespace MatterHackers.MatterControl createdButton = linkButtonFactory.Generate(decodedHtml); StyledTypeFace styled = new StyledTypeFace(LiberationSansFont.Instance, elementState.PointSize); double descentInPixels = styled.DescentInPixels; - createdButton.OriginRelativeParent = new VectorMath.Vector2(createdButton.OriginRelativeParent.x, createdButton.OriginRelativeParent.y + descentInPixels); + createdButton.OriginRelativeParent = new VectorMath.Vector2(createdButton.OriginRelativeParent.X, createdButton.OriginRelativeParent.Y + descentInPixels); widgetToAdd = createdButton; linkButtonFactory.fontSize = oldFontSize; } diff --git a/ConfigurationPage/PrintLeveling/LevelWizard7PointRadial.cs b/ConfigurationPage/PrintLeveling/LevelWizard7PointRadial.cs index dcc9eaa8d..4ffb2e848 100644 --- a/ConfigurationPage/PrintLeveling/LevelWizard7PointRadial.cs +++ b/ConfigurationPage/PrintLeveling/LevelWizard7PointRadial.cs @@ -137,7 +137,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling string medPrecisionLabel = "Medium Precision".Localize(); string highPrecisionLabel = "High Precision".Localize(); - double bedRadius = Math.Min(printer.Settings.GetValue(SettingsKey.bed_size).x, printer.Settings.GetValue(SettingsKey.bed_size).y) / 2; + double bedRadius = Math.Min(printer.Settings.GetValue(SettingsKey.bed_size).X, printer.Settings.GetValue(SettingsKey.bed_size).Y) / 2; double startProbeHeight = printer.Settings.GetValue(SettingsKey.print_leveling_probe_start); for (int i = 0; i < numberOfRadialSamples + 1; i++) @@ -221,7 +221,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling { Vector3 outPosition = GetPositionWithZOffset(currentDestination); - newLine = newLine.Append(String.Format("X{0:0.##} Y{1:0.##} Z{2:0.###}", outPosition.x, outPosition.y, outPosition.z)); + newLine = newLine.Append(String.Format("X{0:0.##} Y{1:0.##} Z{2:0.###}", outPosition.X, outPosition.Y, outPosition.Z)); } if (extruderDelta != 0) @@ -245,7 +245,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling { Vector2 destinationFromCenter = new Vector2(currentDestination) - BedCenter; - double angleToPoint = Math.Atan2(destinationFromCenter.y, destinationFromCenter.x); + double angleToPoint = Math.Atan2(destinationFromCenter.Y, destinationFromCenter.X); if (angleToPoint < 0) { @@ -262,9 +262,9 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling Plane currentPlane = new Plane(SampledPositions[firstIndex], SampledPositions[lastIndex], SampledPositions[NumberOfRadialSamples]); - double hitDistance = currentPlane.GetDistanceToIntersection(new Vector3(currentDestination.x, currentDestination.y, 0), Vector3.UnitZ); + double hitDistance = currentPlane.GetDistanceToIntersection(new Vector3(currentDestination.X, currentDestination.Y, 0), Vector3.UnitZ); - currentDestination.z += hitDistance; + currentDestination.Z += hitDistance; } return currentDestination; diff --git a/ConfigurationPage/PrintLeveling/LevelWizardBase.cs b/ConfigurationPage/PrintLeveling/LevelWizardBase.cs index 4b1b6452a..44787b4cf 100644 --- a/ConfigurationPage/PrintLeveling/LevelWizardBase.cs +++ b/ConfigurationPage/PrintLeveling/LevelWizardBase.cs @@ -83,12 +83,12 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling } Vector2 probePosition = new Vector2(); - if (!double.TryParse(xyData[0], out probePosition.x)) + if (!double.TryParse(xyData[0], out probePosition.X)) { // error return null; } - if (!double.TryParse(xyData[1], out probePosition.y)) + if (!double.TryParse(xyData[1], out probePosition.Y)) { // error return null; @@ -118,7 +118,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling switch (printerSettings.GetValue(SettingsKey.bed_shape)) { case BedShape.Circular: - Vector2 firstPosition = new Vector2(printCenter.x, printCenter.y + (bedSize.y / 2) * .5); + Vector2 firstPosition = new Vector2(printCenter.X, printCenter.Y + (bedSize.Y / 2) * .5); switch (index) { case 0: @@ -139,13 +139,13 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling switch (index) { case 0: - return new Vector2(printCenter.x, printCenter.y + (bedSize.y / 2) * .8); + return new Vector2(printCenter.X, printCenter.Y + (bedSize.Y / 2) * .8); case 1: - return new Vector2(printCenter.x - (bedSize.x / 2) * .8, printCenter.y - (bedSize.y / 2) * .8); + return new Vector2(printCenter.X - (bedSize.X / 2) * .8, printCenter.Y - (bedSize.Y / 2) * .8); case 2: - return new Vector2(printCenter.x + (bedSize.x / 2) * .8, printCenter.y - (bedSize.y / 2) * .8); + return new Vector2(printCenter.X + (bedSize.X / 2) * .8, printCenter.Y - (bedSize.Y / 2) * .8); default: throw new IndexOutOfRangeException(); diff --git a/ConfigurationPage/PrintLeveling/LevelWizardMesh.cs b/ConfigurationPage/PrintLeveling/LevelWizardMesh.cs index 9cbde8c83..8783a47f7 100644 --- a/ConfigurationPage/PrintLeveling/LevelWizardMesh.cs +++ b/ConfigurationPage/PrintLeveling/LevelWizardMesh.cs @@ -109,15 +109,15 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling switch (xIndex) { case 0: - samplePosition.x = printCenter.x - (bedSize.x / 2) * .8; + samplePosition.X = printCenter.X - (bedSize.X / 2) * .8; break; case 1: - samplePosition.x = printCenter.x; + samplePosition.X = printCenter.X; break; case 2: - samplePosition.x = printCenter.x + (bedSize.x / 2) * .8; + samplePosition.X = printCenter.X + (bedSize.X / 2) * .8; break; default: @@ -127,15 +127,15 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling switch (yIndex) { case 0: - samplePosition.y = printCenter.y - (bedSize.y / 2) * .8; + samplePosition.Y = printCenter.Y - (bedSize.Y / 2) * .8; break; case 1: - samplePosition.y = printCenter.y; + samplePosition.Y = printCenter.Y; break; case 2: - samplePosition.y = printCenter.y + (bedSize.y / 2) * .8; + samplePosition.Y = printCenter.Y + (bedSize.Y / 2) * .8; break; default: @@ -197,7 +197,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling string medPrecisionLabel = "Medium Precision".Localize(); string highPrecisionLabel = "High Precision".Localize(); - double bedRadius = Math.Min(printerSettings.GetValue(SettingsKey.bed_size).x, printerSettings.GetValue(SettingsKey.bed_size).y) / 2; + double bedRadius = Math.Min(printerSettings.GetValue(SettingsKey.bed_size).X, printerSettings.GetValue(SettingsKey.bed_size).Y) / 2; double startProbeHeight = printerSettings.GetValue(SettingsKey.print_leveling_probe_start); for (int i = 0; i < probeCount; i++) @@ -292,7 +292,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling lastDestinationWithLevelingApplied = outPosition; - newLine = newLine.Append(String.Format("X{0:0.##} Y{1:0.##} Z{2:0.###}", outPosition.x, outPosition.y, outPosition.z)); + newLine = newLine.Append(String.Format("X{0:0.##} Y{1:0.##} Z{2:0.###}", outPosition.X, outPosition.Y, outPosition.Z)); } if (extruderDelta != 0) @@ -331,7 +331,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling switch (printerSettings.GetValue(SettingsKey.bed_shape)) { case BedShape.Circular: - Vector2 firstPosition = new Vector2(printCenter.x, printCenter.y + (bedSize.y / 2) * .5); + Vector2 firstPosition = new Vector2(printCenter.X, printCenter.Y + (bedSize.Y / 2) * .5); switch (index) { case 0: @@ -352,13 +352,13 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling switch (index) { case 0: - return new Vector2(printCenter.x, printCenter.y + (bedSize.y / 2) * .8); + return new Vector2(printCenter.X, printCenter.Y + (bedSize.Y / 2) * .8); case 1: - return new Vector2(printCenter.x - (bedSize.x / 2) * .8, printCenter.y - (bedSize.y / 2) * .8); + return new Vector2(printCenter.X - (bedSize.X / 2) * .8, printCenter.Y - (bedSize.Y / 2) * .8); case 2: - return new Vector2(printCenter.x + (bedSize.x / 2) * .8, printCenter.y - (bedSize.y / 2) * .8); + return new Vector2(printCenter.X + (bedSize.X / 2) * .8, printCenter.Y - (bedSize.Y / 2) * .8); default: throw new IndexOutOfRangeException(); @@ -371,7 +371,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling int bestIndex = 0; double bestDist = double.PositiveInfinity; - currentDestination.z = 0; + currentDestination.Z = 0; for (int regionIndex = 0; regionIndex < Regions.Count; regionIndex++) { var dist = (Regions[regionIndex].Center - currentDestination).LengthSquared; @@ -406,18 +406,18 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling InitializePlanes(); } - var destinationAtZ0 = new Vector3(currentDestination.x, currentDestination.y, 0); + var destinationAtZ0 = new Vector3(currentDestination.X, currentDestination.Y, 0); // which triangle to check (distance to the centers) if ((LeftBottomCenter - destinationAtZ0).LengthSquared < (RightTopCenter - destinationAtZ0).LengthSquared) { double hitDistance = LeftBottomPlane.GetDistanceToIntersection(destinationAtZ0, Vector3.UnitZ); - currentDestination.z += hitDistance; + currentDestination.Z += hitDistance; } else { double hitDistance = RightTopPlane.GetDistanceToIntersection(destinationAtZ0, Vector3.UnitZ); - currentDestination.z += hitDistance; + currentDestination.Z += hitDistance; } return currentDestination; diff --git a/ConfigurationPage/PrintLeveling/PrintLevelPages.cs b/ConfigurationPage/PrintLeveling/PrintLevelPages.cs index 5e1db1adf..cc45704ef 100644 --- a/ConfigurationPage/PrintLeveling/PrintLevelPages.cs +++ b/ConfigurationPage/PrintLeveling/PrintLevelPages.cs @@ -235,8 +235,8 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling var feedRates = printer.Settings.Helpers.ManualMovementSpeeds(); - printer.Connection.MoveAbsolute(PrinterConnection.Axis.Z, probeStartPosition.z, feedRates.z); - printer.Connection.MoveAbsolute(probeStartPosition, feedRates.x); + printer.Connection.MoveAbsolute(PrinterConnection.Axis.Z, probeStartPosition.Z, feedRates.Z); + printer.Connection.MoveAbsolute(probeStartPosition, feedRates.X); printer.Connection.SendLineToPrinterNow("G30"); printer.Connection.ReadLine.RegisterEvent(FinishedProbe, ref unregisterEvents); @@ -256,8 +256,8 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling printer.Connection.ReadLine.UnregisterEvent(FinishedProbe, ref unregisterEvents); int zStringPos = currentEvent.Data.LastIndexOf("Z:"); string zProbeHeight = currentEvent.Data.Substring(zStringPos + 2); - probePosition.position = new Vector3(probeStartPosition.x, probeStartPosition.y, double.Parse(zProbeHeight)); - printer.Connection.MoveAbsolute(probeStartPosition, printer.Settings.Helpers.ManualMovementSpeeds().z); + probePosition.position = new Vector3(probeStartPosition.X, probeStartPosition.Y, double.Parse(zProbeHeight)); + printer.Connection.MoveAbsolute(probeStartPosition, printer.Settings.Helpers.ManualMovementSpeeds().Z); printer.Connection.ReadPosition(); UiThread.RunOnIdle(() => container.nextButton.OnClick(null)); @@ -365,7 +365,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling updateUntilClose = (tw) => { Vector3 destinationPosition = printer.Connection.CurrentDestination; - zPosition.Text = "Z: {0:0.00}".FormatWith(destinationPosition.z); + zPosition.Text = "Z: {0:0.00}".FormatWith(destinationPosition.Z); UiThread.RunOnIdle(() => updateUntilClose(zPosition), .3); }; updateUntilClose(zPosition); @@ -441,13 +441,13 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling private void zMinusControl_Click(object sender, EventArgs mouseEvent) { - printer.Connection.MoveRelative(PrinterConnection.Axis.Z, -moveAmount, printer.Settings.Helpers.ManualMovementSpeeds().z); + printer.Connection.MoveRelative(PrinterConnection.Axis.Z, -moveAmount, printer.Settings.Helpers.ManualMovementSpeeds().Z); printer.Connection.ReadPosition(); } private void zPlusControl_Click(object sender, EventArgs mouseEvent) { - printer.Connection.MoveRelative(PrinterConnection.Axis.Z, moveAmount, printer.Settings.Helpers.ManualMovementSpeeds().z); + printer.Connection.MoveRelative(PrinterConnection.Axis.Z, moveAmount, printer.Settings.Helpers.ManualMovementSpeeds().Z); printer.Connection.ReadPosition(); } } @@ -487,18 +487,18 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling double sampleRead = double.MinValue; if (currentEvent.Data.StartsWith("Bed")) // marlin G30 return code (looks like: 'Bed Position X:20 Y:32 Z:.01') { - probePositions[probePositionsBeingEditedIndex].position.x = probeStartPosition.x; - probePositions[probePositionsBeingEditedIndex].position.y = probeStartPosition.y; + probePositions[probePositionsBeingEditedIndex].position.X = probeStartPosition.X; + probePositions[probePositionsBeingEditedIndex].position.Y = probeStartPosition.Y; GCodeFile.GetFirstNumberAfter("Z:", currentEvent.Data, ref sampleRead); } else if (currentEvent.Data.StartsWith("Z:")) // smoothie G30 return code (looks like: 'Z:10.01') { - probePositions[probePositionsBeingEditedIndex].position.x = probeStartPosition.x; - probePositions[probePositionsBeingEditedIndex].position.y = probeStartPosition.y; + probePositions[probePositionsBeingEditedIndex].position.X = probeStartPosition.X; + probePositions[probePositionsBeingEditedIndex].position.Y = probeStartPosition.Y; // smoothie returns the position relative to the start postion double reportedProbeZ = 0; GCodeFile.GetFirstNumberAfter("Z:", currentEvent.Data, ref reportedProbeZ); - sampleRead = probeStartPosition.z - reportedProbeZ; + sampleRead = probeStartPosition.Z - reportedProbeZ; } if (sampleRead != double.MinValue) @@ -516,7 +516,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling samples.RemoveAt(samples.Count - 1); } - probePositions[probePositionsBeingEditedIndex].position.z = Math.Round(samples.Average(), 2); + probePositions[probePositionsBeingEditedIndex].position.Z = Math.Round(samples.Average(), 2); UiThread.RunOnIdle(() => container.nextButton.OnClick(null)); } } @@ -554,8 +554,8 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling var probeOffset = printer.Settings.GetValue(SettingsKey.z_probe_xy_offset); adjustedProbePosition -= new Vector3(probeOffset); - printer.Connection.MoveAbsolute(PrinterConnection.Axis.Z, probeStartPosition.z, feedRates.z); - printer.Connection.MoveAbsolute(adjustedProbePosition, feedRates.x); + printer.Connection.MoveAbsolute(PrinterConnection.Axis.Z, probeStartPosition.Z, feedRates.Z); + printer.Connection.MoveAbsolute(adjustedProbePosition, feedRates.X); int numberOfSamples = printer.Settings.GetValue(SettingsKey.z_probe_samples); for (int i = 0; i < numberOfSamples; i++) @@ -563,7 +563,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling // probe the current position printer.Connection.SendLineToPrinterNow("G30"); // raise the probe after each sample - printer.Connection.MoveAbsolute(adjustedProbePosition, feedRates.x); + printer.Connection.MoveAbsolute(adjustedProbePosition, feedRates.X); } container.backButton.Enabled = false; @@ -609,8 +609,8 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling var feedRates = printer.Settings.Helpers.ManualMovementSpeeds(); - printer.Connection.MoveAbsolute(PrinterConnection.Axis.Z, probeStartPosition.z, feedRates.z); - printer.Connection.MoveAbsolute(probeStartPosition, feedRates.x); + printer.Connection.MoveAbsolute(PrinterConnection.Axis.Z, probeStartPosition.Z, feedRates.Z); + printer.Connection.MoveAbsolute(probeStartPosition, feedRates.X); printer.Connection.ReadPosition(); container.backButton.Enabled = false; @@ -672,7 +672,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling { if (haveDrawn) { - printer.Connection.MoveRelative(PrinterConnection.Axis.Z, 2, printer.Settings.Helpers.ManualMovementSpeeds().z); + printer.Connection.MoveRelative(PrinterConnection.Axis.Z, 2, printer.Settings.Helpers.ManualMovementSpeeds().Z); } base.PageIsBecomingInactive(); } diff --git a/ConfigurationPage/PrintLeveling/PrintLevelingData.cs b/ConfigurationPage/PrintLeveling/PrintLevelingData.cs index 84699c08f..07eedb990 100644 --- a/ConfigurationPage/PrintLeveling/PrintLevelingData.cs +++ b/ConfigurationPage/PrintLeveling/PrintLevelingData.cs @@ -91,9 +91,9 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling { Vector3 position = new Vector3(); - position.x = double.Parse(lines[0 * 3 + i]); - position.y = double.Parse(lines[1 * 3 + i]); - position.z = double.Parse(lines[2 * 3 + i]); + position.X = double.Parse(lines[0 * 3 + i]); + position.Y = double.Parse(lines[1 * 3 + i]); + position.Z = double.Parse(lines[2 * 3 + i]); SampledPositions.Add(position); } diff --git a/ControlElements/MHPasswordTextEditWidget.cs b/ControlElements/MHPasswordTextEditWidget.cs index 5aaabbb34..5bc03295b 100644 --- a/ControlElements/MHPasswordTextEditWidget.cs +++ b/ControlElements/MHPasswordTextEditWidget.cs @@ -49,7 +49,7 @@ namespace MatterHackers.MatterControl HAnchor = HAnchor.Stretch, VAnchor = VAnchor.Bottom }; - passwordCoverText.MinimumSize = new Vector2(Math.Max(passwordCoverText.MinimumSize.x, pixelWidth), Math.Max(passwordCoverText.MinimumSize.y, pixelHeight)); + passwordCoverText.MinimumSize = new Vector2(Math.Max(passwordCoverText.MinimumSize.X, pixelWidth), Math.Max(passwordCoverText.MinimumSize.Y, pixelHeight)); this.AddChild(passwordCoverText); this.ActualTextEditWidget.TextChanged += (sender, e) => diff --git a/ControlElements/MHTextEditWidget.cs b/ControlElements/MHTextEditWidget.cs index 96231db0d..71b7c2db6 100644 --- a/ControlElements/MHTextEditWidget.cs +++ b/ControlElements/MHTextEditWidget.cs @@ -53,7 +53,7 @@ namespace MatterHackers.MatterControl HAnchor = HAnchor.Stretch, VAnchor = VAnchor.Bottom }; - this.ActualTextEditWidget.MinimumSize = new Vector2(Math.Max(ActualTextEditWidget.MinimumSize.x, pixelWidth), Math.Max(ActualTextEditWidget.MinimumSize.y, pixelHeight)); + this.ActualTextEditWidget.MinimumSize = new Vector2(Math.Max(ActualTextEditWidget.MinimumSize.X, pixelWidth), Math.Max(ActualTextEditWidget.MinimumSize.Y, pixelHeight)); this.AddChild(this.ActualTextEditWidget); this.AddChild(noContentFieldDescription = new TextWidget(messageWhenEmptyAndNotSelected, textColor: Color.Gray) diff --git a/CustomWidgets/DoubleSolidSlider.cs b/CustomWidgets/DoubleSolidSlider.cs index 1eb6ed240..91baee0c5 100644 --- a/CustomWidgets/DoubleSolidSlider.cs +++ b/CustomWidgets/DoubleSolidSlider.cs @@ -325,7 +325,7 @@ namespace MatterHackers.MatterControl } public DoubleSolidSlider(Vector2 lowerLeft, Vector2 upperRight) - : this(new Vector2(lowerLeft.x, lowerLeft.y + (upperRight.y - lowerLeft.y) / 2), upperRight.x - lowerLeft.x) + : this(new Vector2(lowerLeft.X, lowerLeft.Y + (upperRight.Y - lowerLeft.Y) / 2), upperRight.X - lowerLeft.X) { } @@ -425,11 +425,11 @@ namespace MatterHackers.MatterControl { if (Orientation == Orientation.Horizontal) { - mouseDownOffsetFromFirstThumbCenter = mousePos.x - PositionPixelsFromFirstValue; + mouseDownOffsetFromFirstThumbCenter = mousePos.X - PositionPixelsFromFirstValue; } else { - mouseDownOffsetFromFirstThumbCenter = mousePos.y - PositionPixelsFromFirstValue; + mouseDownOffsetFromFirstThumbCenter = mousePos.Y - PositionPixelsFromFirstValue; } downOnFirstThumb = true; } @@ -437,11 +437,11 @@ namespace MatterHackers.MatterControl { if (Orientation == Orientation.Horizontal) { - mouseDownOffsetFromSecondThumbCenter = mousePos.x - PositionPixelsFromSecondValue; + mouseDownOffsetFromSecondThumbCenter = mousePos.X - PositionPixelsFromSecondValue; } else { - mouseDownOffsetFromSecondThumbCenter = mousePos.y - PositionPixelsFromSecondValue; + mouseDownOffsetFromSecondThumbCenter = mousePos.Y - PositionPixelsFromSecondValue; } downOnSecondThumb = true; } @@ -461,11 +461,11 @@ namespace MatterHackers.MatterControl double oldValue = FirstValue; if (Orientation == Orientation.Horizontal) { - PositionPixelsFromFirstValue = Math.Min(mousePos.x - mouseDownOffsetFromFirstThumbCenter, PositionPixelsFromSecondValue - ThumbWidth - 2); + PositionPixelsFromFirstValue = Math.Min(mousePos.X - mouseDownOffsetFromFirstThumbCenter, PositionPixelsFromSecondValue - ThumbWidth - 2); } else { - PositionPixelsFromFirstValue = Math.Min(mousePos.y - mouseDownOffsetFromFirstThumbCenter, PositionPixelsFromSecondValue - ThumbWidth - 2); + PositionPixelsFromFirstValue = Math.Min(mousePos.Y - mouseDownOffsetFromFirstThumbCenter, PositionPixelsFromSecondValue - ThumbWidth - 2); } if (oldValue != FirstValue) { @@ -481,11 +481,11 @@ namespace MatterHackers.MatterControl double oldValue = SecondValue; if (Orientation == Orientation.Horizontal) { - PositionPixelsFromSecondValue = Math.Max(mousePos.x - mouseDownOffsetFromSecondThumbCenter, PositionPixelsFromFirstValue + ThumbWidth + 2); + PositionPixelsFromSecondValue = Math.Max(mousePos.X - mouseDownOffsetFromSecondThumbCenter, PositionPixelsFromFirstValue + ThumbWidth + 2); } else { - PositionPixelsFromSecondValue = Math.Max(mousePos.y - mouseDownOffsetFromSecondThumbCenter, PositionPixelsFromFirstValue + ThumbWidth + 2); + PositionPixelsFromSecondValue = Math.Max(mousePos.Y - mouseDownOffsetFromSecondThumbCenter, PositionPixelsFromFirstValue + ThumbWidth + 2); } if (oldValue != SecondValue) { diff --git a/CustomWidgets/DropDownMenuWidget.cs b/CustomWidgets/DropDownMenuWidget.cs index 4c30b6109..5545e9509 100644 --- a/CustomWidgets/DropDownMenuWidget.cs +++ b/CustomWidgets/DropDownMenuWidget.cs @@ -195,7 +195,7 @@ namespace MatterHackers.Agg.UI Vector2 minSize = new Vector2(LocalBounds.Width, LocalBounds.Height); foreach (MenuItem item in MenuItems) { - minSize.x = Math.Max(minSize.x, item.Width); + minSize.X = Math.Max(minSize.X, item.Width); } string startText = mainControlWidget.Text; @@ -203,8 +203,8 @@ namespace MatterHackers.Agg.UI { mainControlWidget.Text = item.Text; - minSize.x = Math.Max(minSize.x, LocalBounds.Width); - minSize.y = Math.Max(minSize.y, LocalBounds.Height); + minSize.X = Math.Max(minSize.X, LocalBounds.Width); + minSize.Y = Math.Max(minSize.Y, LocalBounds.Height); } mainControlWidget.Text = startText; @@ -215,7 +215,7 @@ namespace MatterHackers.Agg.UI foreach (MenuItem item in e.NewItems) { - item.MinimumSize = new Vector2(minSize.x, item.MinimumSize.y); + item.MinimumSize = new Vector2(minSize.X, item.MinimumSize.Y); // remove it if it is there so we don't have two. It is ok to remove a delegate that is not present. item.Selected -= item_Selected; item.Selected += item_Selected; diff --git a/CustomWidgets/PrintingWindow/BasicBody.cs b/CustomWidgets/PrintingWindow/BasicBody.cs index 848e4fe7c..2513251e7 100644 --- a/CustomWidgets/PrintingWindow/BasicBody.cs +++ b/CustomWidgets/PrintingWindow/BasicBody.cs @@ -199,7 +199,7 @@ namespace MatterHackers.MatterControl.CustomWidgets printerName = new TextWidget(printer.Settings.GetValue(SettingsKey.printer_name), pointSize: 16, textColor: ActiveTheme.Instance.PrimaryTextColor) { HAnchor = HAnchor.Center, - MinimumSize = new Vector2(maxTextWidth, MinimumSize.y), + MinimumSize = new Vector2(maxTextWidth, MinimumSize.Y), Width = maxTextWidth, Margin = new BorderDouble(0, 3), }; @@ -209,7 +209,7 @@ namespace MatterHackers.MatterControl.CustomWidgets partName = new TextWidget(printer.Bed.printItem.GetFriendlyName(), pointSize: 16, textColor: ActiveTheme.Instance.PrimaryTextColor) { HAnchor = HAnchor.Center, - MinimumSize = new Vector2(maxTextWidth, MinimumSize.y), + MinimumSize = new Vector2(maxTextWidth, MinimumSize.Y), Width = maxTextWidth, Margin = new BorderDouble(0, 3) }; diff --git a/CustomWidgets/ResizeContainer.cs b/CustomWidgets/ResizeContainer.cs index dc9722fb3..92e13f133 100644 --- a/CustomWidgets/ResizeContainer.cs +++ b/CustomWidgets/ResizeContainer.cs @@ -71,10 +71,10 @@ namespace MatterHackers.MatterControl.CustomWidgets public override void OnMouseDown(MouseEventArgs mouseEvent) { - if (mouseEvent.Position.x < this.SplitterWidth) + if (mouseEvent.Position.X < this.SplitterWidth) { mouseDownOnBar = true; - mouseDownX = TransformToScreenSpace(mouseEvent.Position).x; + mouseDownX = TransformToScreenSpace(mouseEvent.Position).X; downWidth = Width; } base.OnMouseDown(mouseEvent); @@ -84,7 +84,7 @@ namespace MatterHackers.MatterControl.CustomWidgets { if (mouseDownOnBar) { - int currentMouseX = (int)TransformToScreenSpace(mouseEvent.Position).x; + int currentMouseX = (int)TransformToScreenSpace(mouseEvent.Position).X; UiThread.RunOnIdle(() => { resizeTarget.Width = downWidth + mouseDownX - currentMouseX; diff --git a/CustomWidgets/SlidePanelWidget.cs b/CustomWidgets/SlidePanelWidget.cs index b06c05858..49e44d236 100644 --- a/CustomWidgets/SlidePanelWidget.cs +++ b/CustomWidgets/SlidePanelWidget.cs @@ -84,7 +84,7 @@ namespace MatterHackers.MatterControl double maxOffsetPerDraw = timeHasBeenChanging.ElapsedMilliseconds; double desiredOffset = desiredPanelIndex * -Width; - double currentOffset = panels[0].OriginRelativeParent.x; + double currentOffset = panels[0].OriginRelativeParent.X; double delta = desiredOffset - currentOffset; if (delta < 0) { diff --git a/CustomWidgets/SolidSlider.cs b/CustomWidgets/SolidSlider.cs index 0cd974ca2..946f0f088 100644 --- a/CustomWidgets/SolidSlider.cs +++ b/CustomWidgets/SolidSlider.cs @@ -256,7 +256,7 @@ namespace MatterHackers.MatterControl } public SolidSlider(Vector2 lowerLeft, Vector2 upperRight) - : this(new Vector2(lowerLeft.x, lowerLeft.y + (upperRight.y - lowerLeft.y) / 2), upperRight.x - lowerLeft.x) + : this(new Vector2(lowerLeft.X, lowerLeft.Y + (upperRight.Y - lowerLeft.Y) / 2), upperRight.X - lowerLeft.X) { } @@ -347,11 +347,11 @@ namespace MatterHackers.MatterControl { if (Orientation == Orientation.Horizontal) { - mouseDownOffsetFromThumbCenter = mousePos.x - PositionPixelsFromFirstValue; + mouseDownOffsetFromThumbCenter = mousePos.X - PositionPixelsFromFirstValue; } else { - mouseDownOffsetFromThumbCenter = mousePos.y - PositionPixelsFromFirstValue; + mouseDownOffsetFromThumbCenter = mousePos.Y - PositionPixelsFromFirstValue; } downOnThumb = true; } @@ -362,11 +362,11 @@ namespace MatterHackers.MatterControl { if (Orientation == Orientation.Horizontal) { - PositionPixelsFromFirstValue = mousePos.x; + PositionPixelsFromFirstValue = mousePos.X; } else { - PositionPixelsFromFirstValue = mousePos.y; + PositionPixelsFromFirstValue = mousePos.Y; } } } @@ -388,11 +388,11 @@ namespace MatterHackers.MatterControl double oldValue = Value; if (Orientation == Orientation.Horizontal) { - PositionPixelsFromFirstValue = mousePos.x - mouseDownOffsetFromThumbCenter; + PositionPixelsFromFirstValue = mousePos.X - mouseDownOffsetFromThumbCenter; } else { - PositionPixelsFromFirstValue = mousePos.y - mouseDownOffsetFromThumbCenter; + PositionPixelsFromFirstValue = mousePos.Y - mouseDownOffsetFromThumbCenter; } if (oldValue != Value) { diff --git a/Library/ContentProviders/GCodeContentProvider.cs b/Library/ContentProviders/GCodeContentProvider.cs index 59f58231f..a88eb0c9b 100644 --- a/Library/ContentProviders/GCodeContentProvider.cs +++ b/Library/ContentProviders/GCodeContentProvider.cs @@ -54,7 +54,7 @@ namespace MatterHackers.MatterControl var graphics2D = thumbIcon.NewGraphics2D(); var center = new Vector2(width / 2.0, width / 2.0); - graphics2D.DrawString("GCode", center.x, center.y, 8 * width / 50, Justification.Center, Baseline.BoundsCenter, color: Color.White); + graphics2D.DrawString("GCode", center.X, center.Y, 8 * width / 50, Justification.Center, Baseline.BoundsCenter, color: Color.White); graphics2D.Render( new Stroke( new Ellipse(center, width / 2 - width / 12), diff --git a/Library/Providers/LibraryProviderHelpers.cs b/Library/Providers/LibraryProviderHelpers.cs index 67d743287..307921137 100644 --- a/Library/Providers/LibraryProviderHelpers.cs +++ b/Library/Providers/LibraryProviderHelpers.cs @@ -73,7 +73,7 @@ namespace MatterHackers.MatterControl.Library int height = imageBuffer.Height; bool resizeWidth = width >= height; - bool resizeRequired = (resizeWidth) ? width != expectedSize.x : height != expectedSize.y; + bool resizeRequired = (resizeWidth) ? width != expectedSize.X : height != expectedSize.Y; if (resizeRequired) { var scaledImageBuffer = ImageBuffer.CreateScaledImage(imageBuffer, targetWidth, targetHeight); diff --git a/Library/Widgets/InsertionGroup.cs b/Library/Widgets/InsertionGroup.cs index 36416d75c..13d14dd3c 100644 --- a/Library/Widgets/InsertionGroup.cs +++ b/Library/Widgets/InsertionGroup.cs @@ -64,7 +64,7 @@ namespace MatterHackers.MatterControl.PrintLibrary this.scene = scene; this.view3DWidget = view3DWidget; - Task.Run(async () => + Task.Run((Func)(async () => { var newItemOffset = Vector2.Zero; if (!dragOperationActive()) @@ -93,7 +93,7 @@ namespace MatterHackers.MatterControl.PrintLibrary var progressControl = new DragDropLoadProgress(view3DWidget, null); // Position at accumulating offset - placeholderItem.Matrix *= Matrix4X4.CreateTranslation(newItemOffset.x, newItemOffset.y, 0); + placeholderItem.Matrix *= Matrix4X4.CreateTranslation(newItemOffset.X, (double)newItemOffset.Y, 0); placeholderItem.Visible = true; progressControl.TrackingObject = placeholderItem; @@ -111,7 +111,7 @@ namespace MatterHackers.MatterControl.PrintLibrary placeholderItem.Visible = false; // Copy scale/rotation/translation from the source and Center - loadedItem.Matrix = loadedItem.Matrix * Matrix4X4.CreateTranslation((double)-aabb.Center.x, (double)-aabb.Center.y, (double)-aabb.minXYZ.z) * placeholderItem.Matrix; + loadedItem.Matrix = loadedItem.Matrix * Matrix4X4.CreateTranslation((double)-aabb.Center.X, (double)-aabb.Center.Y, (double)-aabb.minXYZ.Z) * placeholderItem.Matrix; loadedItem.Color = loadedItem.Color; // Notification should force invalidate and redraw @@ -123,7 +123,7 @@ namespace MatterHackers.MatterControl.PrintLibrary // Adjust next item position // TODO: do something more interesting than increment in x - newItemOffset.x = loadedItem.GetAxisAlignedBoundingBox(Matrix4X4.Identity).XSize/2 + 10; + newItemOffset.X = loadedItem.GetAxisAlignedBoundingBox(Matrix4X4.Identity).XSize/2 + 10; } progressControl.ProgressReporter(1.3, ""); @@ -141,7 +141,7 @@ namespace MatterHackers.MatterControl.PrintLibrary } this.Invalidate(); - }); + })); } /// diff --git a/Library/Widgets/ListView/ListView.cs b/Library/Widgets/ListView/ListView.cs index 7d2eb7e75..6525b720d 100644 --- a/Library/Widgets/ListView/ListView.cs +++ b/Library/Widgets/ListView/ListView.cs @@ -306,7 +306,7 @@ namespace MatterHackers.MatterControl.CustomWidgets private void listViewItem_DoubleClick(object sender, MouseEventArgs e) { - UiThread.RunOnIdle(async () => + UiThread.RunOnIdle((Action)(async () => { var listViewItem = sender as ListViewItem; var itemModel = listViewItem.Model; @@ -346,17 +346,17 @@ namespace MatterHackers.MatterControl.CustomWidgets var aabb = injector.GetAxisAlignedBoundingBox(Matrix4X4.Identity); // Remove position - injector.Matrix *= Matrix4X4.CreateTranslation(new Vector3(-aabb.minXYZ.x, -aabb.minXYZ.y, 0)); + injector.Matrix *= Matrix4X4.CreateTranslation(new Vector3(-aabb.minXYZ.X, -aabb.minXYZ.Y, 0)); // Recenter - injector.Matrix *= Matrix4X4.CreateTranslation(new Vector3(bedCenter.x - aabb.XSize / 2, bedCenter.y - aabb.YSize / 2, 0)); + injector.Matrix *= Matrix4X4.CreateTranslation(new Vector3(bedCenter.X - aabb.XSize / 2, (double)(bedCenter.Y - aabb.YSize / 2), 0)); // Move again after content loaded PlatingHelper.MoveToOpenPosition(injector, sceneChildren); }; // Move to bed center - (before we know the bounds of the content to load) - injector.Matrix *= Matrix4X4.CreateTranslation(new Vector3(bedCenter.x, bedCenter.y, 0)); + injector.Matrix *= Matrix4X4.CreateTranslation(new Vector3(bedCenter.X, (double)bedCenter.Y, 0)); scene.Children.Add(injector); @@ -364,7 +364,7 @@ namespace MatterHackers.MatterControl.CustomWidgets } } } - }); + })); } public void LoadContainer(ILibraryContainer temp) diff --git a/MatterControl.OpenGL/GCodeRenderer/ColorVertexData.cs b/MatterControl.OpenGL/GCodeRenderer/ColorVertexData.cs index f1c1417ca..1d49089c2 100644 --- a/MatterControl.OpenGL/GCodeRenderer/ColorVertexData.cs +++ b/MatterControl.OpenGL/GCodeRenderer/ColorVertexData.cs @@ -59,13 +59,13 @@ namespace MatterHackers.GCodeVisualizer b = (byte)color.Blue0To255; a = (byte)color.Alpha0To255; - normalX = (float)normal.x; - normalY = (float)normal.y; - normalZ = (float)normal.z; + normalX = (float)normal.X; + normalY = (float)normal.Y; + normalZ = (float)normal.Z; - positionX = (float)position.x; - positionY = (float)position.y; - positionZ = (float)position.z; + positionX = (float)position.X; + positionY = (float)position.Y; + positionZ = (float)position.Z; } } } \ No newline at end of file diff --git a/MatterControl.OpenGL/GCodeRenderer/RenderFeatures/RenderFeatureTravel.cs b/MatterControl.OpenGL/GCodeRenderer/RenderFeatures/RenderFeatureTravel.cs index 329241e99..54988d150 100644 --- a/MatterControl.OpenGL/GCodeRenderer/RenderFeatures/RenderFeatureTravel.cs +++ b/MatterControl.OpenGL/GCodeRenderer/RenderFeatures/RenderFeatureTravel.cs @@ -46,8 +46,8 @@ namespace MatterHackers.GCodeVisualizer { Vector3Float start = this.start; Vector2 offset = renderInfo.GetExtruderOffset(extruderIndex); - start.x += (float)offset.x; - start.y += (float)offset.y; + start.x += (float)offset.X; + start.y += (float)offset.Y; return start; } @@ -60,8 +60,8 @@ namespace MatterHackers.GCodeVisualizer { Vector3Float end = this.end; Vector2 offset = renderInfo.GetExtruderOffset(extruderIndex); - end.x += (float)offset.x; - end.y += (float)offset.y; + end.x += (float)offset.X; + end.y += (float)offset.Y; return end; } diff --git a/MatterControl.Printing/GCode/GCodeFile.cs b/MatterControl.Printing/GCode/GCodeFile.cs index 6471d72b2..28703b070 100644 --- a/MatterControl.Printing/GCode/GCodeFile.cs +++ b/MatterControl.Printing/GCode/GCodeFile.cs @@ -211,10 +211,10 @@ namespace MatterHackers.GCodeVisualizer protected static double GetSecondsThisLine(Vector3 deltaPositionThisLine, double deltaEPositionThisLine, double feedRateMmPerMin) { - double startingVelocityMmPerS = VelocitySameAsStopMmPerS.x; - double endingVelocityMmPerS = VelocitySameAsStopMmPerS.x; - double maxVelocityMmPerS = Math.Min(feedRateMmPerMin / 60, MaxVelocityMmPerS.x); - double acceleration = MaxAccelerationMmPerS2.x; + double startingVelocityMmPerS = VelocitySameAsStopMmPerS.X; + double endingVelocityMmPerS = VelocitySameAsStopMmPerS.X; + double maxVelocityMmPerS = Math.Min(feedRateMmPerMin / 60, MaxVelocityMmPerS.X); + double acceleration = MaxAccelerationMmPerS2.X; double lengthOfThisMoveMm = Math.Max(deltaPositionThisLine.Length, deltaEPositionThisLine); double distanceToMaxVelocity = GetDistanceToReachEndingVelocity(startingVelocityMmPerS, maxVelocityMmPerS, acceleration); diff --git a/MatterControl.Printing/GCode/GCodeFileStreamed.cs b/MatterControl.Printing/GCode/GCodeFileStreamed.cs index e51e1c2cf..bd7d203b1 100644 --- a/MatterControl.Printing/GCode/GCodeFileStreamed.cs +++ b/MatterControl.Printing/GCode/GCodeFileStreamed.cs @@ -239,9 +239,9 @@ namespace MatterHackers.GCodeVisualizer } Vector3 attemptedDestination = lastPrinterPosition; - GetFirstNumberAfter("X", lineToParse, ref attemptedDestination.x); - GetFirstNumberAfter("Y", lineToParse, ref attemptedDestination.y); - GetFirstNumberAfter("Z", lineToParse, ref attemptedDestination.z); + GetFirstNumberAfter("X", lineToParse, ref attemptedDestination.X); + GetFirstNumberAfter("Y", lineToParse, ref attemptedDestination.Y); + GetFirstNumberAfter("Z", lineToParse, ref attemptedDestination.Z); double ePosition = lastEPosition; GetFirstNumberAfter("E", lineToParse, ref ePosition); diff --git a/MatterControl.Printing/GCode/GCodeMemoryFile.cs b/MatterControl.Printing/GCode/GCodeMemoryFile.cs index 8d0ff995c..a7e7a9c15 100644 --- a/MatterControl.Printing/GCode/GCodeMemoryFile.cs +++ b/MatterControl.Printing/GCode/GCodeMemoryFile.cs @@ -305,9 +305,9 @@ namespace MatterHackers.GCodeVisualizer } Vector3 attemptedDestination = lastPrinterPosition; - GetFirstNumberAfter("X", lineToParse, ref attemptedDestination.x); - GetFirstNumberAfter("Y", lineToParse, ref attemptedDestination.y); - GetFirstNumberAfter("Z", lineToParse, ref attemptedDestination.z); + GetFirstNumberAfter("X", lineToParse, ref attemptedDestination.X); + GetFirstNumberAfter("Y", lineToParse, ref attemptedDestination.Y); + GetFirstNumberAfter("Z", lineToParse, ref attemptedDestination.Z); double ePosition = lastEPosition; GetFirstNumberAfter("E", lineToParse, ref ePosition); @@ -625,7 +625,7 @@ namespace MatterHackers.GCodeVisualizer indexOfChangeInZ.Add(GCodeCommandQueue.Count); } } - parsingLastZ = processingMachineState.Position.z; + parsingLastZ = processingMachineState.Position.Z; break; case "10": // firmware retract @@ -701,13 +701,13 @@ namespace MatterHackers.GCodeVisualizer (int index, ParallelLoopState loop, Vector2 subtotal) => { PrinterMachineInstruction state = GCodeCommandQueue[index]; - subtotal += new Vector2(state.Position.x, state.Position.y); + subtotal += new Vector2(state.Position.X, state.Position.Y); return subtotal; }, - (x) => +(Action)((x) => { - total += new Vector2(x.x, x.y); - } + total += new Vector2(x.X, (double)x.Y); + }) ); #endif @@ -733,10 +733,10 @@ namespace MatterHackers.GCodeVisualizer (int index, ParallelLoopState loop, RectangleDouble subtotal) => { PrinterMachineInstruction state = GCodeCommandQueue[index]; - subtotal.Left = Math.Min(state.Position.x, subtotal.Left); - subtotal.Right = Math.Max(state.Position.x, subtotal.Right); - subtotal.Bottom = Math.Min(state.Position.y, subtotal.Bottom); - subtotal.Top = Math.Max(state.Position.y, subtotal.Top); + subtotal.Left = Math.Min(state.Position.X, subtotal.Left); + subtotal.Right = Math.Max(state.Position.X, subtotal.Right); + subtotal.Bottom = Math.Min(state.Position.Y, subtotal.Bottom); + subtotal.Top = Math.Max(state.Position.Y, subtotal.Top); return subtotal; }, diff --git a/MatterControlApplication.cs b/MatterControlApplication.cs index ac9b9d0e7..079072212 100644 --- a/MatterControlApplication.cs +++ b/MatterControlApplication.cs @@ -336,8 +336,8 @@ namespace MatterHackers.MatterControl // try and open our window matching the last size that we had for it. string[] sizes = windowSize.Split(','); - width = Math.Max(int.Parse(sizes[0]), (int)minSize.x + 1); - height = Math.Max(int.Parse(sizes[1]), (int)minSize.y + 1); + width = Math.Max(int.Parse(sizes[0]), (int)minSize.X + 1); + height = Math.Max(int.Parse(sizes[1]), (int)minSize.Y + 1); } else // try to set it to a big size or the min size { diff --git a/PartPreviewWindow/GCode2DWidget.cs b/PartPreviewWindow/GCode2DWidget.cs index daf62e94e..31deebacd 100644 --- a/PartPreviewWindow/GCode2DWidget.cs +++ b/PartPreviewWindow/GCode2DWidget.cs @@ -207,23 +207,23 @@ namespace MatterHackers.MatterControl.PartPreviewWindow GL.Begin(BeginMode.Triangles); Vector2 gridOffset = gridCenterMm - gridSizeMm / 2; - if (gridSizeMm.x > 0 && gridSizeMm.y > 0) + if (gridSizeMm.X > 0 && gridSizeMm.Y > 0) { grid.remove_all(); - for (int y = 0; y <= gridSizeMm.y; y += 10) + for (int y = 0; y <= gridSizeMm.Y; y += 10) { Vector2 start = new Vector2(0, y) + gridOffset; - Vector2 end = new Vector2(gridSizeMm.x, y) + gridOffset; + Vector2 end = new Vector2(gridSizeMm.X, y) + gridOffset; transform.transform(ref start); transform.transform(ref end); graphics2DGl.DrawAALine(start, end, width, gridColor); } - for (int x = 0; x <= gridSizeMm.x; x += 10) + for (int x = 0; x <= gridSizeMm.X; x += 10) { Vector2 start = new Vector2(x, 0) + gridOffset; - Vector2 end = new Vector2(x, gridSizeMm.y) + gridOffset; + Vector2 end = new Vector2(x, gridSizeMm.Y) + gridOffset; transform.transform(ref start); transform.transform(ref end); @@ -238,27 +238,27 @@ namespace MatterHackers.MatterControl.PartPreviewWindow public void CreateGrid(Affine transform) { Vector2 gridOffset = gridCenterMm - gridSizeMm / 2; - if (gridSizeMm.x > 0 && gridSizeMm.y > 0) + if (gridSizeMm.X > 0 && gridSizeMm.Y > 0) { grid.remove_all(); - for (int y = 0; y <= gridSizeMm.y; y += 10) + for (int y = 0; y <= gridSizeMm.Y; y += 10) { Vector2 start = new Vector2(0, y) + gridOffset; - Vector2 end = new Vector2(gridSizeMm.x, y) + gridOffset; + Vector2 end = new Vector2(gridSizeMm.X, y) + gridOffset; transform.transform(ref start); transform.transform(ref end); - grid.MoveTo(Math.Round(start.x), Math.Round(start.y)); - grid.LineTo(Math.Round(end.x), Math.Round(end.y)); + grid.MoveTo(Math.Round(start.X), Math.Round(start.Y)); + grid.LineTo(Math.Round(end.X), Math.Round(end.Y)); } - for (int x = 0; x <= gridSizeMm.x; x += 10) + for (int x = 0; x <= gridSizeMm.X; x += 10) { Vector2 start = new Vector2(x, 0) + gridOffset; - Vector2 end = new Vector2(x, gridSizeMm.y) + gridOffset; + Vector2 end = new Vector2(x, gridSizeMm.Y) + gridOffset; transform.transform(ref start); transform.transform(ref end); - grid.MoveTo((int)(start.x + .5) + .5, (int)(start.y + .5)); - grid.LineTo((int)(end.x + .5) + .5, (int)(end.y + .5)); + grid.MoveTo((int)(start.X + .5) + .5, (int)(start.Y + .5)); + grid.LineTo((int)(end.X + .5) + .5, (int)(end.Y + .5)); } } } @@ -272,8 +272,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { if (mouseEvent.NumPositions == 1) { - mouseDownPosition.x = mouseEvent.X; - mouseDownPosition.y = mouseEvent.Y; + mouseDownPosition.X = mouseEvent.X; + mouseDownPosition.Y = mouseEvent.Y; } else { @@ -344,13 +344,13 @@ namespace MatterHackers.MatterControl.PartPreviewWindow case ETransformState.Scale: double zoomDelta = 1; - if (mouseDelta.y < 0) + if (mouseDelta.Y < 0) { - zoomDelta = 1 - (-1 * mouseDelta.y / 100); + zoomDelta = 1 - (-1 * mouseDelta.Y / 100); } - else if (mouseDelta.y > 0) + else if (mouseDelta.Y > 0) { - zoomDelta = 1 + (1 * mouseDelta.y / 100); + zoomDelta = 1 + (1 * mouseDelta.Y / 100); } Vector2 mousePreScale = mouseDownPosition; diff --git a/PartPreviewWindow/PlatingHelper.cs b/PartPreviewWindow/PlatingHelper.cs index 48d40f971..acda935b6 100644 --- a/PartPreviewWindow/PlatingHelper.cs +++ b/PartPreviewWindow/PlatingHelper.cs @@ -152,14 +152,14 @@ namespace MatterHackers.MatterControl AxisAlignedBoundingBox bounds = object3D.GetAxisAlignedBoundingBox(Matrix4X4.Identity, true); Vector3 boundsCenter = (bounds.maxXYZ + bounds.minXYZ) / 2; - object3D.Matrix *= Matrix4X4.CreateTranslation(new Vector3(0, 0, -boundsCenter.z + bounds.ZSize / 2)); + object3D.Matrix *= Matrix4X4.CreateTranslation(new Vector3(0, 0, -boundsCenter.Z + bounds.ZSize / 2)); } public static void PlaceMeshAtHeight(IObject3D objectToMove, double zHeight) { AxisAlignedBoundingBox bounds = objectToMove.GetAxisAlignedBoundingBox(Matrix4X4.Identity); - objectToMove.Matrix *= Matrix4X4.CreateTranslation(new Vector3(0, 0, zHeight - bounds.minXYZ.z)); + objectToMove.Matrix *= Matrix4X4.CreateTranslation(new Vector3(0, 0, zHeight - bounds.minXYZ.Z)); } public static void CenterMeshGroupXY(List meshesGroupList, List meshTransforms, int index) @@ -167,7 +167,7 @@ namespace MatterHackers.MatterControl AxisAlignedBoundingBox bounds = GetAxisAlignedBoundingBox(meshesGroupList[index], meshTransforms[index]); Vector3 boundsCenter = (bounds.maxXYZ + bounds.minXYZ) / 2; - meshTransforms[index] *= Matrix4X4.CreateTranslation(new Vector3(-boundsCenter.x + bounds.XSize / 2, -boundsCenter.y + bounds.YSize / 2, 0)); + meshTransforms[index] *= Matrix4X4.CreateTranslation(new Vector3(-boundsCenter.X + bounds.XSize / 2, -boundsCenter.Y + bounds.YSize / 2, 0)); } /// diff --git a/PartPreviewWindow/PopupMenuButton.cs b/PartPreviewWindow/PopupMenuButton.cs index 269672dca..a0cd1a8f1 100644 --- a/PartPreviewWindow/PopupMenuButton.cs +++ b/PartPreviewWindow/PopupMenuButton.cs @@ -101,7 +101,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow if (this.DrawArrow) { // Draw directional arrow - graphics2D.Render(dropArrow, LocalBounds.Right - DropArrow.ArrowHeight * 2 - 2, LocalBounds.Center.y + DropArrow.ArrowHeight / 2, ActiveTheme.Instance.SecondaryTextColor); + graphics2D.Render(dropArrow, LocalBounds.Right - DropArrow.ArrowHeight * 2 - 2, LocalBounds.Center.Y + DropArrow.ArrowHeight / 2, ActiveTheme.Instance.SecondaryTextColor); } } diff --git a/PartPreviewWindow/PrinterTabPage.cs b/PartPreviewWindow/PrinterTabPage.cs index c3d3134ed..0991973fc 100644 --- a/PartPreviewWindow/PrinterTabPage.cs +++ b/PartPreviewWindow/PrinterTabPage.cs @@ -278,7 +278,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow var viewerVolume = sceneContext.ViewerVolume; // Create and append new widget - gcode2DWidget = new GCode2DWidget(new Vector2(viewerVolume.x, viewerVolume.y), sceneContext.BedCenter) + gcode2DWidget = new GCode2DWidget(new Vector2(viewerVolume.X, viewerVolume.Y), sceneContext.BedCenter) { Visible = (this.ViewMode == PartViewMode.Layers2D) }; @@ -350,8 +350,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow allBounds += aabb; } - bool onBed = allBounds.minXYZ.z > -.001 && allBounds.minXYZ.z < .001; // really close to the bed - RectangleDouble bedRect = new RectangleDouble(0, 0, printer.Settings.GetValue(SettingsKey.bed_size).x, printer.Settings.GetValue(SettingsKey.bed_size).y); + bool onBed = allBounds.minXYZ.Z > -.001 && allBounds.minXYZ.Z < .001; // really close to the bed + RectangleDouble bedRect = new RectangleDouble(0, 0, printer.Settings.GetValue(SettingsKey.bed_size).X, printer.Settings.GetValue(SettingsKey.bed_size).Y); bedRect.Offset(printer.Settings.GetValue(SettingsKey.print_center) - printer.Settings.GetValue(SettingsKey.bed_size) / 2); bool inBounds = bedRect.Contains(new Vector2(allBounds.minXYZ)) && bedRect.Contains(new Vector2(allBounds.maxXYZ)); diff --git a/PartPreviewWindow/SliceLayerSelector.cs b/PartPreviewWindow/SliceLayerSelector.cs index 6b83e1b4b..0bce9eea3 100644 --- a/PartPreviewWindow/SliceLayerSelector.cs +++ b/PartPreviewWindow/SliceLayerSelector.cs @@ -96,12 +96,12 @@ namespace MatterHackers.MatterControl.PartPreviewWindow private void SetPositionAndValue(object sender, EventArgs e) { - UiThread.RunOnIdle(() => + UiThread.RunOnIdle((Action)(() => { currentLayerInfo.Value = sceneContext.ActiveLayerIndex; - currentLayerInfo.Position = new Vector2(0, layerSlider.Position.y + layerSlider.PositionPixelsFromFirstValue - 3); + currentLayerInfo.Position = new Vector2(0, (double)(layerSlider.Position.Y + layerSlider.PositionPixelsFromFirstValue - 3)); currentLayerInfo.Visible = true; - }); + })); } private class LayerScrollbar : FlowLayoutWidget diff --git a/PartPreviewWindow/View3D/BedMeshGenerator.cs b/PartPreviewWindow/View3D/BedMeshGenerator.cs index eb2a17ad9..7fefb8f2b 100644 --- a/PartPreviewWindow/View3D/BedMeshGenerator.cs +++ b/PartPreviewWindow/View3D/BedMeshGenerator.cs @@ -54,7 +54,7 @@ namespace MatterHackers.MatterControl Vector3 displayVolumeToBuild = Vector3.ComponentMax(printer.Bed.ViewerVolume, new Vector3(1, 1, 1)); - double sizeForMarking = Math.Max(displayVolumeToBuild.x, displayVolumeToBuild.y); + double sizeForMarking = Math.Max(displayVolumeToBuild.X, displayVolumeToBuild.Y); double divisor = 10; int skip = 1; if (sizeForMarking > 1000) @@ -73,12 +73,12 @@ namespace MatterHackers.MatterControl switch (printer.Bed.BedShape) { case BedShape.Rectangular: - if (displayVolumeToBuild.z > 0) + if (displayVolumeToBuild.Z > 0) { buildVolume = PlatonicSolids.CreateCube(displayVolumeToBuild); foreach (Vertex vertex in buildVolume.Vertices) { - vertex.Position = vertex.Position + new Vector3(0, 0, displayVolumeToBuild.z / 2); + vertex.Position = vertex.Position + new Vector3(0, 0, displayVolumeToBuild.Z / 2); } } @@ -86,7 +86,7 @@ namespace MatterHackers.MatterControl ApplyOemBedImage(bedplateImage); - printerBed = PlatonicSolids.CreateCube(displayVolumeToBuild.x, displayVolumeToBuild.y, 1.8); + printerBed = PlatonicSolids.CreateCube(displayVolumeToBuild.X, displayVolumeToBuild.Y, 1.8); { Face face = printerBed.Faces[0]; MeshHelper.PlaceTextureOnFace(face, bedplateImage); @@ -95,30 +95,30 @@ namespace MatterHackers.MatterControl case BedShape.Circular: { - if (displayVolumeToBuild.z > 0) + if (displayVolumeToBuild.Z > 0) { - buildVolume = VertexSourceToMesh.Extrude(new Ellipse(new Vector2(), displayVolumeToBuild.x / 2, displayVolumeToBuild.y / 2), displayVolumeToBuild.z); + buildVolume = VertexSourceToMesh.Extrude(new Ellipse(new Vector2(), displayVolumeToBuild.X / 2, displayVolumeToBuild.Y / 2), displayVolumeToBuild.Z); foreach (Vertex vertex in buildVolume.Vertices) { vertex.Position = vertex.Position + new Vector3(0, 0, .2); } } - bedplateImage = CreateCircularBedGridImage((int)(displayVolumeToBuild.x / divisor), (int)(displayVolumeToBuild.y / divisor), skip); + bedplateImage = CreateCircularBedGridImage((int)(displayVolumeToBuild.X / divisor), (int)(displayVolumeToBuild.Y / divisor), skip); ApplyOemBedImage(bedplateImage); - printerBed = VertexSourceToMesh.Extrude(new Ellipse(new Vector2(), displayVolumeToBuild.x / 2, displayVolumeToBuild.y / 2), 1.8); + printerBed = VertexSourceToMesh.Extrude(new Ellipse(new Vector2(), displayVolumeToBuild.X / 2, displayVolumeToBuild.Y / 2), 1.8); { foreach (Face face in printerBed.Faces) { - if (face.Normal.z > 0) + if (face.Normal.Z > 0) { face.SetTexture(0, bedplateImage); foreach (FaceEdge faceEdge in face.FaceEdges()) { - faceEdge.SetUv(0, new Vector2((displayVolumeToBuild.x / 2 + faceEdge.FirstVertex.Position.x) / displayVolumeToBuild.x, - (displayVolumeToBuild.y / 2 + faceEdge.FirstVertex.Position.y) / displayVolumeToBuild.y)); + faceEdge.SetUv(0, new Vector2((displayVolumeToBuild.X / 2 + faceEdge.FirstVertex.Position.X) / displayVolumeToBuild.X, + (displayVolumeToBuild.Y / 2 + faceEdge.FirstVertex.Position.Y) / displayVolumeToBuild.Y)); } } } @@ -130,7 +130,7 @@ namespace MatterHackers.MatterControl throw new NotImplementedException(); } - var zTop = printerBed.GetAxisAlignedBoundingBox().maxXYZ.z; + var zTop = printerBed.GetAxisAlignedBoundingBox().maxXYZ.Z; foreach (Vertex vertex in printerBed.Vertices) { vertex.Position = vertex.Position - new Vector3(-printer.Bed.BedCenter, zTop + .02); @@ -188,9 +188,9 @@ namespace MatterHackers.MatterControl graphics2D.Clear(bedBaseColor); { - double lineDist = bedplateImage.Width / (displayVolumeToBuild.x / divisor); + double lineDist = bedplateImage.Width / (displayVolumeToBuild.X / divisor); - double xPositionCm = (-(printer.Bed.ViewerVolume.x / 2.0) + printer.Bed.BedCenter.x) / divisor; + double xPositionCm = (-(printer.Bed.ViewerVolume.X / 2.0) + printer.Bed.BedCenter.X) / divisor; int xPositionCmInt = (int)Math.Round(xPositionCm); double fraction = xPositionCm - xPositionCmInt; int pointSize = 20; @@ -210,9 +210,9 @@ namespace MatterHackers.MatterControl } { - double lineDist = bedplateImage.Height / (displayVolumeToBuild.y / divisor); + double lineDist = bedplateImage.Height / (displayVolumeToBuild.Y / divisor); - double yPositionCm = (-(printer.Bed.ViewerVolume.y / 2.0) + printer.Bed.BedCenter.y) / divisor; + double yPositionCm = (-(printer.Bed.ViewerVolume.Y / 2.0) + printer.Bed.BedCenter.Y) / divisor; int yPositionCmInt = (int)Math.Round(yPositionCm); double fraction = yPositionCm - yPositionCmInt; int pointSize = 20; diff --git a/PartPreviewWindow/View3D/DebugBvh.cs b/PartPreviewWindow/View3D/DebugBvh.cs index b6c510859..97102d9ad 100644 --- a/PartPreviewWindow/View3D/DebugBvh.cs +++ b/PartPreviewWindow/View3D/DebugBvh.cs @@ -99,20 +99,20 @@ namespace MatterHackers.MatterControl.PartPreviewWindow // the sides RenderLine(transform.Peek(), - new Vector3(aabb.minXYZ.x, aabb.minXYZ.y, aabb.minXYZ.z), - new Vector3(aabb.minXYZ.x, aabb.minXYZ.y, aabb.maxXYZ.z), + new Vector3(aabb.minXYZ.X, aabb.minXYZ.Y, aabb.minXYZ.Z), + new Vector3(aabb.minXYZ.X, aabb.minXYZ.Y, aabb.maxXYZ.Z), color); RenderLine(transform.Peek(), - new Vector3(aabb.maxXYZ.x, aabb.minXYZ.y, aabb.minXYZ.z), - new Vector3(aabb.maxXYZ.x, aabb.minXYZ.y, aabb.maxXYZ.z), + new Vector3(aabb.maxXYZ.X, aabb.minXYZ.Y, aabb.minXYZ.Z), + new Vector3(aabb.maxXYZ.X, aabb.minXYZ.Y, aabb.maxXYZ.Z), color); RenderLine(transform.Peek(), - new Vector3(aabb.minXYZ.x, aabb.maxXYZ.y, aabb.minXYZ.z), - new Vector3(aabb.minXYZ.x, aabb.maxXYZ.y, aabb.maxXYZ.z), + new Vector3(aabb.minXYZ.X, aabb.maxXYZ.Y, aabb.minXYZ.Z), + new Vector3(aabb.minXYZ.X, aabb.maxXYZ.Y, aabb.maxXYZ.Z), color); RenderLine(transform.Peek(), - new Vector3(aabb.maxXYZ.x, aabb.maxXYZ.y, aabb.minXYZ.z), - new Vector3(aabb.maxXYZ.x, aabb.maxXYZ.y, aabb.maxXYZ.z), + new Vector3(aabb.maxXYZ.X, aabb.maxXYZ.Y, aabb.minXYZ.Z), + new Vector3(aabb.maxXYZ.X, aabb.maxXYZ.Y, aabb.maxXYZ.Z), color); } diff --git a/PartPreviewWindow/View3D/DragDropLoadProgress.cs b/PartPreviewWindow/View3D/DragDropLoadProgress.cs index 2c1984fcf..f81006221 100644 --- a/PartPreviewWindow/View3D/DragDropLoadProgress.cs +++ b/PartPreviewWindow/View3D/DragDropLoadProgress.cs @@ -67,7 +67,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow e.graphics2D.PushTransform(); Affine currentGraphics2DTransform = e.graphics2D.GetTransform(); - Affine accumulatedTransform = currentGraphics2DTransform * Affine.NewTranslation(cornerScreenSpace.x, cornerScreenSpace.y); + Affine accumulatedTransform = currentGraphics2DTransform * Affine.NewTranslation(cornerScreenSpace.X, cornerScreenSpace.Y); e.graphics2D.SetTransform(accumulatedTransform); progressBar.OnDraw(e.graphics2D); diff --git a/PartPreviewWindow/View3D/Gui3D/MoveInZControl.cs b/PartPreviewWindow/View3D/Gui3D/MoveInZControl.cs index d61800322..be5d4d457 100644 --- a/PartPreviewWindow/View3D/Gui3D/MoveInZControl.cs +++ b/PartPreviewWindow/View3D/Gui3D/MoveInZControl.cs @@ -120,7 +120,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow } AxisAlignedBoundingBox originalSelectedBounds = selectedItem.GetAxisAlignedBoundingBox(Matrix4X4.Identity); - var moveAmount = newZPosition - originalSelectedBounds.minXYZ.z; + var moveAmount = newZPosition - originalSelectedBounds.minXYZ.Z; if (moveAmount != 0) { @@ -177,9 +177,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow public Vector3 GetTopPosition(IObject3D selectedItem) { AxisAlignedBoundingBox originalSelectedBounds = selectedItem.GetAxisAlignedBoundingBox(Matrix4X4.Identity); - if (originalSelectedBounds.minXYZ.x != double.PositiveInfinity) + if (originalSelectedBounds.minXYZ.X != double.PositiveInfinity) { - return new Vector3(originalSelectedBounds.Center.x, originalSelectedBounds.Center.y, originalSelectedBounds.maxXYZ.z); + return new Vector3(originalSelectedBounds.Center.X, originalSelectedBounds.Center.Y, originalSelectedBounds.maxXYZ.Z); } return Vector3.Zero; @@ -227,9 +227,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { var selectedItem = InteractionContext.Scene.SelectedItem; - var delta = info.HitPosition.z - initialHitPosition.z; + var delta = info.HitPosition.Z - initialHitPosition.Z; - double newZPosition = mouseDownSelectedBounds.minXYZ.z + delta; + double newZPosition = mouseDownSelectedBounds.minXYZ.Z + delta; if (InteractionContext.SnapGridDistance > 0) { @@ -241,7 +241,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow } AxisAlignedBoundingBox originalSelectedBounds = selectedItem.GetAxisAlignedBoundingBox(Matrix4X4.Identity); - var moveAmount = newZPosition - originalSelectedBounds.minXYZ.z; + var moveAmount = newZPosition - originalSelectedBounds.minXYZ.Z; if (moveAmount != 0) { @@ -265,11 +265,11 @@ namespace MatterHackers.MatterControl.PartPreviewWindow AxisAlignedBoundingBox selectedBounds = selectedItem.GetAxisAlignedBoundingBox(Matrix4X4.Identity); Vector3 topPosition = GetTopPosition(selectedItem); - Vector3 bottomPosition = new Vector3(topPosition.x, topPosition.y, selectedBounds.minXYZ.z); + Vector3 bottomPosition = new Vector3(topPosition.X, topPosition.Y, selectedBounds.minXYZ.Z); double distBetweenPixelsWorldSpace = InteractionContext.World.GetWorldUnitsPerScreenPixelAtPosition(topPosition); Vector3 boxCenter = topPosition; - boxCenter.z += (10 + upArrowSize / 2) * distBetweenPixelsWorldSpace; + boxCenter.Z += (10 + upArrowSize / 2) * distBetweenPixelsWorldSpace; Matrix4X4 centerMatrix = Matrix4X4.CreateTranslation(boxCenter); centerMatrix = Matrix4X4.CreateScale(distBetweenPixelsWorldSpace) * centerMatrix; @@ -278,12 +278,12 @@ namespace MatterHackers.MatterControl.PartPreviewWindow lines.Clear(); // left lines // the lines on the bed - var bedPosition = new Vector3(topPosition.x, topPosition.y, 0); + var bedPosition = new Vector3(topPosition.X, topPosition.Y, 0); lines.Add(InteractionContext.World.GetScreenPosition(bedPosition + new Vector3(distToStart * distBetweenPixelsWorldSpace, 0, 0))); - lines.Add(new Vector2(lines[0].x + lineLength, lines[0].y)); + lines.Add(new Vector2(lines[0].X + lineLength, lines[0].Y)); lines.Add(InteractionContext.World.GetScreenPosition(bottomPosition + new Vector3(distToStart * distBetweenPixelsWorldSpace, 0, 0))); - lines.Add(new Vector2(lines[2].x + lineLength, lines[2].y)); + lines.Add(new Vector2(lines[2].X + lineLength, lines[2].Y)); } private void InteractionLayer_AfterDraw(object sender, DrawEventArgs drawEvent) @@ -307,8 +307,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow AxisAlignedBoundingBox selectedBounds = selectedItem.GetAxisAlignedBoundingBox(Matrix4X4.Identity); - zHeightDisplayInfo.Value = selectedBounds.minXYZ.z; - zHeightDisplayInfo.OriginRelativeParent = lines[1] + new Vector2(10, - zHeightDisplayInfo.LocalBounds.Center.y); + zHeightDisplayInfo.Value = selectedBounds.minXYZ.Z; + zHeightDisplayInfo.OriginRelativeParent = lines[1] + new Vector2(10, - zHeightDisplayInfo.LocalBounds.Center.Y); } } } diff --git a/PartPreviewWindow/View3D/Gui3D/SelectionShadow.cs b/PartPreviewWindow/View3D/Gui3D/SelectionShadow.cs index 8f0f90bb4..f63f83f49 100644 --- a/PartPreviewWindow/View3D/Gui3D/SelectionShadow.cs +++ b/PartPreviewWindow/View3D/Gui3D/SelectionShadow.cs @@ -62,7 +62,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow AxisAlignedBoundingBox selectedBounds = selectedItem.GetAxisAlignedBoundingBox(Matrix4X4.Identity); Vector3 boundsCenter = selectedBounds.Center; - TotalTransform = Matrix4X4.CreateTranslation(new Vector3(boundsCenter.x, boundsCenter.y, 0.1)); + TotalTransform = Matrix4X4.CreateTranslation(new Vector3(boundsCenter.X, boundsCenter.Y, 0.1)); } Mesh GetNormalShadowMesh() diff --git a/PartPreviewWindow/View3D/Gui3D/SnapingIndicator.cs b/PartPreviewWindow/View3D/Gui3D/SnapingIndicator.cs index 657a8f899..da9a35d43 100644 --- a/PartPreviewWindow/View3D/Gui3D/SnapingIndicator.cs +++ b/PartPreviewWindow/View3D/Gui3D/SnapingIndicator.cs @@ -62,7 +62,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { case HitQuadrant.LB: { - Vector3 cornerPoint = new Vector3(selectedBounds.minXYZ.x, selectedBounds.minXYZ.y, 0); + Vector3 cornerPoint = new Vector3(selectedBounds.minXYZ.X, selectedBounds.minXYZ.Y, 0); double distBetweenPixelsWorldSpace = world.GetWorldUnitsPerScreenPixelAtPosition(cornerPoint); lines[0] = world.GetScreenPosition(cornerPoint - new Vector3(distToStart * distBetweenPixelsWorldSpace, 0, 0)); @@ -75,7 +75,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow case HitQuadrant.LT: { - Vector3 cornerPoint = new Vector3(selectedBounds.minXYZ.x, selectedBounds.maxXYZ.y, 0); + Vector3 cornerPoint = new Vector3(selectedBounds.minXYZ.X, selectedBounds.maxXYZ.Y, 0); double distBetweenPixelsWorldSpace = world.GetWorldUnitsPerScreenPixelAtPosition(cornerPoint); lines[0] = world.GetScreenPosition(cornerPoint - new Vector3(distToStart * distBetweenPixelsWorldSpace, 0, 0)); @@ -88,7 +88,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow case HitQuadrant.RB: { - Vector3 cornerPoint = new Vector3(selectedBounds.maxXYZ.x, selectedBounds.minXYZ.y, 0); + Vector3 cornerPoint = new Vector3(selectedBounds.maxXYZ.X, selectedBounds.minXYZ.Y, 0); double distBetweenPixelsWorldSpace = world.GetWorldUnitsPerScreenPixelAtPosition(cornerPoint); lines[0] = world.GetScreenPosition(cornerPoint + new Vector3(distToStart * distBetweenPixelsWorldSpace, 0, 0)); @@ -101,7 +101,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow case HitQuadrant.RT: { - Vector3 cornerPoint = new Vector3(selectedBounds.maxXYZ.x, selectedBounds.maxXYZ.y, 0); + Vector3 cornerPoint = new Vector3(selectedBounds.maxXYZ.X, selectedBounds.maxXYZ.Y, 0); double distBetweenPixelsWorldSpace = world.GetWorldUnitsPerScreenPixelAtPosition(cornerPoint); lines[0] = world.GetScreenPosition(cornerPoint + new Vector3(distToStart * distBetweenPixelsWorldSpace, 0, 0)); diff --git a/PartPreviewWindow/View3D/InteractionLayer.cs b/PartPreviewWindow/View3D/InteractionLayer.cs index 64fff21ab..a7e3b8aba 100644 --- a/PartPreviewWindow/View3D/InteractionLayer.cs +++ b/PartPreviewWindow/View3D/InteractionLayer.cs @@ -314,9 +314,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow Vector3 lightDirectionVector = new Vector3(lightDirection0[0], lightDirection0[1], lightDirection0[2]); lightDirectionVector.Normalize(); - lightDirection0[0] = (float)lightDirectionVector.x; - lightDirection0[1] = (float)lightDirectionVector.y; - lightDirection0[2] = (float)lightDirectionVector.z; + lightDirection0[0] = (float)lightDirectionVector.X; + lightDirection0[1] = (float)lightDirectionVector.Y; + lightDirection0[2] = (float)lightDirectionVector.Z; GL.Light(LightName.Light0, LightParameter.Position, lightDirection0); GL.Light(LightName.Light1, LightParameter.Position, lightDirection1); #endif diff --git a/PartPreviewWindow/View3D/InteractionVolume.cs b/PartPreviewWindow/View3D/InteractionVolume.cs index ef9361aa6..bc8fba3a2 100644 --- a/PartPreviewWindow/View3D/InteractionVolume.cs +++ b/PartPreviewWindow/View3D/InteractionVolume.cs @@ -96,14 +96,14 @@ namespace MatterHackers.MeshVisualizer arrow.LineTo(3, -5); if (arrows.HasFlag(LineArrows.End)) { - double rotation = Math.Atan2(direction.y, direction.x); + double rotation = Math.Atan2(direction.Y, direction.X); IVertexSource correctRotation = new VertexSourceApplyTransform(arrow, Affine.NewRotation(rotation - MathHelper.Tau / 4)); IVertexSource inPosition = new VertexSourceApplyTransform(correctRotation, Affine.NewTranslation(lineEnd)); graphics2D.Render(inPosition, Color.Black); } if (arrows.HasFlag(LineArrows.Start)) { - double rotation = Math.Atan2(direction.y, direction.x) + MathHelper.Tau / 2; + double rotation = Math.Atan2(direction.Y, direction.X) + MathHelper.Tau / 2; IVertexSource correctRotation = new VertexSourceApplyTransform(arrow, Affine.NewRotation(rotation - MathHelper.Tau / 4)); IVertexSource inPosition = new VertexSourceApplyTransform(correctRotation, Affine.NewTranslation(lineStart)); graphics2D.Render(inPosition, Color.Black); @@ -113,15 +113,15 @@ namespace MatterHackers.MeshVisualizer public static Vector3 SetBottomControlHeight(AxisAlignedBoundingBox originalSelectedBounds, Vector3 cornerPosition) { - if (originalSelectedBounds.minXYZ.z < 0) + if (originalSelectedBounds.minXYZ.Z < 0) { - if (originalSelectedBounds.maxXYZ.z < 0) + if (originalSelectedBounds.maxXYZ.Z < 0) { - cornerPosition.z = originalSelectedBounds.maxXYZ.z; + cornerPosition.Z = originalSelectedBounds.maxXYZ.Z; } else { - cornerPosition.z = 0; + cornerPosition.Z = 0; } } diff --git a/PartPreviewWindow/View3D/MeshViewerWidget.cs b/PartPreviewWindow/View3D/MeshViewerWidget.cs index 4ca283309..1df0f394c 100644 --- a/PartPreviewWindow/View3D/MeshViewerWidget.cs +++ b/PartPreviewWindow/View3D/MeshViewerWidget.cs @@ -201,7 +201,7 @@ namespace MatterHackers.MeshVisualizer { Vector3 renderPosition = bounds.Center; Vector2 objectCenterScreenSpace = this.World.GetScreenPosition(renderPosition); - Point2D screenPositionOfObject3D = new Point2D((int)objectCenterScreenSpace.x, (int)objectCenterScreenSpace.y); + Point2D screenPositionOfObject3D = new Point2D((int)objectCenterScreenSpace.X, (int)objectCenterScreenSpace.Y); foundChildren.Add(new WidgetAndPosition(this, screenPositionOfObject3D, object3DName, child)); } @@ -249,7 +249,7 @@ namespace MatterHackers.MeshVisualizer { Vector3 renderPosition = bounds.Center; Vector2 objectCenterScreenSpace = this.World.GetScreenPosition(renderPosition); - Point2D screenPositionOfObject3D = new Point2D((int)objectCenterScreenSpace.x, (int)objectCenterScreenSpace.y); + Point2D screenPositionOfObject3D = new Point2D((int)objectCenterScreenSpace.X, (int)objectCenterScreenSpace.Y); foundChildren.Add(new WidgetAndPosition(this, screenPositionOfObject3D, object3DName, child)); } @@ -550,11 +550,11 @@ namespace MatterHackers.MeshVisualizer private int BackToFrontXY(IObject3D a, IObject3D b) { var aCenterWorld = Vector3.Transform(a.Mesh.GetAxisAlignedBoundingBox().Center, a.Matrix); - aCenterWorld.z = 0; // we only want to look at the distance on xy in world space + aCenterWorld.Z = 0; // we only want to look at the distance on xy in world space var aCenterInViewSpace = Vector3.Transform(aCenterWorld, World.ModelviewMatrix); var bCenterWorld = Vector3.Transform(b.Mesh.GetAxisAlignedBoundingBox().Center, b.Matrix); - bCenterWorld.z = 0; // we only want to look at the distance on xy in world space + bCenterWorld.Z = 0; // we only want to look at the distance on xy in world space var bCenterInViewSpace = Vector3.Transform(bCenterWorld, World.ModelviewMatrix); return bCenterInViewSpace.LengthSquared.CompareTo(aCenterInViewSpace.LengthSquared); diff --git a/PartPreviewWindow/View3D/SceneActions.cs b/PartPreviewWindow/View3D/SceneActions.cs index ab747da67..7089ab38d 100644 --- a/PartPreviewWindow/View3D/SceneActions.cs +++ b/PartPreviewWindow/View3D/SceneActions.cs @@ -184,9 +184,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow var center = aabb.Center; newItem.Matrix *= Matrix4X4.CreateTranslation( - (printer.Bed.BedCenter.x + center.x), - (printer.Bed.BedCenter.y + center.y), - -aabb.minXYZ.z); + (printer.Bed.BedCenter.X + center.X), + (printer.Bed.BedCenter.Y + center.Y), + -aabb.minXYZ.Z); } // Create and perform a new insert operation diff --git a/PartPreviewWindow/View3D/View3DWidget.cs b/PartPreviewWindow/View3D/View3DWidget.cs index 5ef86f18c..035122121 100644 --- a/PartPreviewWindow/View3D/View3DWidget.cs +++ b/PartPreviewWindow/View3D/View3DWidget.cs @@ -581,7 +581,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow drawCenter - new Vector3(0, 50, 0), drawColor, zBuffer, 2); drawColor = Color.Black; - drawCenter.z = 0; + drawCenter.Z = 0; zBuffer = true; } } @@ -894,7 +894,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow var sourceItemBounds = DragDropObject.GetAxisAlignedBoundingBox(Matrix4X4.Identity); var center = sourceItemBounds.Center; - this.DragDropObject.Matrix *= Matrix4X4.CreateTranslation(-center.x, -center.y, -sourceItemBounds.minXYZ.z); + this.DragDropObject.Matrix *= Matrix4X4.CreateTranslation(-center.X, -center.Y, -sourceItemBounds.minXYZ.Z); this.DragDropObject.Matrix *= Matrix4X4.CreateTranslation(new Vector3(intersectInfo.HitPosition)); CurrentSelectInfo.PlaneDownHitPos = intersectInfo.HitPosition; @@ -1130,7 +1130,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow var worldCenter = Vector3.Transform(center, x.TransformToWorld); var screenPos2 = this.World.GetScreenPosition(worldCenter); e.graphics2D.Circle(screenPos2, 3, Color.Yellow); - e.graphics2D.DrawString($"{x.Depth},", screenPos2.x + 12 * x.Depth, screenPos2.y); + e.graphics2D.DrawString($"{x.Depth},", screenPos2.X + 12 * x.Depth, screenPos2.Y); } } } @@ -1141,7 +1141,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { var center = x.Bvh.GetCenter(); var worldCenter = Vector3.Transform(center, x.TransformToWorld); - if (worldCenter.z > 0) + if (worldCenter.Z > 0) { return true; } @@ -1208,7 +1208,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow } else { - CurrentSelectInfo.HitPlane = new PlaneShape(Vector3.UnitZ, CurrentSelectInfo.PlaneDownHitPos.z, null); + CurrentSelectInfo.HitPlane = new PlaneShape(Vector3.UnitZ, CurrentSelectInfo.PlaneDownHitPos.Z, null); if (hitObject != Scene.SelectedItem) { @@ -1241,9 +1241,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow AxisAlignedBoundingBox selectedBounds = this.Scene.SelectedItem.GetAxisAlignedBoundingBox(Matrix4X4.Identity); - if (info.HitPosition.x < selectedBounds.Center.x) + if (info.HitPosition.X < selectedBounds.Center.X) { - if (info.HitPosition.y < selectedBounds.Center.y) + if (info.HitPosition.Y < selectedBounds.Center.Y) { CurrentSelectInfo.HitQuadrant = HitQuadrant.LB; } @@ -1254,7 +1254,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow } else { - if (info.HitPosition.y < selectedBounds.Center.y) + if (info.HitPosition.Y < selectedBounds.Center.Y) { CurrentSelectInfo.HitQuadrant = HitQuadrant.RB; } @@ -1303,43 +1303,43 @@ namespace MatterHackers.MatterControl.PartPreviewWindow // snap this position to the grid AxisAlignedBoundingBox selectedBounds = this.Scene.SelectedItem.GetAxisAlignedBoundingBox(Matrix4X4.Identity); - double xSnapOffset = selectedBounds.minXYZ.x; + double xSnapOffset = selectedBounds.minXYZ.X; // snap the x position if (CurrentSelectInfo.HitQuadrant == HitQuadrant.RB || CurrentSelectInfo.HitQuadrant == HitQuadrant.RT) { // switch to the other side - xSnapOffset = selectedBounds.maxXYZ.x; + xSnapOffset = selectedBounds.maxXYZ.X; } - double xToSnap = xSnapOffset + delta.x; + double xToSnap = xSnapOffset + delta.X; double snappedX = ((int)((xToSnap / snapGridDistance) + .5)) * snapGridDistance; - delta.x = snappedX - xSnapOffset; + delta.X = snappedX - xSnapOffset; - double ySnapOffset = selectedBounds.minXYZ.y; + double ySnapOffset = selectedBounds.minXYZ.Y; // snap the y position if (CurrentSelectInfo.HitQuadrant == HitQuadrant.LT || CurrentSelectInfo.HitQuadrant == HitQuadrant.RT) { // switch to the other side - ySnapOffset = selectedBounds.maxXYZ.y; + ySnapOffset = selectedBounds.maxXYZ.Y; } - double yToSnap = ySnapOffset + delta.y; + double yToSnap = ySnapOffset + delta.Y; double snappedY = ((int)((yToSnap / snapGridDistance) + .5)) * snapGridDistance; - delta.y = snappedY - ySnapOffset; + delta.Y = snappedY - ySnapOffset; } // if the shift key is down only move on the major axis of x or y if(Keyboard.IsKeyDown(Keys.ShiftKey)) { - if(Math.Abs(delta.x) < Math.Abs(delta.y)) + if(Math.Abs(delta.X) < Math.Abs(delta.Y)) { - delta.x = 0; + delta.X = 0; } else { - delta.y = 0; + delta.Y = 0; } } @@ -1389,8 +1389,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { DragSelectionEndPosition = mouseEvent.Position - OffsetToMeshViewerWidget(); DragSelectionEndPosition = new Vector2( - Math.Max(Math.Min(DragSelectionEndPosition.x, meshViewerWidget.LocalBounds.Right), meshViewerWidget.LocalBounds.Left), - Math.Max(Math.Min(DragSelectionEndPosition.y, meshViewerWidget.LocalBounds.Top), meshViewerWidget.LocalBounds.Bottom)); + Math.Max(Math.Min(DragSelectionEndPosition.X, meshViewerWidget.LocalBounds.Right), meshViewerWidget.LocalBounds.Left), + Math.Max(Math.Min(DragSelectionEndPosition.Y, meshViewerWidget.LocalBounds.Top), meshViewerWidget.LocalBounds.Bottom)); Invalidate(); } @@ -1615,7 +1615,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow offset = -Vector3.Transform(Vector3.Zero, child.Matrix); // figure out how to move it back to the start center - if(firstSourceOrigin.x == double.MaxValue) + if(firstSourceOrigin.X == double.MaxValue) { firstSourceOrigin = -offset; } @@ -1790,7 +1790,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { AxisAlignedBoundingBox selectedBounds = Scene.SelectedItem.GetAxisAlignedBoundingBox(Scene.SelectedItem.Matrix); Vector3 boundsCenter = selectedBounds.Center; - Vector3 centerTop = new Vector3(boundsCenter.x, boundsCenter.y, selectedBounds.maxXYZ.z); + Vector3 centerTop = new Vector3(boundsCenter.X, boundsCenter.Y, selectedBounds.maxXYZ.Z); Vector2 centerTopScreenPosition = this.World.GetScreenPosition(centerTop); centerTopScreenPosition = meshViewerWidget.TransformToParentSpace(this, centerTopScreenPosition); @@ -1943,7 +1943,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow itemToLayFlat = itemToCheck; firstVertex = false; } - else if (vertexPosition.z < lowestVertexPosition.z) + else if (vertexPosition.Z < lowestVertexPosition.Z) { lowestVertex = itemToCheck.Mesh.Vertices[testIndex]; lowestVertexPosition = vertexPosition; @@ -1964,8 +1964,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { Vector3 faceVertexPosition = Vector3.Transform(faceVertex.Position, itemToLayFlat.Matrix); Vector3 pointRelLowest = faceVertexPosition - lowestVertexPosition; - double xLeg = new Vector2(pointRelLowest.x, pointRelLowest.y).Length; - double yLeg = pointRelLowest.z; + double xLeg = new Vector2(pointRelLowest.X, pointRelLowest.Y).Length; + double yLeg = pointRelLowest.Z; double angle = Math.Atan2(yLeg, xLeg); if (angle > biggestAngleToFaceVertex) { @@ -1986,7 +1986,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { Vector3 vertexPosition = Vector3.Transform(vertex.Position, itemToLayFlat.Matrix); faceVertices.Add(vertexPosition); - maxDistFromLowestZ = Math.Max(maxDistFromLowestZ, vertexPosition.z - lowestVertexPosition.z); + maxDistFromLowestZ = Math.Max(maxDistFromLowestZ, vertexPosition.Z - lowestVertexPosition.Z); } if (maxDistFromLowestZ > .001) @@ -2359,9 +2359,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow double delta = endColor - startColor; Color color = ColorF.FromHSL(startColor, .99, .49).GetAsRGBA_Bytes(); - if (normal.z < 0) + if (normal.Z < 0) { - color = ColorF.FromHSL(startColor - delta * normal.z, .99, .49).GetAsRGBA_Bytes(); + color = ColorF.FromHSL(startColor - delta * normal.Z, .99, .49).GetAsRGBA_Bytes(); } colorData.red = color.red; diff --git a/PrinterCommunication/Io/GCodeStream.cs b/PrinterCommunication/Io/GCodeStream.cs index 962832881..25fd772af 100644 --- a/PrinterCommunication/Io/GCodeStream.cs +++ b/PrinterCommunication/Io/GCodeStream.cs @@ -67,17 +67,17 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io var sb = new StringBuilder(command); - if (destination.position.x != start.position.x) + if (destination.position.X != start.position.X) { - sb.AppendFormat("X{0:0.##} ", destination.position.x); + sb.AppendFormat("X{0:0.##} ", destination.position.X); } - if (destination.position.y != start.position.y) + if (destination.position.Y != start.position.Y) { - sb.AppendFormat("Y{0:0.##} ", destination.position.y); + sb.AppendFormat("Y{0:0.##} ", destination.position.Y); } - if (destination.position.z != start.position.z) + if (destination.position.Z != start.position.Z) { - sb.AppendFormat("Z{0:0.###} ", destination.position.z); + sb.AppendFormat("Z{0:0.###} ", destination.position.Z); } if (moveHasExtrusion) @@ -96,9 +96,9 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io public static PrinterMove GetPosition(string lineBeingSent, PrinterMove startPositionPosition) { PrinterMove currentDestination = startPositionPosition; - GCodeFile.GetFirstNumberAfter("X", lineBeingSent, ref currentDestination.position.x); - GCodeFile.GetFirstNumberAfter("Y", lineBeingSent, ref currentDestination.position.y); - GCodeFile.GetFirstNumberAfter("Z", lineBeingSent, ref currentDestination.position.z); + GCodeFile.GetFirstNumberAfter("X", lineBeingSent, ref currentDestination.position.X); + GCodeFile.GetFirstNumberAfter("Y", lineBeingSent, ref currentDestination.position.Y); + GCodeFile.GetFirstNumberAfter("Z", lineBeingSent, ref currentDestination.position.Z); GCodeFile.GetFirstNumberAfter("E", lineBeingSent, ref currentDestination.extrusion); GCodeFile.GetFirstNumberAfter("F", lineBeingSent, ref currentDestination.feedRate); return currentDestination; diff --git a/PrinterCommunication/Io/PauseHandlingStream.cs b/PrinterCommunication/Io/PauseHandlingStream.cs index e56371117..624cc4ffc 100644 --- a/PrinterCommunication/Io/PauseHandlingStream.cs +++ b/PrinterCommunication/Io/PauseHandlingStream.cs @@ -226,8 +226,8 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io InjectPauseGCode("G92 E{0:0.###}".FormatWith(moveLocationAtEndOfPauseCode.extrusion)); Vector3 ensureAllAxisAreSent = positionBeforeActualPause + new Vector3(.01, .01, .01); var feedRates = printer.Settings.Helpers.ManualMovementSpeeds(); - InjectPauseGCode("G1 X{0:0.###} Y{1:0.###} Z{2:0.###} F{3}".FormatWith(ensureAllAxisAreSent.x, ensureAllAxisAreSent.y, ensureAllAxisAreSent.z, feedRates.x + 1)); - InjectPauseGCode("G1 X{0:0.###} Y{1:0.###} Z{2:0.###} F{3}".FormatWith(positionBeforeActualPause.x, positionBeforeActualPause.y, positionBeforeActualPause.z, feedRates)); + InjectPauseGCode("G1 X{0:0.###} Y{1:0.###} Z{2:0.###} F{3}".FormatWith(ensureAllAxisAreSent.X, ensureAllAxisAreSent.Y, ensureAllAxisAreSent.Z, feedRates.X + 1)); + InjectPauseGCode("G1 X{0:0.###} Y{1:0.###} Z{2:0.###} F{3}".FormatWith(positionBeforeActualPause.X, positionBeforeActualPause.Y, positionBeforeActualPause.Z, feedRates)); string resumeGCode = printer.Settings.GetValue(SettingsKey.resume_gcode); InjectPauseGCode(resumeGCode); diff --git a/PrinterCommunication/Io/PrintRecoveryStream.cs b/PrinterCommunication/Io/PrintRecoveryStream.cs index d49321a8c..2d0c20d14 100644 --- a/PrinterCommunication/Io/PrintRecoveryStream.cs +++ b/PrinterCommunication/Io/PrintRecoveryStream.cs @@ -141,7 +141,7 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io queuedCommands.Add("G28 Y0"); // move to the place we can home z from Vector2 recoveryPositionXy = printer.Settings.GetValue(SettingsKey.recover_position_before_z_home); - queuedCommands.Add("G1 X{0:0.###}Y{1:0.###}F{2}".FormatWith(recoveryPositionXy.x, recoveryPositionXy.y, printer.Settings.XSpeed())); + queuedCommands.Add("G1 X{0:0.###}Y{1:0.###}F{2}".FormatWith(recoveryPositionXy.X, recoveryPositionXy.Y, printer.Settings.XSpeed())); // home z queuedCommands.Add("G28 Z0"); } @@ -223,13 +223,13 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io { // move to the height we can recover printing from Vector2 recoverPositionXy = printer.Settings.GetValue(SettingsKey.recover_position_before_z_home); - queuedCommands.Add(CreateMovementLine(new PrinterMove(new VectorMath.Vector3(recoverPositionXy.x, recoverPositionXy.y, lastDestination.position.z), 0, printer.Settings.ZSpeed()))); + queuedCommands.Add(CreateMovementLine(new PrinterMove(new VectorMath.Vector3(recoverPositionXy.X, recoverPositionXy.Y, lastDestination.position.Z), 0, printer.Settings.ZSpeed()))); } double extruderWidth = printer.Settings.GetValue(SettingsKey.nozzle_diameter); // move to a position outside the printed bounds queuedCommands.Add(CreateMovementLine(new PrinterMove( - new Vector3(boundsOfSkippedLayers.Left - extruderWidth*2, boundsOfSkippedLayers.Bottom + boundsOfSkippedLayers.Height / 2, lastDestination.position.z), + new Vector3(boundsOfSkippedLayers.Left - extruderWidth*2, boundsOfSkippedLayers.Bottom + boundsOfSkippedLayers.Height / 2, lastDestination.position.Z), 0, printer.Settings.XSpeed()))); // let's prime the extruder diff --git a/PrinterCommunication/PrinterConnection.cs b/PrinterCommunication/PrinterConnection.cs index cb0f6e2b0..296248017 100644 --- a/PrinterCommunication/PrinterConnection.cs +++ b/PrinterCommunication/PrinterConnection.cs @@ -1176,7 +1176,7 @@ namespace MatterHackers.MatterControl.PrinterCommunication public void MoveAbsolute(Vector3 position, double feedRateMmPerMinute) { SetMovementToAbsolute(); - SendLineToPrinterNow("G1 X{0:0.###}Y{1:0.###}Z{2:0.###} F{3}".FormatWith(position.x, position.y, position.z, feedRateMmPerMinute)); + SendLineToPrinterNow("G1 X{0:0.###}Y{1:0.###}Z{2:0.###} F{3}".FormatWith(position.X, position.Y, position.Z, feedRateMmPerMinute)); } public void MoveExtruderRelative(double moveAmountMm, double feedRateMmPerMinute, int extruderNumber = 0) @@ -1577,9 +1577,9 @@ namespace MatterHackers.MatterControl.PrinterCommunication FoundStringEventArgs foundStringEventArgs = e as FoundStringEventArgs; string lineToParse = foundStringEventArgs.LineToCheck; - GCodeFile.GetFirstNumberAfter("X:", lineToParse, ref lastReportedPosition.position.x); - GCodeFile.GetFirstNumberAfter("Y:", lineToParse, ref lastReportedPosition.position.y); - GCodeFile.GetFirstNumberAfter("Z:", lineToParse, ref lastReportedPosition.position.z); + GCodeFile.GetFirstNumberAfter("X:", lineToParse, ref lastReportedPosition.position.X); + GCodeFile.GetFirstNumberAfter("Y:", lineToParse, ref lastReportedPosition.position.Y); + GCodeFile.GetFirstNumberAfter("Z:", lineToParse, ref lastReportedPosition.position.Z); GCodeFile.GetFirstNumberAfter("E:", lineToParse, ref lastReportedPosition.extrusion); //if (currentDestination != positionRead) @@ -2241,9 +2241,9 @@ namespace MatterHackers.MatterControl.PrinterCommunication newDestination.position = Vector3.Zero; } - GCodeFile.GetFirstNumberAfter("X", lineBeingSent, ref newDestination.position.x); - GCodeFile.GetFirstNumberAfter("Y", lineBeingSent, ref newDestination.position.y); - GCodeFile.GetFirstNumberAfter("Z", lineBeingSent, ref newDestination.position.z); + GCodeFile.GetFirstNumberAfter("X", lineBeingSent, ref newDestination.position.X); + GCodeFile.GetFirstNumberAfter("Y", lineBeingSent, ref newDestination.position.Y); + GCodeFile.GetFirstNumberAfter("Z", lineBeingSent, ref newDestination.position.Z); GCodeFile.GetFirstNumberAfter("E", lineBeingSent, ref newDestination.extrusion); GCodeFile.GetFirstNumberAfter("F", lineBeingSent, ref newDestination.feedRate); @@ -2539,9 +2539,9 @@ namespace MatterHackers.MatterControl.PrinterCommunication && activePrintTask.PercentDone < currentDone) { activePrintTask.PercentDone = currentDone; - activePrintTask.PrintingOffsetX = (float)babyStepsStream7.Offset.x; - activePrintTask.PrintingOffsetY = (float)babyStepsStream7.Offset.y; - activePrintTask.PrintingOffsetZ = (float)babyStepsStream7.Offset.z; + activePrintTask.PrintingOffsetX = (float)babyStepsStream7.Offset.X; + activePrintTask.PrintingOffsetY = (float)babyStepsStream7.Offset.Y; + activePrintTask.PrintingOffsetZ = (float)babyStepsStream7.Offset.Z; try { Task.Run(() => activePrintTask.Commit()); diff --git a/PrinterControls/ControlWidgets/MovementControls.cs b/PrinterControls/ControlWidgets/MovementControls.cs index ef39ad6a9..15e364393 100644 --- a/PrinterControls/ControlWidgets/MovementControls.cs +++ b/PrinterControls/ControlWidgets/MovementControls.cs @@ -254,9 +254,9 @@ namespace MatterHackers.MatterControl.PrinterControls private void SetDestinationPositionText(TextWidget xPosition, TextWidget yPosition, TextWidget zPosition) { Vector3 destinationPosition = printer.Connection.CurrentDestination; - xPosition.Text = "X: {0:0.00}".FormatWith(destinationPosition.x); - yPosition.Text = "Y: {0:0.00}".FormatWith(destinationPosition.y); - zPosition.Text = "Z: {0:0.00}".FormatWith(destinationPosition.z); + xPosition.Text = "X: {0:0.00}".FormatWith(destinationPosition.X); + yPosition.Text = "Y: {0:0.00}".FormatWith(destinationPosition.Y); + zPosition.Text = "Z: {0:0.00}".FormatWith(destinationPosition.Z); } private void homeAll_Click(object sender, EventArgs mouseEvent) diff --git a/PrinterControls/PrintLevelingPlane.cs b/PrinterControls/PrintLevelingPlane.cs index 6292a768f..4363dd999 100644 --- a/PrinterControls/PrintLevelingPlane.cs +++ b/PrinterControls/PrintLevelingPlane.cs @@ -42,9 +42,9 @@ namespace MatterHackers.MatterControl bool inFront; double distanceToPlaneAtBedCenter = planeOfPoints.GetDistanceToIntersection(ray, out inFront); - Matrix4X4 makePointsFlatMatrix = Matrix4X4.CreateTranslation(-bedCenter.x, -bedCenter.y, -distanceToPlaneAtBedCenter); + Matrix4X4 makePointsFlatMatrix = Matrix4X4.CreateTranslation(-bedCenter.X, -bedCenter.Y, -distanceToPlaneAtBedCenter); makePointsFlatMatrix *= Matrix4X4.CreateRotation(planeOfPoints.PlaneNormal, Vector3.UnitZ); - makePointsFlatMatrix *= Matrix4X4.CreateTranslation(bedCenter.x, bedCenter.y, 0);//distanceToPlaneAtBedCenter); + makePointsFlatMatrix *= Matrix4X4.CreateTranslation(bedCenter.X, bedCenter.Y, 0);//distanceToPlaneAtBedCenter); bedLevelMatrix = Matrix4X4.Invert(makePointsFlatMatrix); } @@ -76,7 +76,7 @@ namespace MatterHackers.MatterControl { Vector3 outPosition = PrintLevelingPlane.Instance.ApplyLeveling(currentDestination); - newLine = newLine + String.Format("X{0:0.##} Y{1:0.##} Z{2:0.###}", outPosition.x, outPosition.y, outPosition.z); + newLine = newLine + String.Format("X{0:0.##} Y{1:0.##} Z{2:0.###}", outPosition.X, outPosition.Y, outPosition.Z); } if (extruderDelta != 0) diff --git a/Queue/OptionsMenu/PartsSheetCreator.cs b/Queue/OptionsMenu/PartsSheetCreator.cs index d0cabede3..d014a6610 100644 --- a/Queue/OptionsMenu/PartsSheetCreator.cs +++ b/Queue/OptionsMenu/PartsSheetCreator.cs @@ -127,7 +127,7 @@ namespace MatterHackers.MatterControl public async Task SaveSheets() { - await Task.Run(async () => + await Task.Run((Func)(async () => { currentlySaving = true; // first create images for all the parts @@ -145,16 +145,16 @@ namespace MatterHackers.MatterControl aabb = AxisAlignedBoundingBox.Union(aabb, loadedMeshGroups[i].Mesh.GetAxisAlignedBoundingBox(loadedMeshGroups[i].WorldMatrix())); } - RectangleDouble bounds2D = new RectangleDouble(aabb.minXYZ.x, aabb.minXYZ.y, aabb.maxXYZ.x, aabb.maxXYZ.y); + RectangleDouble bounds2D = new RectangleDouble(aabb.minXYZ.X, aabb.minXYZ.Y, aabb.maxXYZ.X, aabb.maxXYZ.Y); double widthInMM = bounds2D.Width + PartMarginMM * 2; double textSpaceMM = 5; double heightMM = textSpaceMM + bounds2D.Height + PartMarginMM * 2; TypeFacePrinter typeFacePrinter = new TypeFacePrinter(item.Name, 28, Vector2.Zero, Justification.Center, Baseline.BoundsCenter); - double sizeOfNameX = typeFacePrinter.GetSize().x + PartMarginPixels * 2; + double sizeOfNameX = typeFacePrinter.GetSize().X + PartMarginPixels * 2; Vector2 sizeOfRender = new Vector2(widthInMM * PixelPerMM, heightMM * PixelPerMM); - ImageBuffer imageOfPart = new ImageBuffer((int)(Math.Max(sizeOfNameX, sizeOfRender.x)), (int)(sizeOfRender.y)); + ImageBuffer imageOfPart = new ImageBuffer((int)(Math.Max(sizeOfNameX, sizeOfRender.X)), (int)(sizeOfRender.Y)); typeFacePrinter.Origin = new Vector2(imageOfPart.Width / 2, (textSpaceMM / 2) * PixelPerMM); Graphics2D partGraphics2D = imageOfPart.NewGraphics2D(); @@ -212,7 +212,7 @@ namespace MatterHackers.MatterControl OnDoneSaving(); currentlySaving = false; - }); + })); } private static int BiggestToLittlestImages(PartImage one, PartImage two) @@ -234,35 +234,35 @@ namespace MatterHackers.MatterControl ImageBuffer image = partImagesToPrint[nextPartToPrintIndex].image; tallestHeight = Math.Max(tallestHeight, image.Height); - if (partsOnLine.Count > 0 && offset.x + image.Width > plateInventoryImage.Width - PageMarginPixels.Right) + if (partsOnLine.Count > 0 && offset.X + image.Width > plateInventoryImage.Width - PageMarginPixels.Right) { if (partsOnLine.Count == 1) { - plateGraphics.Render(partsOnLine[0].image, plateInventoryImage.Width / 2 - partsOnLine[0].image.Width / 2, offset.y - tallestHeight); + plateGraphics.Render(partsOnLine[0].image, plateInventoryImage.Width / 2 - partsOnLine[0].image.Width / 2, offset.Y - tallestHeight); } else { foreach (PartImage partToDraw in partsOnLine) { - plateGraphics.Render(partToDraw.image, partToDraw.xOffset, offset.y - tallestHeight); + plateGraphics.Render(partToDraw.image, partToDraw.xOffset, offset.Y - tallestHeight); } } - offset.x = PageMarginPixels.Left; - offset.y -= (tallestHeight + PartPaddingPixels * 2); + offset.X = PageMarginPixels.Left; + offset.Y -= (tallestHeight + PartPaddingPixels * 2); tallestHeight = 0; partsOnLine.Clear(); - if (offset.y - image.Height < PageMarginPixels.Bottom) + if (offset.Y - image.Height < PageMarginPixels.Bottom) { break; } } else { - partImagesToPrint[nextPartToPrintIndex].xOffset = offset.x; + partImagesToPrint[nextPartToPrintIndex].xOffset = offset.X; partsOnLine.Add(partImagesToPrint[nextPartToPrintIndex]); //plateGraphics.Render(image, offset.x, offset.y - image.Height); - offset.x += image.Width + PartPaddingPixels * 2; + offset.X += image.Width + PartPaddingPixels * 2; nextPartToPrintIndex++; } } @@ -270,7 +270,7 @@ namespace MatterHackers.MatterControl // print the last line of parts foreach (PartImage partToDraw in partsOnLine) { - plateGraphics.Render(partToDraw.image, partToDraw.xOffset, offset.y - tallestHeight); + plateGraphics.Render(partToDraw.image, partToDraw.xOffset, offset.Y - tallestHeight); } TypeFacePrinter printer = new TypeFacePrinter(string.Format("{0}", Path.GetFileNameWithoutExtension(pathAndFileToSaveTo)), 32, justification: Justification.Center); diff --git a/SlicerConfiguration/Settings/PrinterSettings.cs b/SlicerConfiguration/Settings/PrinterSettings.cs index 1610a8682..aa7e58a32 100644 --- a/SlicerConfiguration/Settings/PrinterSettings.cs +++ b/SlicerConfiguration/Settings/PrinterSettings.cs @@ -800,8 +800,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration throw new Exception(string.Format("Not parsing {0} as a Vector2", settingsKey)); } Vector2 valueAsVector2 = new Vector2(); - valueAsVector2.x = Helpers.ParseDouble(twoValues[0]); - valueAsVector2.y = Helpers.ParseDouble(twoValues[1]); + valueAsVector2.X = Helpers.ParseDouble(twoValues[0]); + valueAsVector2.Y = Helpers.ParseDouble(twoValues[1]); return (T)(object)(valueAsVector2); } else if (typeof(T) == typeof(double)) diff --git a/SlicerConfiguration/Settings/SettingsHelpers.cs b/SlicerConfiguration/Settings/SettingsHelpers.cs index 4431b8797..57e02862a 100644 --- a/SlicerConfiguration/Settings/SettingsHelpers.cs +++ b/SlicerConfiguration/Settings/SettingsHelpers.cs @@ -445,9 +445,9 @@ namespace MatterHackers.MatterControl.SlicerConfiguration if (!string.IsNullOrEmpty(savedSettings)) { var segments = savedSettings.Split(','); - feedRate.x = double.Parse(segments[1]); - feedRate.y = double.Parse(segments[3]); - feedRate.z = double.Parse(segments[5]); + feedRate.X = double.Parse(segments[1]); + feedRate.Y = double.Parse(segments[3]); + feedRate.Z = double.Parse(segments[5]); } return feedRate; diff --git a/SlicerConfiguration/SliceSettingsWidget.cs b/SlicerConfiguration/SliceSettingsWidget.cs index 5bfc19749..485a5fcf4 100644 --- a/SlicerConfiguration/SliceSettingsWidget.cs +++ b/SlicerConfiguration/SliceSettingsWidget.cs @@ -184,7 +184,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration } foreach (TabBar tabBar in sideTabBarsListForLayout) { - tabBar.MinimumSize = new Vector2(sideTabBarsMinimumWidth, tabBar.MinimumSize.y); + tabBar.MinimumSize = new Vector2(sideTabBarsMinimumWidth, tabBar.MinimumSize.Y); } } @@ -409,7 +409,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration //helpWidget.HAnchor = HAnchor.Left; allText.AddChild(helpWidget); - allText.MinimumSize = new Vector2(0, allText.MinimumSize.y); + allText.MinimumSize = new Vector2(0, allText.MinimumSize.Y); return allText; } diff --git a/SlicerConfiguration/SlicerMapping/EngineMappingCura.cs b/SlicerConfiguration/SlicerMapping/EngineMappingCura.cs index 87f90ec83..d7cb8557b 100644 --- a/SlicerConfiguration/SlicerMapping/EngineMappingCura.cs +++ b/SlicerConfiguration/SlicerMapping/EngineMappingCura.cs @@ -232,7 +232,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration get { Vector2 PrinteCenter = ActiveSliceSettings.Instance.GetValue(SettingsKey.print_center); - return (PrinteCenter.x * 1000).ToString(); + return (PrinteCenter.X * 1000).ToString(); } } } @@ -249,7 +249,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration get { Vector2 PrinteCenter = ActiveSliceSettings.Instance.GetValue(SettingsKey.print_center); - return (PrinteCenter.y * 1000).ToString(); + return (PrinteCenter.Y * 1000).ToString(); } } } diff --git a/SlicerConfiguration/SlicerMapping/MappingClasses.cs b/SlicerConfiguration/SlicerMapping/MappingClasses.cs index b5ce6a975..f5b973e02 100644 --- a/SlicerConfiguration/SlicerMapping/MappingClasses.cs +++ b/SlicerConfiguration/SlicerMapping/MappingClasses.cs @@ -146,7 +146,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration } double x = Math.Cos(angle*i); double y = Math.Sin(angle*i); - bedString += $"{printCenter.x + x * bedSize.x / 2:0.####}x{printCenter.y + y * bedSize.y / 2:0.####}"; + bedString += $"{printCenter.X + x * bedSize.X / 2:0.####}x{printCenter.Y + y * bedSize.Y / 2:0.####}"; first = false; } return bedString; @@ -157,10 +157,10 @@ namespace MatterHackers.MatterControl.SlicerConfiguration default: { //bed_shape = 0x0,200x0,200x200,0x200 - string bedString = $"{printCenter.x - bedSize.x / 2}x{printCenter.y - bedSize.y / 2}"; - bedString += $",{printCenter.x + bedSize.x / 2}x{printCenter.y - bedSize.y / 2}"; - bedString += $",{printCenter.x + bedSize.x / 2}x{printCenter.y + bedSize.y / 2}"; - bedString += $",{printCenter.x - bedSize.x / 2}x{printCenter.y + bedSize.y / 2}"; + string bedString = $"{printCenter.X - bedSize.X / 2}x{printCenter.Y - bedSize.Y / 2}"; + bedString += $",{printCenter.X + bedSize.X / 2}x{printCenter.Y - bedSize.Y / 2}"; + bedString += $",{printCenter.X + bedSize.X / 2}x{printCenter.Y + bedSize.Y / 2}"; + bedString += $",{printCenter.X - bedSize.X / 2}x{printCenter.Y + bedSize.Y / 2}"; return bedString; } } diff --git a/SlicerConfiguration/Slicing/SliceLayers.cs b/SlicerConfiguration/Slicing/SliceLayers.cs index 9b9e52128..e09cf5d82 100644 --- a/SlicerConfiguration/Slicing/SliceLayers.cs +++ b/SlicerConfiguration/Slicing/SliceLayers.cs @@ -71,8 +71,8 @@ namespace MatterHackers.MatterControl.Slicing double maxZ = double.MinValue; foreach (FaceEdge faceEdge in face.FaceEdges()) { - minZ = Math.Min(minZ, faceEdge.FirstVertex.Position.z); - maxZ = Math.Max(maxZ, faceEdge.FirstVertex.Position.z); + minZ = Math.Min(minZ, faceEdge.FirstVertex.Position.Z); + maxZ = Math.Max(maxZ, faceEdge.FirstVertex.Position.Z); } for (int layerIndex = 0; layerIndex < layerCount; layerIndex++) @@ -95,7 +95,7 @@ namespace MatterHackers.MatterControl.Slicing Vector3 end; if (face.GetCutLine(cutPlane, out start, out end)) { - layer.UnorderedSegments.Add(new SliceLayer.Segment(new Vector2(start.x, start.y), new Vector2(end.x, end.y))); + layer.UnorderedSegments.Add(new SliceLayer.Segment(new Vector2(start.X, start.Y), new Vector2(end.X, end.Y))); } } } @@ -118,8 +118,8 @@ namespace MatterHackers.MatterControl.Slicing for (int segmentIndex = 0; segmentIndex < unorderedSegments.Count; segmentIndex++) { SliceLayer.Segment segment = unorderedSegments[segmentIndex]; - stream.Write("G1 X{0}Y{1}\n", segment.start.x, segment.start.y); - stream.Write("G1 X{0}Y{1}E{2}\n", segment.end.x, segment.end.y, extrudeAmount++); + stream.Write("G1 X{0}Y{1}\n", segment.start.X, segment.start.Y); + stream.Write("G1 X{0}Y{1}E{2}\n", segment.end.X, segment.end.Y, extrudeAmount++); } } stream.Close(); diff --git a/Submodules/MatterSlice b/Submodules/MatterSlice index 12d486238..bca180820 160000 --- a/Submodules/MatterSlice +++ b/Submodules/MatterSlice @@ -1 +1 @@ -Subproject commit 12d48623820dd0ac7000540bff7cac27be106982 +Subproject commit bca180820288e0ca75f3d77e987327605f1c1fd1 diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index d1c6eaecf..1eac03fda 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit d1c6eaecfb06d67d5f8d123978f826cccb0eb6fe +Subproject commit 1eac03fda480f38e14f642a95ac0778831ed0882 diff --git a/Tests/MatterControl.Tests/MatterControl/LevelingTests.cs b/Tests/MatterControl.Tests/MatterControl/LevelingTests.cs index 2f547527e..8d75d216f 100644 --- a/Tests/MatterControl.Tests/MatterControl/LevelingTests.cs +++ b/Tests/MatterControl.Tests/MatterControl/LevelingTests.cs @@ -75,7 +75,7 @@ namespace MatterControl.Tests.MatterControl Vector3 destPosition = new Vector3(currentTestPoint, 0); Vector3 outPosition = levelingFunctions7Point.GetPositionWithZOffset(destPosition); - Assert.IsTrue(outPosition.z <= 10); + Assert.IsTrue(outPosition.Z <= 10); string outPositionString = levelingFunctions7Point.DoApplyLeveling(GetGCodeString(destPosition), destPosition); double outZ = 0; @@ -116,25 +116,25 @@ namespace MatterControl.Tests.MatterControl currentTestPoint.Rotate(MathHelper.Tau / 6 * curPoint); Vector3 destPosition = new Vector3(currentTestPoint, 0); Vector3 outPosition = levelingFunctions7Point.GetPositionWithZOffset(destPosition); - Assert.AreEqual(outPosition.z, levelingData.SampledPositions[curPoint].z, .001); + Assert.AreEqual(outPosition.Z, levelingData.SampledPositions[curPoint].Z, .001); string outPositionString = levelingFunctions7Point.DoApplyLeveling(GetGCodeString(destPosition), destPosition); Assert.AreEqual(GetGCodeString(outPosition), outPositionString); // test mid point between samples Vector3 midPoint = (levelingData.SampledPositions[curPoint] + levelingData.SampledPositions[nextPoint]) / 2; - currentTestPoint = new Vector2(midPoint.x, midPoint.y); + currentTestPoint = new Vector2(midPoint.X, midPoint.Y); destPosition = new Vector3(currentTestPoint, 0); outPosition = levelingFunctions7Point.GetPositionWithZOffset(destPosition); - Assert.AreEqual(outPosition.z, midPoint.z, .001); + Assert.AreEqual(outPosition.Z, midPoint.Z, .001); outPositionString = levelingFunctions7Point.DoApplyLeveling(GetGCodeString(destPosition), destPosition); Assert.AreEqual(GetGCodeString(outPosition), outPositionString); // test mid point between samples with offset Vector3 midPointWithOffset = (levelingData.SampledPositions[curPoint] + levelingData.SampledPositions[nextPoint]) / 2 + new Vector3(0, 0, 3); - currentTestPoint = new Vector2(midPointWithOffset.x, midPointWithOffset.y); + currentTestPoint = new Vector2(midPointWithOffset.X, midPointWithOffset.Y); destPosition = new Vector3(currentTestPoint, 3); outPosition = levelingFunctions7Point.GetPositionWithZOffset(destPosition); - Assert.AreEqual(outPosition.z, midPointWithOffset.z, .001); + Assert.AreEqual(outPosition.Z, midPointWithOffset.Z, .001); outPositionString = levelingFunctions7Point.DoApplyLeveling(GetGCodeString(destPosition), destPosition); Assert.AreEqual(GetGCodeString(outPosition), outPositionString); @@ -144,7 +144,7 @@ namespace MatterControl.Tests.MatterControl destPosition = new Vector3(currentTestPoint, 0); outPosition = levelingFunctions7Point.GetPositionWithZOffset(destPosition); // the center is the higest point so the point on the radius has to be less than the mid point of the sample points (it is lower) - Assert.IsTrue(outPosition.z < (levelingData.SampledPositions[curPoint].z + levelingData.SampledPositions[nextPoint].z) / 2 - .001); + Assert.IsTrue(outPosition.Z < (levelingData.SampledPositions[curPoint].Z + levelingData.SampledPositions[nextPoint].Z) / 2 - .001); outPositionString = levelingFunctions7Point.DoApplyLeveling(GetGCodeString(destPosition), destPosition); Assert.AreEqual(GetGCodeString(outPosition), outPositionString); @@ -153,13 +153,13 @@ namespace MatterControl.Tests.MatterControl currentTestPoint.Rotate(MathHelper.Tau / 6 * curPoint); destPosition = new Vector3(currentTestPoint, 0); outPosition = levelingFunctions7Point.GetPositionWithZOffset(destPosition); - Assert.AreEqual(outPosition.z, (levelingData.SampledPositions[curPoint].z + levelingData.SampledPositions[6].z) / 2, .001); + Assert.AreEqual(outPosition.Z, (levelingData.SampledPositions[curPoint].Z + levelingData.SampledPositions[6].Z) / 2, .001); outPositionString = levelingFunctions7Point.DoApplyLeveling(GetGCodeString(destPosition), destPosition); Assert.AreEqual(GetGCodeString(outPosition), outPositionString); } Vector3 outPosition2 = levelingFunctions7Point.GetPositionWithZOffset(Vector3.Zero); - Assert.AreEqual(outPosition2.z, levelingData.SampledPositions[6].z, .001); + Assert.AreEqual(outPosition2.Z, levelingData.SampledPositions[6].Z, .001); } @@ -252,18 +252,18 @@ namespace MatterControl.Tests.MatterControl void AssertMeshLevelPoint(Vector3 testUnleveled, Vector3 controlLeveled, MeshLevlingFunctions levelingFunctions) { Vector3 testLeveled = levelingFunctions.GetPositionWithZOffset(testUnleveled); - Assert.AreEqual(testLeveled.x, testUnleveled.x, .001, "We don't adjust the x or y on mesh leveling"); - Assert.AreEqual(testLeveled.x, controlLeveled.x, .001, "We don't adjust the x or y on mesh leveling"); - Assert.AreEqual(testLeveled.y, testUnleveled.y, .001, "We don't adjust the x or y on mesh leveling"); - Assert.AreEqual(testLeveled.y, controlLeveled.y, .001, "We don't adjust the x or y on mesh leveling"); - Assert.AreEqual(testLeveled.z, controlLeveled.z, .001); + Assert.AreEqual(testLeveled.X, testUnleveled.X, .001, "We don't adjust the x or y on mesh leveling"); + Assert.AreEqual(testLeveled.X, controlLeveled.X, .001, "We don't adjust the x or y on mesh leveling"); + Assert.AreEqual(testLeveled.Y, testUnleveled.Y, .001, "We don't adjust the x or y on mesh leveling"); + Assert.AreEqual(testLeveled.Y, controlLeveled.Y, .001, "We don't adjust the x or y on mesh leveling"); + Assert.AreEqual(testLeveled.Z, controlLeveled.Z, .001); string outPositionString = levelingFunctions.DoApplyLeveling(GetGCodeString(testUnleveled), testUnleveled); Assert.AreEqual(GetGCodeString(testLeveled), outPositionString); } private string GetGCodeString(Vector3 destPosition) { - return "G1 X{0:0.##} Y{1:0.##} Z{2:0.###}".FormatWith(destPosition.x, destPosition.y, destPosition.z); + return "G1 X{0:0.##} Y{1:0.##} Z{2:0.###}".FormatWith(destPosition.X, destPosition.Y, destPosition.Z); } } } diff --git a/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs b/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs index a54b89dac..5c3ed2872 100644 --- a/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs +++ b/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs @@ -133,7 +133,7 @@ namespace MatterHackers.MatterControl.Tests.Automation SystemWindow mcWindowLocal = MatterControlApplication.Instance; var mainWindow = testRunner.GetWidgetByName("MatterControl", out _); - var windowCenter = new Point2D(mainWindow.LocalBounds.Center.x, mainWindow.LocalBounds.Center.y); + var windowCenter = new Point2D(mainWindow.LocalBounds.Center.X, mainWindow.LocalBounds.Center.Y); testRunner.ClickByName("MatterControl", offset: windowCenter + new Point2D(-5, 10)); testRunner.Delay(.2); diff --git a/Tests/MatterControl.Tests/RemovedFromProduct.cs b/Tests/MatterControl.Tests/RemovedFromProduct.cs index 62fd8f7a8..c6a67ddc1 100644 --- a/Tests/MatterControl.Tests/RemovedFromProduct.cs +++ b/Tests/MatterControl.Tests/RemovedFromProduct.cs @@ -48,7 +48,7 @@ namespace MatterControl.Tests private static void WriteMove(StreamWriter file, Vector2 center) { - file.WriteLine("G1 X" + center.x.ToString() + " Y" + center.y.ToString()); + file.WriteLine("G1 X" + center.X.ToString() + " Y" + center.Y.ToString()); } private static void HtmlWindowTest() diff --git a/TextCreator/Braille/BrailleGenerator.cs b/TextCreator/Braille/BrailleGenerator.cs index 40c779b8f..ccfed19a1 100644 --- a/TextCreator/Braille/BrailleGenerator.cs +++ b/TextCreator/Braille/BrailleGenerator.cs @@ -161,10 +161,10 @@ namespace MatterHackers.MatterControl.Plugins.BrailleBuilder var spacing = characterSpacing[i++]; - double newX = spacing.x * lastSizeValue; - double newY = spacing.y * lastSizeValue; + double newX = spacing.X * lastSizeValue; + double newY = spacing.Y * lastSizeValue; - child.Matrix *= Matrix4X4.CreateTranslation(new Vector3(newX, newY, startPosition.z)); + child.Matrix *= Matrix4X4.CreateTranslation(new Vector3(newX, newY, startPosition.Z)); } } } @@ -187,7 +187,7 @@ namespace MatterHackers.MatterControl.Plugins.BrailleBuilder sceneItem.Matrix *= Matrix4X4.CreateScale(new Vector3(1, 1, oldHeight)); sceneItem.Matrix *= Matrix4X4.CreateScale(new Vector3(1, 1, newHeight)); - sceneItem.Matrix *= Matrix4X4.CreateTranslation(new Vector3(0, 0, baseBounds.ZSize - startPosition.z)); + sceneItem.Matrix *= Matrix4X4.CreateTranslation(new Vector3(0, 0, baseBounds.ZSize - startPosition.Z)); } lastHeightValue = newHeight; @@ -233,7 +233,7 @@ namespace MatterHackers.MatterControl.Plugins.BrailleBuilder AxisAlignedBoundingBox bounds = group.GetAxisAlignedBoundingBox(Matrix4X4.Identity); double roundingScale = 20; - RectangleDouble baseRect = new RectangleDouble(bounds.minXYZ.x, bounds.minXYZ.y, bounds.maxXYZ.x, bounds.maxXYZ.y); + RectangleDouble baseRect = new RectangleDouble(bounds.minXYZ.X, bounds.minXYZ.Y, bounds.maxXYZ.X, bounds.maxXYZ.Y); baseRect.Inflate(2); baseRect *= roundingScale; diff --git a/TextCreator/CardHolderTool/BendOperation.cs b/TextCreator/CardHolderTool/BendOperation.cs index 818784d3e..5b3305a56 100644 --- a/TextCreator/CardHolderTool/BendOperation.cs +++ b/TextCreator/CardHolderTool/BendOperation.cs @@ -74,7 +74,7 @@ namespace MatterHackers.MatterControl.SimplePartScripting var circumference = aabb.XSize * MathHelper.Tau / angleRadians; var radius = circumference / MathHelper.Tau; - var rotateXyPos = new Vector2(aabb.minXYZ.x, BendCW ? aabb.maxXYZ.y : aabb.minXYZ.y); + var rotateXyPos = new Vector2(aabb.minXYZ.X, BendCW ? aabb.maxXYZ.Y : aabb.minXYZ.Y); if (!BendCW) { angleRadians = -angleRadians; @@ -85,15 +85,15 @@ namespace MatterHackers.MatterControl.SimplePartScripting var pos = firstChild.Mesh.Vertices[i].Position; var pos2D = new Vector2(pos); Vector2 rotateSpace = pos2D - rotateXyPos; - var rotateRatio = rotateSpace.x / aabb.XSize; + var rotateRatio = rotateSpace.X / aabb.XSize; - rotateSpace.x = 0; - rotateSpace.y += BendCW ? -radius : radius; + rotateSpace.X = 0; + rotateSpace.Y += BendCW ? -radius : radius; rotateSpace.Rotate(angleRadians * rotateRatio); - rotateSpace.y += BendCW ? radius : -radius; ; + rotateSpace.Y += BendCW ? radius : -radius; ; rotateSpace += rotateXyPos; - meshChild.Mesh.Vertices[i].Position = new Vector3(rotateSpace.x, rotateSpace.y, pos.z); + meshChild.Mesh.Vertices[i].Position = new Vector3(rotateSpace.X, rotateSpace.Y, pos.Z); } meshChild.Mesh.MarkAsChanged(); diff --git a/TextCreator/CardHolderTool/CardHolder.cs b/TextCreator/CardHolderTool/CardHolder.cs index 8d200b8a5..11fadc653 100644 --- a/TextCreator/CardHolderTool/CardHolder.cs +++ b/TextCreator/CardHolderTool/CardHolder.cs @@ -217,7 +217,7 @@ namespace MatterHackers.MatterControl.SimplePartScripting // test the area that the names will go to //nameMesh = new Box(textArea.x, textArea.y, 5); - double scale = Math.Min(textArea.x / textBounds.XSize, textArea.y / textBounds.YSize); + double scale = Math.Min(textArea.X / textBounds.XSize, textArea.Y / textBounds.YSize); nameMesh = new Scale(nameMesh, scale, scale, 1); nameMesh = new Align(nameMesh, Face.Top | Face.Front, plainCardHolder, Face.Bottom | Face.Front); nameMesh = new SetCenter(nameMesh, plainCardHolder.GetCenter(), true, false, false); @@ -281,7 +281,7 @@ namespace MatterHackers.MatterControl.SimplePartScripting AxisAlignedBoundingBox textBounds = textMesh.GetAxisAlignedBoundingBox(); var textArea = new Vector2(25, 6); - double scale = Math.Min(textArea.x / textBounds.XSize, textArea.y / textBounds.YSize); + double scale = Math.Min(textArea.X / textBounds.XSize, textArea.Y / textBounds.YSize); nameMesh = new Scale(nameMesh, scale, scale, 2 / textBounds.ZSize); nameMesh = new Align(nameMesh, Face.Bottom | Face.Front, cancerRibonStl, Face.Top | Face.Front, 0, 0, -1); nameMesh = new SetCenter(nameMesh, cancerRibonStl.GetCenter(), true, false, false); @@ -336,13 +336,13 @@ namespace MatterHackers.MatterControl.SimplePartScripting var ratioToApply = PinchRatio; - var distFromCenter = pos.x - aabb.Center.x; + var distFromCenter = pos.X - aabb.Center.X; var distanceToPinch = distFromCenter * (1-PinchRatio); - var delta = (aabb.Center.x + distFromCenter * ratioToApply) - pos.x; + var delta = (aabb.Center.X + distFromCenter * ratioToApply) - pos.X; // find out how much to pinch based on y position - var amountOfRatio = (pos.y - aabb.minXYZ.y) / aabb.YSize; - transformedMesh.Vertices[i].Position = new Vector3(pos.x + delta * amountOfRatio, pos.y, pos.z); + var amountOfRatio = (pos.Y - aabb.minXYZ.Y) / aabb.YSize; + transformedMesh.Vertices[i].Position = new Vector3(pos.X + delta * amountOfRatio, pos.Y, pos.Z); } transformedMesh.MarkAsChanged(); @@ -383,7 +383,7 @@ namespace MatterHackers.MatterControl.SimplePartScripting var circumference = aabb.XSize * MathHelper.Tau / angleRadians; var radius = circumference / MathHelper.Tau; - var rotateXyPos = new Vector2(aabb.minXYZ.x, BendCW ? aabb.maxXYZ.y : aabb.minXYZ.y); + var rotateXyPos = new Vector2(aabb.minXYZ.X, BendCW ? aabb.maxXYZ.Y : aabb.minXYZ.Y); if(!BendCW) { angleRadians = -angleRadians; @@ -394,15 +394,15 @@ namespace MatterHackers.MatterControl.SimplePartScripting var pos = inputMesh.Vertices[i].Position; var pos2D = new Vector2(pos); Vector2 rotateSpace = pos2D - rotateXyPos; - var rotateRatio = rotateSpace.x / aabb.XSize; + var rotateRatio = rotateSpace.X / aabb.XSize; - rotateSpace.x = 0; - rotateSpace.y += BendCW ? -radius : radius; + rotateSpace.X = 0; + rotateSpace.Y += BendCW ? -radius : radius; rotateSpace.Rotate(angleRadians * rotateRatio); - rotateSpace.y += BendCW ? radius : -radius; ; + rotateSpace.Y += BendCW ? radius : -radius; ; rotateSpace += rotateXyPos; - transformedMesh.Vertices[i].Position = new Vector3(rotateSpace.x, rotateSpace.y, pos.z); + transformedMesh.Vertices[i].Position = new Vector3(rotateSpace.X, rotateSpace.Y, pos.Z); } } else @@ -479,7 +479,7 @@ namespace MatterHackers.MatterControl.SimplePartScripting chairFoot = new Rotate(chairFoot, 0, angleRadians, 0); CsgObject clipBox = new Align(new Box(OuterSize * 2, OuterSize * 2, unclippedFootHeight), Face.Top, chairFoot, Face.Bottom, 0, 0, extraHeightForRotation); chairFoot -= clipBox; - chairFoot = new Translate(chairFoot, 0, 0, clipBox.GetAxisAlignedBoundingBox().maxXYZ.z); + chairFoot = new Translate(chairFoot, 0, 0, clipBox.GetAxisAlignedBoundingBox().maxXYZ.Z); SetAndInvalidateMesh(CsgToMesh.Convert(chairFoot)); } diff --git a/TextCreator/Text/TextGenerator.cs b/TextCreator/Text/TextGenerator.cs index c78f8faae..188d3032d 100644 --- a/TextCreator/Text/TextGenerator.cs +++ b/TextCreator/Text/TextGenerator.cs @@ -61,7 +61,7 @@ namespace MatterHackers.MatterControl.Plugins.TextCreator TypeFacePrinter printer = new TypeFacePrinter(wordText, typeFace); Vector2 size = printer.GetSize(wordText); - double centerOffset = -size.x / 2; + double centerOffset = -size.X / 2; double ratioPerMeshGroup = 1.0 / wordText.Length; double currentRatioDone = 0; @@ -82,14 +82,14 @@ namespace MatterHackers.MatterControl.Plugins.TextCreator Mesh = textMesh, }; - characterSpacing[meshIndex++] = new Vector2( printer.GetOffsetLeftOfCharacterIndex(i).x + centerOffset, 0); + characterSpacing[meshIndex++] = new Vector2( printer.GetOffsetLeftOfCharacterIndex(i).X + centerOffset, 0); groupItem.Children.Add(characterObject); AxisAlignedBoundingBox bounds = characterObject.GetAxisAlignedBoundingBox(Matrix4X4.Identity); Vector3 boundsCenter = (bounds.maxXYZ + bounds.minXYZ) / 2; - characterObject.Matrix *= Matrix4X4.CreateTranslation(new Vector3(0, 0, -boundsCenter.z + bounds.ZSize / 2)); + characterObject.Matrix *= Matrix4X4.CreateTranslation(new Vector3(0, 0, -boundsCenter.Z + bounds.ZSize / 2)); currentRatioDone += ratioPerMeshGroup; } @@ -118,7 +118,7 @@ namespace MatterHackers.MatterControl.Plugins.TextCreator sceneItem.Matrix *= Matrix4X4.CreateTranslation(-startPosition); - double newX = characterSpacing[i].x * spacing; + double newX = characterSpacing[i].X * spacing; sceneItem.Matrix *= Matrix4X4.CreateTranslation(new Vector3(newX, 0, 0) + new Vector3(bedCenter)); i += 1; } diff --git a/Utilities/InspectForm.cs b/Utilities/InspectForm.cs index e5016ba57..aaa92fa5d 100644 --- a/Utilities/InspectForm.cs +++ b/Utilities/InspectForm.cs @@ -377,7 +377,7 @@ namespace MatterHackers.MatterControl inspectedSystemWindow.FindNamedChildrenRecursive( "", namedChildren, - new RectangleDouble(mousePosition.x, mousePosition.y, mousePosition.x + 1, mousePosition.y + 1), + new RectangleDouble(mousePosition.X, mousePosition.Y, mousePosition.X + 1, mousePosition.Y + 1), GuiWidget.SearchType.Partial, allowDisabledOrHidden: false);