Put 0 height objects slightly above the bed

This commit is contained in:
Lars Brubaker 2018-03-07 09:55:55 -08:00
parent 4ab89c9d77
commit 4e41fa6694
2 changed files with 10 additions and 1 deletions

View file

@ -32,6 +32,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using MatterHackers.DataConverters3D;
using MatterHackers.MatterControl.DesignTools.Operations;
using MatterHackers.MatterControl.PartPreviewWindow;
using MatterHackers.PolygonMesh;
using MatterHackers.VectorMath;
@ -107,6 +108,14 @@ namespace MatterHackers.MatterControl.Library
// Copy scale/rotation/translation from the source and Center
loadedItem.Matrix = loadedItem.Matrix * Matrix4X4.CreateTranslation((double)-aabb.Center.X, (double)-aabb.Center.Y, (double)-aabb.minXYZ.Z) * placeholderItem.Matrix;
// check if the item has 0 height (it is probably an image)
if(loadedItem.ZSize() == 0)
{
// raise it up a bit so it is not z fighting with the bed
loadedItem.Matrix *= Matrix4X4.CreateTranslation(0, 0, .1);
}
loadedItem.Color = loadedItem.Color;
// Set mesh path if tracking requested

@ -1 +1 @@
Subproject commit 5249b55d99b14ecf2f62d92de64e6ad342698ae2
Subproject commit 19b7cdf7679822e1313c1718c3587c6eaeaca697