Got the rest of circular beds working.
This commit is contained in:
parent
1d5c3b23dc
commit
05724383b8
3 changed files with 39 additions and 23 deletions
|
|
@ -28,22 +28,15 @@ either expressed or implied, of the FreeBSD Project.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.IO;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
using MatterHackers.Agg;
|
using MatterHackers.Agg;
|
||||||
using MatterHackers.Agg.Image;
|
|
||||||
using MatterHackers.Agg.UI;
|
using MatterHackers.Agg.UI;
|
||||||
using MatterHackers.Agg.OpenGlGui;
|
using MatterHackers.Agg.Font;
|
||||||
using MatterHackers.PolygonMesh;
|
using MatterHackers.Localizations;
|
||||||
using MatterHackers.RenderOpenGl;
|
|
||||||
using MatterHackers.VectorMath;
|
|
||||||
using MatterHackers.MatterControl.DataStorage;
|
using MatterHackers.MatterControl.DataStorage;
|
||||||
using MatterHackers.MatterControl.PrintQueue;
|
using MatterHackers.MatterControl.PrintQueue;
|
||||||
using MatterHackers.Localizations;
|
using MatterHackers.VectorMath;
|
||||||
|
|
||||||
namespace MatterHackers.MatterControl.PartPreviewWindow
|
namespace MatterHackers.MatterControl.PartPreviewWindow
|
||||||
{
|
{
|
||||||
|
|
@ -116,9 +109,12 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
||||||
#if false
|
#if false
|
||||||
if (timingWindow == null)
|
if (timingWindow == null)
|
||||||
{
|
{
|
||||||
timingWindow = new PerformanceFeedbackWindow();
|
string staticDataPath = ApplicationDataStorage.Instance.ApplicationStaticDataPath;
|
||||||
}
|
string fontPath = Path.Combine(staticDataPath, "Fonts", "LiberationMono.svg");
|
||||||
{
|
TypeFace boldTypeFace = TypeFace.LoadSVG(fontPath);
|
||||||
|
timingWindow = new PerformanceFeedbackWindow(new StyledTypeFace(boldTypeFace, 12));
|
||||||
|
//}
|
||||||
|
//{
|
||||||
timingWindow.ShowResults(totalDrawTime.Elapsed.TotalSeconds);
|
timingWindow.ShowResults(totalDrawTime.Elapsed.TotalSeconds);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -89,16 +89,36 @@ namespace MatterHackers.MatterControl
|
||||||
{
|
{
|
||||||
Vector2 bedSize = ActiveSliceSettings.Instance.BedSize;
|
Vector2 bedSize = ActiveSliceSettings.Instance.BedSize;
|
||||||
Vector2 printCenter = ActiveSliceSettings.Instance.PrintCenter;
|
Vector2 printCenter = ActiveSliceSettings.Instance.PrintCenter;
|
||||||
switch (index)
|
|
||||||
|
switch (BedShape)
|
||||||
{
|
{
|
||||||
case 0:
|
case MeshVisualizer.MeshViewerWidget.BedShape.Circular:
|
||||||
return new Vector2(printCenter.x, printCenter.y + (bedSize.y / 2) * .8);
|
Vector2 firstPosition = new Vector2(printCenter.x, printCenter.y + (bedSize.y / 2) * .8);
|
||||||
case 1:
|
switch (index)
|
||||||
return new Vector2(printCenter.x - (bedSize.x / 2) * .8, printCenter.y - (bedSize.y / 2) * .8);
|
{
|
||||||
case 2:
|
case 0:
|
||||||
return new Vector2(printCenter.x + (bedSize.x / 2) * .8, printCenter.y - (bedSize.y / 2) * .8);
|
return firstPosition;
|
||||||
|
case 1:
|
||||||
|
return Vector2.Rotate(firstPosition, MathHelper.Tau / 3);
|
||||||
|
case 2:
|
||||||
|
return Vector2.Rotate(firstPosition, MathHelper.Tau * 2 / 3);
|
||||||
|
default:
|
||||||
|
throw new IndexOutOfRangeException();
|
||||||
|
}
|
||||||
|
|
||||||
|
case MeshVisualizer.MeshViewerWidget.BedShape.Rectangular:
|
||||||
default:
|
default:
|
||||||
throw new IndexOutOfRangeException();
|
switch (index)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
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);
|
||||||
|
case 2:
|
||||||
|
return new Vector2(printCenter.x + (bedSize.x / 2) * .8, printCenter.y - (bedSize.y / 2) * .8);
|
||||||
|
default:
|
||||||
|
throw new IndexOutOfRangeException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ namespace MatterHackers.MatterControl
|
||||||
settingsStatusLabelContainer.VAnchor |= VAnchor.ParentTop;
|
settingsStatusLabelContainer.VAnchor |= VAnchor.ParentTop;
|
||||||
settingsStatusLabelContainer.Margin = new BorderDouble(0);
|
settingsStatusLabelContainer.Margin = new BorderDouble(0);
|
||||||
{
|
{
|
||||||
string activeSettingsLabelText = new LocalizedString ("Active Settings:").Translated;
|
string activeSettingsLabelText = new LocalizedString ("Active Settings").Translated;
|
||||||
string activeSettingsLabelTextFull = string.Format ("{0}:", activeSettingsLabelText);
|
string activeSettingsLabelTextFull = string.Format ("{0}:", activeSettingsLabelText);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue