diff --git a/MatterControlLib/ApplicationView/SceneOperations.cs b/MatterControlLib/ApplicationView/SceneOperations.cs index 520d1b866..1be4d832f 100644 --- a/MatterControlLib/ApplicationView/SceneOperations.cs +++ b/MatterControlLib/ApplicationView/SceneOperations.cs @@ -71,7 +71,7 @@ namespace MatterHackers.MatterControl { return new SceneOperation("AddBase") { - OperationType = typeof(IPathObject), + OperationType = typeof(IObject3D), TitleResolver = () => "Add Base".Localize(), ResultType = typeof(BaseObject3D), Action = (sceneContext) => diff --git a/MatterControlLib/DesignTools/Primitives/BaseObject3D.cs b/MatterControlLib/DesignTools/Primitives/BaseObject3D.cs index b808b592a..312f04b25 100644 --- a/MatterControlLib/DesignTools/Primitives/BaseObject3D.cs +++ b/MatterControlLib/DesignTools/Primitives/BaseObject3D.cs @@ -40,6 +40,7 @@ using MatterHackers.DataConverters2D; using MatterHackers.DataConverters3D; using MatterHackers.Localizations; using MatterHackers.MatterControl.DesignTools.Operations; +using MatterHackers.PolygonMesh.Csg; using MatterHackers.VectorMath; using Newtonsoft.Json; using Polygon = System.Collections.Generic.List; @@ -125,6 +126,20 @@ namespace MatterHackers.MatterControl.DesignTools get { var vertexSource = (IPathObject)this.Descendants().FirstOrDefault((i) => i is IPathObject); + var meshSource = this.Descendants().FirstOrDefault((i) => i.Mesh != null); + var mesh = meshSource?.Mesh; + if (vertexSource?.VertexSource == null + && mesh != null) + { + // return the vertex source of the bottom of the mesh + var aabb = this.GetAxisAlignedBoundingBox(); + var cutPlane = new Plane(Vector3.UnitZ, new Vector3(0, 0, aabb.MinXYZ.Z + .1)); + cutPlane = Plane.Transform(cutPlane, this.Matrix.Inverted); + var slice = SliceLayer.CreateSlice(mesh, cutPlane); + return slice.CreateVertexStorage(); + + } + return vertexSource?.VertexSource; } diff --git a/Submodules/MatterSlice b/Submodules/MatterSlice index 18f8d4db0..630ef7334 160000 --- a/Submodules/MatterSlice +++ b/Submodules/MatterSlice @@ -1 +1 @@ -Subproject commit 18f8d4db0a361138d68845ef24fd22f5804f9347 +Subproject commit 630ef7334038b950c0a9287409c31ab5a70e6f36 diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index e56cb7d05..6c49a7095 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit e56cb7d0578299174d9fb971e9e731dfb8c29e77 +Subproject commit 6c49a709565589f5e233f81bfc1c1ed60b08361d