Merge pull request #2682 from larsbrubaker/design_tools

Make sure we check for on bed in circular beds.
This commit is contained in:
Lars Brubaker 2017-11-18 10:12:06 -08:00 committed by GitHub
commit d4c6e58316
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -98,7 +98,17 @@ namespace MatterHackers.MeshVisualizer
}
break;
case BedShape.Circular:
case BedShape.Circular:
// This could be much better if it checked the actual vertext data of the mesh against the cylinder
// first check if any of it is outside the bed rect
if (aabb.minXYZ.X < bed.BedCenter.X - bed.ViewerVolume.X / 2
|| aabb.maxXYZ.X > bed.BedCenter.X + bed.ViewerVolume.X / 2
|| aabb.minXYZ.Y < bed.BedCenter.Y - bed.ViewerVolume.Y / 2
|| aabb.maxXYZ.Y > bed.BedCenter.Y + bed.ViewerVolume.Y / 2)
{
// TODO: then check if all of it is outside the bed circle
return false;
}
break;
}