diff --git a/DesignTools/Primitives/BaseObject3D.cs b/DesignTools/Primitives/BaseObject3D.cs index b2529b4b3..269a29a24 100644 --- a/DesignTools/Primitives/BaseObject3D.cs +++ b/DesignTools/Primitives/BaseObject3D.cs @@ -29,14 +29,13 @@ either expressed or implied, of the FreeBSD Project. using System; using System.Collections.Generic; -using System.Threading; +using System.Linq; using ClipperLib; using MatterHackers.Agg.Transform; using MatterHackers.Agg.UI; using MatterHackers.Agg.VertexSource; +using MatterHackers.DataConverters2D; using MatterHackers.DataConverters3D; -using MatterHackers.PolygonMesh; -using MatterHackers.VectorMath; namespace MatterHackers.MatterControl.DesignTools { @@ -52,13 +51,13 @@ namespace MatterHackers.MatterControl.DesignTools { } - - public double ExtrusionHeight { get; set; } = 5; public int InfillAmount { get; internal set; } public BaseTypes CurrentBaseType { get; set; } public int BaseSize { get; set; } + public IVertexSource VertexSource { get; set; } + public static BaseObject3D Create() { var item = new BaseObject3D(); @@ -70,8 +69,14 @@ namespace MatterHackers.MatterControl.DesignTools { var aabb = this.GetAxisAlignedBoundingBox(); - Polygons polygonShape = null; + // Fall back to sibling content if VertexSource is unset + var vertexSource = this.VertexSource ?? this.Parent.Children.OfType().FirstOrDefault().VertexSource; + + // Convert VertexSource into expected Polygons + Polygons polygonShape = (vertexSource == null) ? null : VertexSourceToClipperPolygons.CreatePolygons(vertexSource); + GenerateBase(polygonShape); + if (aabb.ZSize > 0) { // If the part was already created and at a height, maintain the height. diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 56dcc696d..d831c5bd7 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 56dcc696d8f1ab7ba9a411147eea39cb7b322305 +Subproject commit d831c5bd787e0913d0dc25b1c6b28a162bf73207