Make sure we only split sorted meshes

This commit is contained in:
Lars Brubaker 2018-04-09 12:34:30 -07:00
parent 5cb3d97bfa
commit 32e38ff3d6

View file

@ -61,9 +61,15 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
var ungroupItem = Scene.SelectedItem;
// clear the selection
Scene.SelectedItem = null;
var ungroupMesh = ungroupItem.Mesh;
if (!ungroupMesh.Vertices.IsSorted)
{
ungroupMesh.CleanAndMergeMesh(CancellationToken.None);
}
// try to cut it up into multiple meshes
var discreetMeshes = CreateDiscreteMeshes.SplitVolumesIntoMeshes(ungroupItem.Mesh, CancellationToken.None, (double progress0To1, string processingState) =>
var discreetMeshes = CreateDiscreteMeshes.SplitVolumesIntoMeshes(ungroupMesh, CancellationToken.None, (double progress0To1, string processingState) =>
{
//view3DWidget.ReportProgressChanged(progress0To1 * .5, processingState);
});