improve VisibleMeshes thread safety
issue: MatterHackers/MCCentral#2900 Make VisibleMeshes more thread safe
This commit is contained in:
parent
eb061d68c0
commit
57c79d2434
10 changed files with 44 additions and 43 deletions
|
|
@ -138,11 +138,11 @@ namespace MatterHackers.MatterControl
|
|||
var loadedMeshGroups = object3D.VisibleMeshes().ToList();
|
||||
if (loadedMeshGroups?.Count > 0)
|
||||
{
|
||||
AxisAlignedBoundingBox aabb = loadedMeshGroups[0].Mesh.GetAxisAlignedBoundingBox(loadedMeshGroups[0].WorldMatrix());
|
||||
AxisAlignedBoundingBox aabb = loadedMeshGroups[0].mesh.GetAxisAlignedBoundingBox(loadedMeshGroups[0].object3D.WorldMatrix());
|
||||
|
||||
for (int i = 1; i < loadedMeshGroups.Count; i++)
|
||||
{
|
||||
aabb = AxisAlignedBoundingBox.Union(aabb, loadedMeshGroups[i].Mesh.GetAxisAlignedBoundingBox(loadedMeshGroups[i].WorldMatrix()));
|
||||
aabb = AxisAlignedBoundingBox.Union(aabb, loadedMeshGroups[i].mesh.GetAxisAlignedBoundingBox(loadedMeshGroups[i].object3D.WorldMatrix()));
|
||||
}
|
||||
|
||||
RectangleDouble bounds2D = new RectangleDouble(aabb.minXYZ.X, aabb.minXYZ.Y, aabb.maxXYZ.X, aabb.maxXYZ.Y);
|
||||
|
|
@ -169,7 +169,7 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
foreach (var meshGroup in loadedMeshGroups)
|
||||
{
|
||||
PolygonMesh.Rendering.OrthographicZProjection.DrawTo(partGraphics2D, meshGroup.Mesh, meshGroup.WorldMatrix(), new Vector2(-bounds2D.Left + PartMarginMM, -bounds2D.Bottom + textSpaceMM + PartMarginMM), PixelPerMM, Color.Black);
|
||||
PolygonMesh.Rendering.OrthographicZProjection.DrawTo(partGraphics2D, meshGroup.mesh, meshGroup.object3D.WorldMatrix(), new Vector2(-bounds2D.Left + PartMarginMM, -bounds2D.Bottom + textSpaceMM + PartMarginMM), PixelPerMM, Color.Black);
|
||||
}
|
||||
partGraphics2D.Render(typeFacePrinter, Color.Black);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue