diff --git a/MatterControlLib/DesignTools/EditorTools/ScaleControls/ScaleDiameterControl.cs b/MatterControlLib/DesignTools/EditorTools/ScaleControls/ScaleDiameterControl.cs index 3d3afe0a6..fdeac8896 100644 --- a/MatterControlLib/DesignTools/EditorTools/ScaleControls/ScaleDiameterControl.cs +++ b/MatterControlLib/DesignTools/EditorTools/ScaleControls/ScaleDiameterControl.cs @@ -185,10 +185,16 @@ namespace MatterHackers.Plugins.EditorTools private Matrix4X4 GetRingTransform() { - Vector3 newBottomCenter = ObjectSpace.GetCenterPosition(RootSelection, placement); - var rotation = Matrix4X4.CreateRotation(new Quaternion(RootSelection.Matrix)); - var translation = Matrix4X4.CreateTranslation(newBottomCenter); - return rotation * translation; + var rootSelection = RootSelection; + if (rootSelection != null) + { + Vector3 newBottomCenter = ObjectSpace.GetCenterPosition(RootSelection, placement); + var rotation = Matrix4X4.CreateRotation(new Quaternion(RootSelection.Matrix)); + var translation = Matrix4X4.CreateTranslation(newBottomCenter); + return rotation * translation; + } + + return Matrix4X4.Identity; } public override void Draw(DrawGlContentEventArgs e) diff --git a/MatterControlLib/DesignTools/Operations/FindSliceObject3D.cs b/MatterControlLib/DesignTools/Operations/FindSliceObject3D.cs index 3cab8d9cc..4058af75b 100644 --- a/MatterControlLib/DesignTools/Operations/FindSliceObject3D.cs +++ b/MatterControlLib/DesignTools/Operations/FindSliceObject3D.cs @@ -73,7 +73,7 @@ namespace MatterHackers.MatterControl.DesignTools // remove every face above the cut plane RemoveFacesAboveCut(mesh); - slice.Vertices().TriangulateFaces(null, mesh, SliceHeight); + slice.AsVertices().TriangulateFaces(null, mesh, SliceHeight); mesh.Transform(itemMatrix.Inverted); diff --git a/MatterControlLib/DesignTools/Operations/PlaneCutObject3D.cs b/MatterControlLib/DesignTools/Operations/PlaneCutObject3D.cs index 91e756c03..bb94d8812 100644 --- a/MatterControlLib/DesignTools/Operations/PlaneCutObject3D.cs +++ b/MatterControlLib/DesignTools/Operations/PlaneCutObject3D.cs @@ -76,7 +76,7 @@ namespace MatterHackers.MatterControl.DesignTools // remove every face above the cut plane RemoveFacesAboveCut(mesh); - slice.Vertices().TriangulateFaces(null, mesh, cutHeight); + slice.AsVertices().TriangulateFaces(null, mesh, cutHeight); mesh.Transform(itemMatrix.Inverted); diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 816644eda..0c179037e 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 816644eda817f2e36dd68e034ffa19eef6a5548b +Subproject commit 0c179037e1e5cce65f01fc3f4d15ea923d1fc346