Sample the center point correctly.

This commit is contained in:
Lars Brubaker 2015-08-06 11:07:55 -07:00
parent 48b8e5b862
commit b183bcf1d5
2 changed files with 6 additions and 4 deletions

View file

@ -102,16 +102,17 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
public static Vector2 GetPrintLevelPositionToSample(int index, double radius)
{
Vector2 bedCenter = ActiveSliceSettings.Instance.BedCenter;
if (index < numberOfRadialSamples)
{
Vector2 position = new Vector2(radius, 0);
position.Rotate(MathHelper.Tau / numberOfRadialSamples * index);
position += ActiveSliceSettings.Instance.BedCenter;
position += bedCenter;
return position;
}
else
{
return new Vector2(0, 0);
return bedCenter;
}
}

View file

@ -103,16 +103,17 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
public static Vector2 GetPrintLevelPositionToSample(int index, double radius)
{
Vector2 bedCenter = ActiveSliceSettings.Instance.BedCenter;
if (index < 6)
{
Vector2 position = new Vector2(radius, 0);
position.Rotate(MathHelper.Tau / 6 * index);
position += ActiveSliceSettings.Instance.BedCenter;
position += bedCenter;
return position;
}
else
{
return new Vector2(0, 0);
return bedCenter;
}
}