diff --git a/MatterControlLib/DesignTools/Operations/Image/ImageToPathObject3D_2.cs b/MatterControlLib/DesignTools/Operations/Image/ImageToPathObject3D_2.cs index 62fcc11ba..3d12ef3a4 100644 --- a/MatterControlLib/DesignTools/Operations/Image/ImageToPathObject3D_2.cs +++ b/MatterControlLib/DesignTools/Operations/Image/ImageToPathObject3D_2.cs @@ -173,8 +173,6 @@ namespace MatterHackers.MatterControl.DesignTools [MaxDecimalPlaces(2)] public double MinSurfaceArea {get; set; } = 1; - public override IVertexSource VertexSource { get; set; } = new VertexStorage(); - public void AddObject3DControls(Object3DControlsLayer object3DControlsLayer) { object3DControlsLayer.AddControls(ControlTypes.Standard2D); @@ -273,7 +271,7 @@ namespace MatterHackers.MatterControl.DesignTools affine *= Affine.NewTranslation(-aabb.XSize / 2, -aabb.YSize / 2); rawVectorShape.transform(affine); - this.VertexSource = rawVectorShape; + this.VertexStorage = rawVectorShape; progressReporter?.Invoke(1, null); } diff --git a/MatterControlLib/DesignTools/Operations/Object3DExtensions.cs b/MatterControlLib/DesignTools/Operations/Object3DExtensions.cs index 41e05329b..d756b4fff 100644 --- a/MatterControlLib/DesignTools/Operations/Object3DExtensions.cs +++ b/MatterControlLib/DesignTools/Operations/Object3DExtensions.cs @@ -198,14 +198,14 @@ namespace MatterHackers.MatterControl.DesignTools.Operations public static void DrawPath(this IObject3D item) { - if (item.VertexSource != null) + if (item.GetVertexSource() != null) { bool first = true; var lastPosition = Vector2.Zero; var maxXYZ = item.GetAxisAlignedBoundingBox().MaxXYZ; maxXYZ = maxXYZ.Transform(item.Matrix.Inverted); var firstMove = Vector2.Zero; - foreach (var vertex in item.VertexSource.Vertices()) + foreach (var vertex in item.GetVertexSource().Vertices()) { var position = vertex.position; if (first) diff --git a/MatterControlLib/DesignTools/Operations/Path/InflatePathObject3D.cs b/MatterControlLib/DesignTools/Operations/Path/InflatePathObject3D.cs index 052a5975c..5baa95458 100644 --- a/MatterControlLib/DesignTools/Operations/Path/InflatePathObject3D.cs +++ b/MatterControlLib/DesignTools/Operations/Path/InflatePathObject3D.cs @@ -58,7 +58,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations } [Description("The amount to expand the path lines.")] - public DoubleOrExpression Inflate { get; set; } = 1; + public DoubleOrExpression Inflate { get; set; } = .2; [EnumDisplay(Mode = EnumDisplayAttribute.PresentationMode.Buttons)] public ExpandStyles Style { get; set; } = ExpandStyles.Sharp; diff --git a/MatterControlLib/DesignTools/Operations/Path/OutlinePathObject3D.cs b/MatterControlLib/DesignTools/Operations/Path/OutlinePathObject3D.cs index 1ad9cf18f..7d6bb8cad 100644 --- a/MatterControlLib/DesignTools/Operations/Path/OutlinePathObject3D.cs +++ b/MatterControlLib/DesignTools/Operations/Path/OutlinePathObject3D.cs @@ -53,7 +53,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations } [Description("The with of the outline.")] - public DoubleOrExpression OutlineWidth { get; set; } = 3; + public DoubleOrExpression OutlineWidth { get; set; } = .5; [Description("The offset of the outside of the outline as a ratio of the width.")] public DoubleOrExpression Offset { get; set; } = .5; diff --git a/MatterControlLib/DesignTools/Primitives/TextObject3D.cs b/MatterControlLib/DesignTools/Primitives/TextObject3D.cs index ca5ec9707..ce6c27813 100644 --- a/MatterControlLib/DesignTools/Primitives/TextObject3D.cs +++ b/MatterControlLib/DesignTools/Primitives/TextObject3D.cs @@ -40,6 +40,7 @@ using MatterHackers.DataConverters3D; using MatterHackers.DataConverters3D.UndoCommands; using MatterHackers.Localizations; using MatterHackers.MatterControl.DesignTools.Operations; +using MatterHackers.MatterControl.PartPreviewWindow; using MatterHackers.PolygonMesh; using MatterHackers.PolygonMesh.Processors; using MatterHackers.VectorMath; @@ -59,9 +60,11 @@ namespace MatterHackers.MatterControl.DesignTools } [HideChildrenFromTreeView] - public class TextObject3D : Object3D, IPropertyGridModifier + public class TextObject3D : Object3D, IPropertyGridModifier, IEditorDraw { - [JsonConverter(typeof(StringEnumConverter))] + private bool refreshToolBar; + + [JsonConverter(typeof(StringEnumConverter))] public enum TextAlign { Left, @@ -304,6 +307,10 @@ namespace MatterHackers.MatterControl.DesignTools Invalidate(InvalidateType.DisplayValues); this.CancelAllParentBuilding(); Parent?.Invalidate(new InvalidateArgs(this, InvalidateType.Children)); + if (refreshToolBar) + { + this.RefreshToolBar(); + } }); }); } @@ -316,8 +323,18 @@ namespace MatterHackers.MatterControl.DesignTools change.SetRowVisible(nameof(Height), () => Output == OutputDimensions.Output3D); if (change.Changed == nameof(Output)) { - this.RefreshToolBar(); + refreshToolBar = true; } } + + public void DrawEditor(Object3DControlsLayer object3DControlLayer, DrawEventArgs e) + { + this.DrawPath(); + } + + public AxisAlignedBoundingBox GetEditorWorldspaceAABB(Object3DControlsLayer layer) + { + return this.GetWorldspaceAabbOfDrawPath(); + } } } \ No newline at end of file