refactoring
This commit is contained in:
parent
e4cdc106d8
commit
614ae5348c
4 changed files with 13 additions and 7 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 816644eda817f2e36dd68e034ffa19eef6a5548b
|
||||
Subproject commit 0c179037e1e5cce65f01fc3f4d15ea923d1fc346
|
||||
Loading…
Add table
Add a link
Reference in a new issue