Improving hole handleing
This commit is contained in:
parent
becde49091
commit
2fd226c155
2 changed files with 27 additions and 12 deletions
|
|
@ -129,11 +129,16 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.View3D
|
|||
SourceContainer.Visible = true;
|
||||
RemoveAllButSource();
|
||||
|
||||
var holes = SourceContainer.VisibleMeshes().Where(m => m.WorldOutputType(this) == PrintOutputTypes.Hole);
|
||||
|
||||
Mesh resultsMesh = null;
|
||||
var participants = SourceContainer.VisibleMeshes().Where(m => m.WorldOutputType(this) != PrintOutputTypes.Hole);
|
||||
if (participants.Count() == 0)
|
||||
{
|
||||
return;
|
||||
if (holes.Count() == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -145,23 +150,33 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.View3D
|
|||
Mesh = resultsMesh
|
||||
};
|
||||
|
||||
if (resultsMesh != null)
|
||||
if (holes != null)
|
||||
{
|
||||
var holes = SourceContainer.VisibleMeshes().Where(m => m.WorldOutputType(this) == PrintOutputTypes.Hole);
|
||||
if (holes != null)
|
||||
var holesMesh = CombineParticipanets(null, holes, cancellationToken);
|
||||
if (holesMesh != null)
|
||||
{
|
||||
var holesMesh = CombineParticipanets(null, holes, cancellationToken);
|
||||
var holesItem = new Object3D()
|
||||
{
|
||||
Mesh = holesMesh
|
||||
};
|
||||
var resultItems = SubtractObject3D_2.DoSubtract(null,
|
||||
new List<IObject3D>() { resultsItem },
|
||||
new List<IObject3D>() { holesItem },
|
||||
null,
|
||||
cancellationToken);
|
||||
|
||||
resultsItem.Mesh = resultItems.First().Mesh;
|
||||
if (resultsMesh != null)
|
||||
{
|
||||
var resultItems = SubtractObject3D_2.DoSubtract(null,
|
||||
new List<IObject3D>() { resultsItem },
|
||||
new List<IObject3D>() { holesItem },
|
||||
null,
|
||||
cancellationToken);
|
||||
|
||||
resultsItem.Mesh = resultItems.First().Mesh;
|
||||
}
|
||||
else
|
||||
{
|
||||
holesItem.CopyProperties(holes.First(), Object3DPropertyFlags.All & (~Object3DPropertyFlags.Matrix));
|
||||
this.Children.Add(holesItem);
|
||||
SourceContainer.Visible = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 54c34975dc6d03cfab7875582256030810254d69
|
||||
Subproject commit 816644eda817f2e36dd68e034ffa19eef6a5548b
|
||||
Loading…
Add table
Add a link
Reference in a new issue